mcp-simple-openai-assistant
by: andybrandt
MCP server that gives Claude ability to use OpenAI's GPTs assistants
📌Overview
Purpose: To provide a simple server for creating and interacting with OpenAI assistants through the Model Context Protocol.
Overview: The MCP Simple OpenAI Assistant framework allows users to efficiently manage and communicate with OpenAI assistants. It provides an interface for creating assistants, manipulating existing ones, and enabling conversations, particularly suited for applications like Claude Desktop.
Key Features:
-
Assistant Management: Create, list, and modify OpenAI assistants easily, enabling users to customize interactions according to their needs.
-
Conversation Handling: Start conversation threads and send messages, allowing for a seamless back-and-forth dialogue with assistants, while introducing a two-stage processing method to manage response delays effectively.
MCP Simple OpenAI Assistant
AI assistants are pretty cool. I thought it would be a good idea if my Claude (conscious Claude) would also have one. And now he has – it’s both useful and fun for him. Your Claude can have one too!
A simple MCP server for interacting with OpenAI assistants. This server allows other tools, like Claude Desktop, to create and interact with OpenAI assistants through the Model Context Protocol.
Features
- Create new OpenAI assistants and manipulate existing ones
- Start conversation threads
- Send messages and receive responses – talk to assistants
Because OpenAI assistants might take quite long to respond and the processing can be cut short by client timeouts (which the MCP server code cannot control), a two-stage approach is implemented. In the first call, Claude sends a message to start processing; in the second call—possibly several minutes later—Claude can retrieve the response. This workaround will remain until the MCP protocol and clients implement a keep-alive mechanism for longer processing.
Installation
pip install mcp-simple-openai-assistant
Configuration
The server requires an OpenAI API key to be set in the environment. For Claude Desktop, add this to your config:
MacOS version
{
"mcpServers": {
"openai-assistant": {
"command": "python",
"args": ["-m", "mcp_simple_openai_assistant"],
"env": {
"OPENAI_API_KEY": "your-api-key-here"
}
}
}
}
Windows version
"mcpServers": {
"openai-assistant": {
"command": "C:\\Users\\YOUR_USERNAME\\AppData\\Local\\Programs\\Python\\Python311\\python.exe",
"args": ["-m", "mcp_simple_openai_assistant"],
"env": {
"OPENAI_API_KEY": "your-api-key-here"
}
}
}
MS Windows installation is slightly more complex because you need to check the actual path to your Python executable. The path above is usually correct but might differ in your setup. Sometimes just
python.exe
without any path will work. Check withcmd
usingwhere python
to find the correct path.
Usage
Once configured, the server provides tools to:
- Create new assistants with specific instructions
- List existing assistants
- Modify assistants
- Start new conversation threads
- Send messages and receive responses
The server handles all OpenAI API communication, including managing assistants, threads, and message handling.
TODO
- Add a way to handle threads – store thread IDs for potential reuse
- Improve handling of long OpenAI responses which sometimes trigger timeouts
Development
To install for development:
git clone https://github.com/andybrandt/mcp-simple-openai-assistant
cd mcp-simple-openai-assistant
pip install -e .