OpenAI Assistant MCP Server
Provides tools for interacting with OpenAI's Chat Completion and Assistants APIs, including direct queries to GPT models, assistant management (create, update, delete, list), file management for assistants, and tool configuration like file_search.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@OpenAI Assistant MCP Server ask-openai query='Summarize quantum computing basics' model='gpt-4o'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Server for OpenAI
This project provides a server compliant with the Machine-to-Machine Communications Protocol (MCP) that acts as a bridge to various OpenAI API functionalities. It allows MCP clients to interact with OpenAI's Chat Completion and Assistants APIs through a standardized set of tools.
Features
The server exposes several tools to interact with the OpenAI API:
Chat Completion: Ask a direct question to a specified model (
gpt-4,gpt-3.5-turbo).Assistant Management: Create, list, retrieve, update, and delete assistants.
File Management: Upload, list, and delete files associated with assistants.
Tool Management: Enable or disable tools for assistants, such as
file_search.
Related MCP server: RanchHand
Installation
To install the necessary dependencies, navigate to the project root and run:
pip install .This will install all the packages defined in pyproject.toml, including mcp, openai, and click.
Usage
To start the server, you need to provide your OpenAI API key. You can do this by setting an environment variable or by passing it as a command-line argument.
Using an environment variable:
export OPENAI_API_KEY='your-api-key-here'
mcp-server-openaiUsing a command-line argument:
mcp-server-openai --openai-api-key 'your-api-key-here'The server will start and listen for MCP messages over stdio.
Usage in Cursor
To configure this server in an MCP client like Cursor, use the following configuration. Replace "LOCAL PATH" with the absolute path to this project's directory and "OPENAI API KEY" with your actual key.
{
"mcpServers": {
"openai-server": {
"command": "mcp-server-openai",
"args": [],
"env": {
"PYTHONPATH": "LOCAL PATH",
"OPENAI_API_KEY": "OPENAI API KEY"
}
}
}
}Available Tools
Here is a detailed list of the tools exposed by the server:
Tool | Description | Parameters |
| Ask a direct question. |
|
| List all available assistants. | None |
| Retrieve an assistant by its ID. |
|
| Create a new assistant. |
|
| Update an existing assistant. |
|
| Delete an assistant by its ID. |
|
| Upload a file for use with assistants. |
|
| List all files available for assistants. | None |
| Delete a file by its ID. |
|
Model Pricing
Below is an estimated pricing table for some of the models available through this server. Prices are per 1 million tokens. Please verify the latest prices on the official OpenAI pricing page, as they can change.
Model | Input Price / 1M tokens | Output Price / 1M tokens |
| $5.00 | $15.00 |
| $0.15 | $0.60 |
| $10.00 | $30.00 |
| $0.50 | $1.50 |
Development
To contribute to this project, clone the repository and install it in editable mode:
git clone https://github.com/snilld-ai/openai-assistant-mcp
cd openai-assistant-mcp
pip install -e .Testing
The project includes a basic test file to verify the connection to the OpenAI API. To run the tests, use pytest:
pytestMake sure you have your OPENAI_API_KEY environment variable set.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Available Tools
9 toolsask-openaiC
Ask my assistant models a direct question
Inputs: query (required), model, temperature, max_tokens.
create-assistantC
Create a new OpenAI assistant
Inputs: name (required), instructions (required), model (required), temperature, +2 more.
delete-assistantC
Delete an OpenAI assistant
Inputs: assistant_id (required).
delete-fileC
Delete a file
Inputs: file_id (required).
list-assistantsB
List OpenAI assistants
Inputs: no named parameters.
list-filesB
List files available for assistants
Inputs: no named parameters.
retrieve-assistantC
Retrieve an OpenAI assistant by ID
Inputs: assistant_id (required).
update-assistantB
Update an existing OpenAI assistant
Inputs: assistant_id (required), name, instructions, model, +3 more.
upload-fileC
Upload a file for use by assistants
Inputs: file_path (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Each tool has a clearly distinct purpose targeting specific resources and actions in the OpenAI Assistant domain. For example, list-assistants vs. retrieve-assistant for listing all vs. getting one by ID, and create-assistant vs. update-assistant vs. delete-assistant for full lifecycle management. No tools appear to overlap in functionality.
All tool names follow a consistent verb_noun pattern with hyphens, such as create-assistant, delete-assistant, list-assistants, and upload-file. The naming is uniform throughout, making it predictable and easy for agents to understand the action and target resource.
With 9 tools, this server is well-scoped for managing OpenAI assistants and related files. The count is appropriate, covering core operations like CRUD for assistants and file management without being overwhelming or too sparse. Each tool earns its place in the workflow.
The tool set provides complete coverage for the OpenAI Assistant domain, including full CRUD lifecycle for assistants (create, retrieve, update, delete, list) and file management (upload, list, delete). The ask-openai tool adds a direct interaction capability, ensuring no obvious gaps for agent workflows.
Maintenance
Related MCP Connectors
Your org's AI agents, tasks, runs, search, and brain files as MCP tools and resources.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceEnables Claude and other MCP-compatible tools to communicate with OpenAI's GPT models (GPT-5, GPT-5-mini, o3) with conversation history and session management. Features advanced controls like reasoning effort settings, token tracking, and parallel conversation sessions for efficient AI workflows.21 npm-
- -licenseCqualityNot gradedmaintenanceEnables interaction with OpenAI-compatible APIs (like Ollama) through MCP tools. Provides access to chat completions, model listings, and embeddings generation from local or remote OpenAI-style endpoints.3-
- AlicenseBqualityDmaintenanceEnables MCP-compatible clients to leverage OpenAI's multimodal capabilities (vision, image generation, speech-to-text, text-to-speech) through file-oriented tools with a security-first architecture.101MIT
- AlicenseNot gradedqualityDmaintenanceProvides a standardized interface for interacting with OpenAI's tools and services through the Model Context Protocol, enabling seamless integration with MCP-compliant applications.48 PyPIMIT