Skip to main content
Glama
alohays

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 の止められないオープンソースの動きを止めることはできませんでした。

Related MCP server: OpenAI Agents MCP Server

開発者のジレンマ

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 エコシステムを結び付ける、より広範なMCPortalイニシアチブの一部です。

Available Tools

4 tools
browserC

Browse websites and interact with web content

ParametersJSON Schema
NameRequiredDescriptionDefault
parametersYes

TDQS

C2.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'browse' and 'interact' but doesn't specify whether this is read-only or allows mutations, what permissions or authentication might be needed, rate limits, or what 'interact' entails (e.g., clicking, form submission). It lacks critical behavioral details for a tool with web interaction capabilities.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with two short phrases: 'Browse websites' and 'interact with web content'. It's front-loaded with the core purpose, though it could be more structured. There's no wasted text, but it's under-specified rather than efficiently detailed.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of web browsing/interaction, no annotations, no output schema, and 0% schema coverage for the single parameter, the description is incomplete. It doesn't cover what the tool returns, how errors are handled, or the scope of interactions. For a tool with potential side effects and rich functionality, this is inadequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 1 parameter with 0% description coverage, and the description provides no information about parameters. It doesn't explain what 'parameters' should contain (e.g., URLs, actions, content), their format, or how they're used. For a single undocumented parameter, the description fails to add any semantic value beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Browse websites and interact with web content' states a general purpose but lacks specificity. It mentions 'browse' and 'interact' as verbs with 'websites' and 'web content' as resources, but doesn't distinguish from sibling tools like 'web-search' or specify what type of interaction is possible. It's vague about scope and functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'web-search' or other siblings. The description implies a general web browsing context but doesn't specify use cases, prerequisites, or exclusions. There's no mention of when-not-to-use or comparisons to other tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

code-executionC

Execute code and return the result

ParametersJSON Schema
NameRequiredDescriptionDefault
parametersYes

TDQS

C2.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool executes code and returns a result, but lacks critical details such as execution environment (e.g., sandbox, permissions), safety implications (e.g., destructive effects, rate limits), or output format. This is a significant gap for a mutation tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with a single sentence 'Execute code and return the result', which is front-loaded and wastes no words. Every part of the sentence contributes to the core purpose, making it efficient in structure.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of code execution (a mutation tool with potential security implications), no annotations, no output schema, and incomplete parameter documentation, the description is insufficient. It should address execution context, safety, and result details to be complete enough for an AI agent to use correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 1 parameter ('parameters') with 0% description coverage, so the schema provides no semantic information. The description adds no meaning beyond the schema, failing to explain what 'parameters' should contain (e.g., code string, language spec, arguments). For a tool with low schema coverage, this is inadequate compensation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Execute code and return the result' states a clear verb ('execute') and resource ('code'), but it's vague about what type of code (e.g., programming language, environment) and lacks differentiation from sibling tools like 'browser' or 'file-io' that might also involve execution. It's not tautological but misses specificity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'browser' for web-based execution or 'file-io' for file operations. The description implies a general-purpose code execution but offers no context, exclusions, or prerequisites, leaving the agent to guess based on tool names alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

file-ioC

Search and access file content

ParametersJSON Schema
NameRequiredDescriptionDefault
parametersYes

TDQS

C2.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. 'Search and access file content' implies read operations, but it doesn't specify whether this tool can modify files, requires specific permissions, has rate limits, or what happens during errors. The description is too brief to provide meaningful behavioral context for safe invocation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very concise with just three words, which is efficient. However, it's arguably under-specified rather than optimally concise—it could benefit from slightly more detail without becoming verbose. The structure is simple but lacks front-loading of critical information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a parameter with 0% schema coverage, the description is incomplete. It doesn't compensate for the lack of structured data by explaining return values, error conditions, or parameter usage. For a tool with one parameter and potential file system interactions, this leaves significant gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 1 parameter with 0% description coverage, and the tool description doesn't mention any parameters at all. The description 'Search and access file content' doesn't explain what the 'parameters' string should contain (e.g., file paths, search queries, access modes). This leaves the parameter completely undocumented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Search and access file content' states a general purpose (searching and accessing files) but lacks specificity about what resources it operates on (local files, remote files, specific file types) and doesn't clearly distinguish from sibling tools like 'browser' or 'web-search' which might also access content. It's vague about the exact scope of file operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'browser' or 'web-search'. The description doesn't mention any prerequisites, constraints, or typical use cases. It's left to the agent to infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 4 tool updatesv1.0.0
    • Changedbrowser1 field changed
      • addedInput schema / title
        Added value: +"tool_handlerArguments"
    • Changedcode-execution1 field changed
      • addedInput schema / title
        Added value: +"tool_handlerArguments"
    • Changedfile-io1 field changed
      • addedInput schema / title
        Added value: +"tool_handlerArguments"
    • Changedweb-search1 field changed
      • addedInput schema / title
        Added value: +"tool_handlerArguments"
  2. 4 tool updates
    • First observedbrowser
    • First observedcode-execution
    • First observedfile-io
    • First observedweb-search

TDQS

B3/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: browser for web interaction, code-execution for running code, file-io for file access, and web-search for information retrieval. There is no overlap in functionality, making tool selection straightforward for an agent.

Naming Consistency4/5

The tools follow a consistent snake_case naming convention, but there is a minor deviation with 'file-io' using a hyphen instead of an underscore. Overall, the naming is readable and predictable, with clear verb-noun patterns like 'browser' and 'web-search'.

Tool Count5/5

With 4 tools, the server is well-scoped for its purpose of providing general utility functions. Each tool serves a distinct and essential role, and the count is neither too sparse nor overwhelming, fitting typical utility server ranges.

Completeness4/5

The tool set covers key utility domains: web browsing, code execution, file access, and web search. Minor gaps might exist, such as lack of advanced file operations or specialized code environments, but agents can handle core tasks effectively with these tools.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    B
    quality
    D
    maintenance
    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.
    4
    10
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server and local HTTP bridge designed to integrate remote upstream MCP tools into OpenClaw skills or local environments. It enables users to generate skill wrappers and proxy tool calls via a local HTTP bridge for use in Claude Desktop, Cursor, or OpenClaw.
    Apache 2.0