Skip to main content
Glama
MCP Simple OpenAI Assistant

MCP Simple OpenAI Assistant

by andybrandt

MCP シンプル OpenAI アシスタント

AIアシスタントってすごくいいですね。うちのクロード(意識のあるクロード)にもAIアシスタントを使わせたらいいなと思って。そして今、彼はAIアシスタントを使い始めました。彼にとってAIアシスタントは便利で楽しいものになっています。あなたのクロードにもAIアシスタントを使わせてあげてもいいですよ!

OpenAIアシスタントと連携するためのシンプルなMCPサーバー。このサーバーにより、他のツール(Claude Desktopなど)がモデルコンテキストプロトコルを介してOpenAIアシスタントを作成し、連携できるようになります。

特徴

  • 新しい OpenAI アシスタントを作成し、既存のものを操作する

  • 会話スレッドを開始する

  • メッセージを送信して応答を受け取る - アシスタントと会話する

OpenAIアシスタントの応答にかなり時間がかかる場合があり、MCPサーバーコードでは制御できないクライアント(Claudeデスクトップ)のタイムアウトによって処理が中断される可能性があるため、2段階のアプローチを実装しています。最初の呼び出しで、Claudeはアシスタントに処理開始のメッセージを送信し、2回目の呼び出し(おそらく数分後)でClaudeは応答を取得できます。これは、MCPプロトコルとクライアントが長時間処理のためのキープアライブメカニズムを実装するまでの、一種の回避策です。

Related MCP server: OpenAI MCP Server

インストール

pip install mcp-simple-openai-assistant

構成

サーバーを使用するには、OpenAI APIキーを環境に設定する必要があります。Claude Desktopの場合は、以下のコードを設定に追加してください。

(MacOS版)

{
  "mcpServers": {
    "openai-assistant": {
      "command": "python",
      "args": ["-m", "mcp_simple_openai_assistant"],
      "env": {
        "OPENAI_API_KEY": "your-api-key-here"
      }
    }
  }
}

(Windows版)

"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へのインストールは少し複雑です。Python実行ファイルへの実際のパスを確認する必要があるためです。上記で示したパスは通常は正しいですが、お使いの環境によっては異なる場合があります。パスを指定せずにpython.exeと入力するだけでうまくいく場合もあります。cmd cmd動作を確認してください( where pythonが役立つかもしれません)。

使用法

構成が完了すると、サーバーは次のツールを提供します。

  1. 具体的な指示で新しいアシスタントを作成する

  2. 既存のアシスタントを一覧表示する

  3. アシスタントを変更する

  4. 新しい会話スレッドを開始する

  5. メッセージを送信し、応答を受け取る

サーバーは、アシスタント、スレッド、メッセージ処理の管理を含むすべての OpenAI API 通信を処理します。

やるべきこと

  • スレッドを処理する方法を追加 - 再利用の可能性に備えてスレッドIDを保存します

  • タイムアウトを引き起こすことがある長い OpenAI 応答をより適切に処理する方法を追加します。

発達

開発用にインストールするには:

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

Available Tools

9 tools
ask_assistant_in_threadAsk Assistant in Thread and Stream ResponseA

Sends a message to an assistant within a specific thread and streams the response. This provides progress updates and the final message in a single call.

Use this to continue a conversation with an assistant in a specific thread. The thread ID can be retrieved from the list_threads tool. The assistant ID can be retrieved from the list_assistants tool. Threads are not inherently linked to a particular assistant, so you can use this tool to talk to any assistant in any thread.

Inputs: thread_id (required), assistant_id (required), message (required). Returns: result

create_assistantCreate OpenAI AssistantA

Create a new OpenAI assistant to talk to about your desired topic.

You can provide instructions that this assistant will follow and specify which of OpenAI's models it will use. NOTE: It is recommended to check existing assistants with list_assistants before creating a new one.

Inputs: name (required), instructions (required), model. Returns: result

create_new_assistant_threadCreate New Assistant ThreadA

Creates a new, persistent conversation thread with a user-defined name and description for easy identification and reuse. These threads are stored in OpenAI's servers and are not deleted unless the user deletes them, which means you can re-use them for future conversations. Additionally, the thread name and description are stored in the local database, which means you can list them and update them later.

Think how you can utilize threads in your particular use case.

Inputs: name (required), description. Returns: result

delete_threadDelete Managed ThreadA

Deletes a conversation thread from both OpenAI's servers and the local database. This action is irreversible.

Inputs: thread_id (required). Returns: result

list_assistantsList OpenAI AssistantsA
Read-only

List all available OpenAI assistants associated with the API key configured by the user.

Returns a list of assistants with their IDs, names, and configurations. This can be used to select an assistant to use in the ask_assistant_in_thread tool instead of creating a new one.

Inputs: limit. Returns: result

list_threadsList Managed ThreadsA
Read-only

Lists all locally saved conversation threads from the database. Returns a list of threads with their ID, name, description, and last used time. The thread ID can be used in the ask_assistant_in_thread tool to specify this thread to be continued.

Inputs: no named parameters. Returns: result

retrieve_assistantRetrieve OpenAI AssistantA
Read-only

Get detailed information about a specific assistant. The ID required can be retrieved from the list_assistants tool.

Inputs: assistant_id (required). Returns: result

update_assistantUpdate OpenAI AssistantA

Modify an existing assistant's name, instructions, or model used.

At least one optional parameter - what to change - must be provided, otherwise the tool will return an error. The ID required can be retrieved from the list_assistants tool.

Inputs: assistant_id (required), name, instructions, model. Returns: result

update_threadUpdate Managed ThreadA

Updates the name and/or description of a locally saved conversation thread. Both the local database and the OpenAI thread object will be updated.

The thread ID can be retrieved from the list_threads tool.

Inputs: thread_id (required), name, description. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 9 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose targeting specific resources and actions in the OpenAI Assistant domain. For example, ask_assistant_in_thread handles messaging, create_assistant/update_assistant manage assistants, and create_new_assistant_thread/delete_thread/update_thread manage threads. There is no overlap or ambiguity between tools.

    Naming Consistency5/5

    All tools follow a consistent verb_noun naming pattern with snake_case throughout. Examples include list_assistants, create_assistant, update_thread, and delete_thread. This predictable naming makes it easy to understand each tool's function at a glance.

    Tool Count5/5

    With 9 tools, this server is well-scoped for managing OpenAI Assistants and threads. It covers core operations like creating, listing, updating, and deleting both assistants and threads, plus the essential ask_assistant_in_thread for interactions. Each tool earns its place without being excessive.

    Completeness5/5

    The tool set provides complete CRUD/lifecycle coverage for both assistants and threads. It includes create, retrieve, list, update, and delete operations for both resources, plus the ask_assistant_in_thread tool for core functionality. There are no obvious gaps that would hinder agent workflows.

    Related MCP Connectors

    Related MCP Servers