Skip to main content
Glama

openai-tool2mcp

by alohays

openai-tool2mcp

リリースビルドステータス コードコフ コミットアクティビティ ライセンス

openai-tool2mcpは、 OpenAIの強力な組み込みツールをModel Context Protocol(MCP)サーバーとしてラップする、軽量なオープンソースブリッジです。これにより、Web検索やコードインタープリターなどの高品質なOpenAIツールを、Claudeやその他のMCP互換モデルで利用できるようになります。

  • 🔍 Claude アプリで OpenAI の堅牢なウェブ検索を使用する

  • 💻 MCP 互換の LLM でコードインタープリタ機能にアクセス

  • 🔄 OpenAIとMCP間のシームレスなプロトコル変換

  • 🛠️シンプルなAPIで簡単に統合

  • 🌐 MCP SDKとの完全な互換性

🔍 Claude アプリを使用した OpenAI 検索統合デモ!🚀

https://github.com/user-attachments/assets/f1f10e2c-b995-4e03-8b28-61eeb2b2bfe9

OpenAI は、強力な LLM に最適化されたツールを自社のエージェント プラットフォーム内に閉じ込めようとしましたが、MCP の止められないオープンソースの動きを止めることはできませんでした。

開発者のジレンマ

AI 開発者は現在、2 つのエコシステムの間で難しい選択を迫られています。

graph TD subgraph "Developer's Dilemma" style Developer fill:#ff9e64,stroke:#fff,stroke-width:2px Developer((Developer)) end subgraph "OpenAI's Ecosystem" style OpenAITools fill:#bb9af7,stroke:#fff,stroke-width:2px style Tracing fill:#bb9af7,stroke:#fff,stroke-width:2px style Evaluation fill:#bb9af7,stroke:#fff,stroke-width:2px style VendorLock fill:#f7768e,stroke:#fff,stroke-width:2px,stroke-dasharray: 5 5 OpenAITools["Built-in Tools<br/>(Web Search, Code Interpreter)"] Tracing["Advanced Tracing<br/>(Visual Debugging)"] Evaluation["Evaluation Dashboards<br/>(Performance Metrics)"] VendorLock["Vendor Lock-in<br/>⚠️ Closed Source ⚠️"] OpenAITools --> Tracing Tracing --> Evaluation OpenAITools -.-> VendorLock Tracing -.-> VendorLock Evaluation -.-> VendorLock end subgraph "MCP Ecosystem" style MCPStandard fill:#7dcfff,stroke:#fff,stroke-width:2px style MCPTools fill:#7dcfff,stroke:#fff,stroke-width:2px style OpenStandard fill:#9ece6a,stroke:#fff,stroke-width:2px style LimitedTools fill:#f7768e,stroke:#fff,stroke-width:2px,stroke-dasharray: 5 5 MCPStandard["Model Context Protocol<br/>(Open Standard)"] MCPTools["MCP-compatible Tools"] OpenStandard["Open Ecosystem<br/>✅ Interoperability ✅"] LimitedTools["Limited Tool Quality<br/>⚠️ Less Mature (e.g., web search, computer use) ⚠️"] MCPStandard --> MCPTools MCPStandard --> OpenStandard MCPTools -.-> LimitedTools end Developer -->|"Wants powerful tools<br/>& visualizations"| OpenAITools Developer -->|"Wants open standards<br/>& interoperability"| MCPStandard classDef highlight fill:#ff9e64,stroke:#fff,stroke-width:4px; class Developer highlight

openai-tool2mcp は、 OpenAI の成熟した高品質のツールをオープン MCP エコシステム内で使用できるようにすることで、このギャップを埋めます。

🌟 特徴

  • 簡単なセットアップ:いくつかの簡単なコマンドで起動して実行できます

  • OpenAIツールをMCPサーバーとして:強力なOpenAI組み込みツールをMCP準拠サーバーとしてラップする

  • シームレスな統合: Claude App やその他の MCP 対応クライアントと連携

  • MCP SDK互換:公式MCP Python SDKを使用

  • ツールサポート:

    • 🔍 ウェブ検索

    • 💻 コードインタープリター

    • 🌐 ウェブブラウザ

    • 📁 ファイル管理

  • オープンソース:MITライセンス、ハッキング可能、拡張可能

🚀 インストール

# Install from PyPI pip install openai-tool2mcp # Or install the latest development version pip install git+https://github.com/alohays/openai-tool2mcp.git # Recommended: Install uv for better MCP compatibility pip install uv

前提条件

  • Python 3.10以上

  • アシスタント API にアクセスできる OpenAI API キー

  • (推奨) MCP 互換性のための uv パッケージ マネージャー

🛠️ クイックスタート

  1. OpenAI API キーを設定します:

export OPENAI_API_KEY="your-api-key-here"
  1. OpenAI ツールを使用して MCP サーバーを起動します

# Recommended: Use uv for MCP compatibility (recommended by MCP documentation) uv run openai_tool2mcp/server_entry.py --transport stdio # Or use the traditional method with the CLI openai-tool2mcp start --transport stdio
  1. Claude for Desktop での使用:

claude_desktop_config.json を編集して、Claude for Desktop がサーバーを使用するように設定します。

{ "mcpServers": { "openai-tools": { "command": "uv", "args": [ "--directory", "/absolute/path/to/your/openai-tool2mcp", "run", "openai_tool2mcp/server_entry.py" ] } } }

設定ファイルは次の場所にあります:

  • MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %AppData%\Claude\claude_desktop_config.json

💻 使用例

基本的なサーバー構成

# server_script.py from openai_tool2mcp import MCPServer, ServerConfig, OpenAIBuiltInTools # Configure with OpenAI web search config = ServerConfig( openai_api_key="your-api-key", tools=[OpenAIBuiltInTools.WEB_SEARCH.value] ) # Create and start server with STDIO transport (for MCP compatibility) server = MCPServer(config) server.start(transport="stdio")

MCP の推奨に従ってuvで実行します。

uv run server_script.py

Claude デスクトップの MCP 互換構成

スタンドアロン スクリプトを作成します。

# openai_tools_server.py import os from dotenv import load_dotenv from openai_tool2mcp import MCPServer, ServerConfig, OpenAIBuiltInTools # Load environment variables load_dotenv() # Create a server with multiple tools config = ServerConfig( openai_api_key=os.environ.get("OPENAI_API_KEY"), tools=[ OpenAIBuiltInTools.WEB_SEARCH.value, OpenAIBuiltInTools.CODE_INTERPRETER.value ] ) # Create and start the server with stdio transport for MCP compatibility server = MCPServer(config) server.start(transport="stdio")

このスクリプトをuvで使用するように Claude Desktop を設定します。

{ "mcpServers": { "openai-tools": { "command": "uv", "args": [ "--directory", "/absolute/path/to/your/project/folder", "run", "openai_tools_server.py" ] } } }

📊 仕組み

このライブラリは、OpenAI Assistant API と MCP プロトコル間のブリッジとして機能します。

sequenceDiagram participant Claude as "Claude App" participant MCP as "MCP Client" participant Server as "openai-tool2mcp Server" participant OpenAI as "OpenAI API" Claude->>MCP: User query requiring tools MCP->>Server: MCP request Server->>OpenAI: Convert to OpenAI format OpenAI->>Server: Tool response Server->>MCP: Convert to MCP format MCP->>Claude: Display result

🔄 MCP SDK 統合

openai-tool2mcpは MCP SDK と完全に互換性を持つようになりました。Claude for Desktop アプリで以下の手順で使用できます。

  1. pip install openai-tool2mcpでパッケージをインストールする

  2. claude_desktop_config.jsonに以下を含めるように設定します。

{ "mcpServers": { "openai-tools": { "command": "openai-tool2mcp", "args": [ "start", "--transport", "stdio", "--tools", "retrieval", "code_interpreter" ] } } }

設定ファイルは次の場所にあります:

  • MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %AppData%\Claude\claude_desktop_config.json

🤝 貢献する

コミュニティからの貢献を歓迎します!ご協力いただける方法は以下の通りです。

  1. リポジトリをフォークする

  2. フォークをローカルマシンにクローンする

  3. 機能やバグ修正用のブランチを作成する

  4. 変更を加えてコミットする

  5. フォークにプッシュしプルリクエストを送信します

必ず弊社のコーディング標準に従い、新しい機能に対してテストを追加してください。

開発セットアップ

# Clone the repository git clone https://github.com/alohays/openai-tool2mcp.git cd openai-tool2mcp # Install in development mode make install # Run tests make test # Run linting make lint

📄 ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細についてはLICENSEファイルを参照してください。

🙏 謝辞

  • 優れたツールとAPIを提供してくれたOpenAIチーム

  • ツールの使用に関するオープンスタンダードを開発するMCPコミュニティ

  • このプロジェクトの改善にご協力いただいたすべての貢献者


⚠️プロジェクトのステータス

このプロジェクトは現在開発中です。コア機能は動作しますが、頻繁なアップデートと改善が予定されています。問題が発生した場合は、問題追跡システムからご報告ください。


openai-tool2mcp は、OpenAI のツールとオープンソースの MCP エコシステムを結び付ける、より広範な

Deploy Server
-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

OpenAI の組み込みツール (Web 検索やコード インタープリターなど) をモデル コンテキスト プロトコル サーバーとしてラップし、Claude やその他の MCP 互換モデルで使用できるようにする軽量ブリッジです。

  1. 🔍 Claude アプリを使用した OpenAI 検索統合デモ!🚀
    1. 開発者のジレンマ
      1. 🌟 特徴
        1. 🚀 インストール
          1. 前提条件
        2. 🛠️ クイックスタート
          1. 💻 使用例
            1. 基本的なサーバー構成
            2. Claude デスクトップの MCP 互換構成
          2. 📊 仕組み
            1. 🔄 MCP SDK 統合
              1. 🤝 貢献する
                1. 開発セットアップ
              2. 📄 ライセンス
                1. 🙏 謝辞
                  1. ⚠️プロジェクトのステータス

                    Related MCP Servers

                    • -
                      security
                      A
                      license
                      -
                      quality
                      A Model Context Protocol (MCP) server that lets you seamlessly use OpenAI's models right from Claude.
                      Last updated -
                      90
                      68
                      MIT License
                      • Apple
                    • A
                      security
                      A
                      license
                      A
                      quality
                      Enables integration with OpenAI models through the MCP protocol, supporting concise and detailed responses for use with Claude Desktop.
                      Last updated -
                      4
                      MIT License
                      • Apple
                      • Linux
                    • -
                      security
                      F
                      license
                      -
                      quality
                      A Model Context Protocol server that enables Claude users to access specialized OpenAI agents (web search, file search, computer actions) and a multi-agent orchestrator through the MCP protocol.
                      Last updated -
                      4
                      9
                      • Linux
                      • Apple

                    View all related MCP servers

                    MCP directory API

                    We provide all the information about MCP servers via our MCP API.

                    curl -X GET 'https://glama.ai/api/mcp/v1/servers/alohays/openai-tool2mcp'

                    If you have feedback or need assistance with the MCP directory API, please join our Discord server