openai-tool2mcp logo

openai-tool2mcp

Community
alohays

mcp wrapper for openai built-in tools

Publisheralohays
Repositoryopenai-tool2mcp
LanguagePython
Forks
3
Stars
12
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    openai-tool2mcp exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    12 stars and 3 forks from the linked repository.

openai-tool2mcp

Release Build status codecov Commit activity License

openai-tool2mcp is a lightweight, open-source bridge that wraps OpenAI's powerful built-in tools as Model Context Protocol (MCP) servers. It enables you to use high-quality OpenAI tools like web search and code interpreter with Claude and other MCP-compatible models.

  • 🔍 Use OpenAI's robust web search in Claude App
  • 💻 Access code interpreter functionality in any MCP-compatible LLM
  • 🔄 Seamless protocol translation between OpenAI and MCP
  • 🛠️ Simple API for easy integration
  • 🌐 Full compatibility with the MCP SDK

🔍 OpenAI Search Integration Demo with Claude App! 🚀

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

OpenAI tried to keep their powerful, LLM-optimized tools locked within their own agent platform, but they couldn't stop the unstoppable open-source movement of MCP!

The Developer's Dilemma

AI developers currently face a challenging choice between two ecosystems:

openai-tool2mcp bridges this gap by letting you use OpenAI's mature, high-quality tools within the open MCP ecosystem.

🌟 Features

  • Easy Setup: Get up and running with a few simple commands
  • OpenAI Tools as MCP Servers: Wrap powerful OpenAI built-in tools as MCP-compliant servers
  • Seamless Integration: Works with Claude App and other MCP-compatible clients
  • MCP SDK Compatible: Uses the official MCP Python SDK
  • Tool Support:
    • 🔍 Web Search
    • 💻 Code Interpreter
    • 🌐 Web Browser
    • 📁 File Management
  • Open Source: MIT licensed, hackable and extensible

🚀 Installation

bash
# 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

Prerequisites

  • Python 3.10+
  • OpenAI API key with access to the Assistant API
  • (Recommended) uv package manager for MCP compatibility

🛠️ Quick Start

  1. Set your OpenAI API key:
bash
export OPENAI_API_KEY="your-api-key-here"
  1. Start the MCP server with OpenAI tools:
bash
# 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. Use with Claude for Desktop:

Configure your Claude for Desktop to use the server by editing the claude_desktop_config.json:

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

The config file is located at:

  • MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %AppData%\Claude\claude_desktop_config.json

💻 Usage Examples

Basic Server Configuration

python
# 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")

Run it with uv as recommended by MCP:

bash
uv run server_script.py

MCP-Compatible Configuration for Claude Desktop

Create a standalone script:

python
# 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")

Configure Claude Desktop to use this script with uv:

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

📊 How It Works

The library serves as a bridge between the OpenAI Assistant API and the MCP protocol:

🔄 MCP SDK Integration

openai-tool2mcp is now fully compatible with the MCP SDK. You can use it with the Claude for Desktop app by:

  1. Installing the package with pip install openai-tool2mcp
  2. Configuring your claude_desktop_config.json to include:
json
{
  "mcpServers": {
    "openai-tools": {
      "command": "openai-tool2mcp",
      "args": [
        "start",
        "--transport",
        "stdio",
        "--tools",
        "retrieval",
        "code_interpreter"
      ]
    }
  }
}

The config file is located at:

  • MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %AppData%\Claude\claude_desktop_config.json

🤝 Contributing

We welcome contributions from the community! Here's how you can help:

  1. Fork the repository
  2. Clone your fork to your local machine
  3. Create a branch for your feature or bugfix
  4. Make your changes and commit them
  5. Push to your fork and submit a pull request

Please make sure to follow our coding standards and add tests for any new features.

Development Setup

bash
# 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

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgements

  • The OpenAI team for their excellent tools and APIs
  • The MCP community for developing an open standard for tool usage
  • All contributors who have helped improve this project

⚠️ Project Status

This project is in active development. While the core functionality works, expect frequent updates and improvements. If you encounter any issues, please submit them on our issue tracker.


openai-tool2mcp is part of the broader MCPortal initiative to bridge OpenAI's tools with the open-source MCP ecosystem.

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "alohays-openai-tool2mcp": {
      "command": "uvx",
      "args": [
        "openai-tool2mcp"
      ]
    }
  }
}

Use openai-tool2mcp MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once openai-tool2mcp is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add openai-tool2mcp as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the openai-tool2mcp MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "alohays-openai-tool2mcp": {
      "command": "npx",
      "args": [
        "-y",
        "openai-tool2mcp"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the openai-tool2mcp MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the openai-tool2mcp MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use openai-tool2mcp to help me with this task?
openai-tool2mcp
Sure. I read it.
Here is what I found using openai-tool2mcp.

Frequently asked questions

What is the openai-tool2mcp MCP server used for?

openai-tool2mcp is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use openai-tool2mcp MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use openai-tool2mcp with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use openai-tool2mcp MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With openai-tool2mcp connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect openai-tool2mcp MCP to TypingMind?

openai-tool2mcp runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does openai-tool2mcp MCP provide in TypingMind?

openai-tool2mcp exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use openai-tool2mcp MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If openai-tool2mcp requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇