- Home
- MCP servers
- OpenAI
OpenAI
- python
1
GitHub Stars
python
Language
5 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
You run a focused MCP server that bridges between MCP clients and OpenAI’s Chat Completion and Assistant capabilities. This server lets you manage assistants, upload files for context, and control which tools are available, all through a standardized MCP interface so your clients can interact with OpenAI securely and consistently.
How to use
Install and run the server, then connect your MCP client to it. You can start the server by providing your OpenAI API key either via an environment variable or as a direct command-line argument. Use the client to perform tasks like asking questions to models such as gpt-4 and gpt-3.5-turbo, managing assistants (create, list, retrieve, update, delete), and handling files associated with assistants (upload, list, delete). You can also enable or disable tools for each assistant, such as file_search, to tailor capabilities per assistant.
How to install
Prerequisites: ensure you have Python installed on your system.
-
Open a terminal. 2) Navigate to the project root where the MCP server package is located.
-
Install the server package in your environment.
-
Verify installation and readiness to start the server.
Additional setup and configuration
Run the server by supplying your OpenAI API key one of two ways. Set the environment variable OPENAI_API_KEY or pass the key as a command-line argument.
Environment variable method:
export OPENAI_API_KEY='your-api-key-here'
mcp-server-openai
Command-line argument method:
mcp-server-openai --openai-api-key 'your-api-key-here'
Available tools
ask-openai
Ask a direct question to a specified OpenAI model using the server's MCP interface.
list-assistants
Return a list of all assistants defined in the server.
retrieve-assistant
Fetch details for a specific assistant by its ID.
create-assistant
Create a new assistant with a name, instructions, and model settings.
update-assistant
Update properties of an existing assistant, such as name, instructions, or model.
delete-assistant
Remove an assistant by its ID.
upload-file
Upload a file to be associated with assistants for context or retrieval.
list-files
List all uploaded files available to assistants.
delete-file
Delete a file by its ID from the available files.