Skip to main content

A simple MCP server for interacting with OpenAI assistants

Project description

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 - and its both useful anf 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.

smithery badge MseeP.ai Security Assessment Badge

Features

This server provides a suite of tools to manage and interact with OpenAI Assistants. The new streaming capabilities provide a much-improved, real-time user experience.

Available Tools

  • create_assistant: (Create OpenAI Assistant) - Create a new assistant with a name, instructions, and model.
  • list_assistants: (List OpenAI Assistants) - List all available assistants associated with your API key.
  • retrieve_assistant: (Retrieve OpenAI Assistant) - Get detailed information about a specific assistant.
  • update_assistant: (Update OpenAI Assistant) - Modify an existing assistant's name, instructions, or model.
  • new_thread: (Create New Thread) - Creates a new, empty conversation thread.
  • ask_assistant_in_thread: (Ask Assistant in Thread and Stream Response) - The primary tool for conversation. Sends a message to an assistant within a thread and streams the response back in real-time.

Because OpenAI assistants might take quite long to respond, this server uses a streaming approach for the main ask_assistant_in_thread tool. This provides real-time progress updates to the client and avoids timeouts.

Installation

Installing via Smithery

To install MCP Simple OpenAI Assistant for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install mcp-simple-openai-assistant --client claude

Manual 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. Path provided above is usually correct, but might differ in your setup. Sometimes just python.exe without any path will do the trick. Check with cmd what works for you (using where python might help). Also, on Windows you might need to explicitly tell Claude Desktop where the site packages are using PYTHONPATH environmment variable.

Usage

Once configured, you can use the tools listed above to manage your assistants and conversations. The primary workflow is to create or retrieve an assistant and a thread, and then use ask_assistant_in_thread to interact with it.

TODO

  • Add Thread Management: Introduce a way to name and persist thread IDs locally, allowing for easier reuse of conversations.
  • Explore Resource Support: Add the ability to upload files and use them with assistants.

Development

To install for development:

git clone https://github.com/andybrandt/mcp-simple-openai-assistant
cd mcp-simple-openai-assistant
pip install -e '.[dev]'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_simple_openai_assistant-0.3.1.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_simple_openai_assistant-0.3.1-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file mcp_simple_openai_assistant-0.3.1.tar.gz.

File metadata

File hashes

Hashes for mcp_simple_openai_assistant-0.3.1.tar.gz
Algorithm Hash digest
SHA256 61c2b0cb7bca4d68e3fc596d6a4f97d21518bd1895801663c2b98a7416e8295f
MD5 1e874fa3832f46fa28412a82f8ad146f
BLAKE2b-256 14089e2d3bab2d06c3f51097f4bf566d3b97ae32f033a49ca23f81e4b0a306a5

See more details on using hashes here.

File details

Details for the file mcp_simple_openai_assistant-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_simple_openai_assistant-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2c3635a15b9c5b3e2ef6f0d43dca182657249e78099a4ad35194a6ed6670cbe3
MD5 95127ed2c68f5772f45bc168a3ac7477
BLAKE2b-256 653bece3d7233e36ee6f699d31dc583d28097aee0037abc248f2f8847587e28f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page