MCPO (MCP-to-OpenAPI) logo

MCPO (MCP-to-OpenAPI)

OrganizationPopular
open-webui

A simple, secure MCP-to-OpenAPI proxy server

Publisheropen-webui
Repositorymcpo
LanguagePython
Forks
460
Stars
4.2K
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    MCPO (MCP-to-OpenAPI) 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

    4.2K stars and 460 forks from the linked repository.

⚡️ mcpo

Expose any MCP tool as an OpenAPI-compatible HTTP server—instantly.

mcpo is a dead-simple proxy that takes an MCP server command and makes it accessible via standard RESTful OpenAPI, so your tools "just work" with LLM agents and apps expecting OpenAPI servers.

No custom protocol. No glue code. No hassle.

🤔 Why Use mcpo Instead of Native MCP?

MCP servers usually speak over raw stdio, which is:

  • 🔓 Inherently insecure
  • ❌ Incompatible with most tools
  • 🧩 Missing standard features like docs, auth, error handling, etc.

mcpo solves all of that—without extra effort:

  • ✅ Works instantly with OpenAPI tools, SDKs, and UIs
  • 🛡 Adds security, stability, and scalability using trusted web standards
  • 🧠 Auto-generates interactive docs for every tool, no config needed
  • 🔌 Uses pure HTTP—no sockets, no glue code, no surprises

What feels like "one more step" is really fewer steps with better outcomes.

mcpo makes your AI tools usable, secure, and interoperable—right now, with zero hassle.

🚀 Quick Usage

We recommend using uv for lightning-fast startup and zero config.

bash
uvx mcpo --port 8000 --api-key "top-secret" -- your_mcp_server_command

Or, if you’re using Python:

bash
pip install mcpo
mcpo --port 8000 --api-key "top-secret" -- your_mcp_server_command

To use an SSE-compatible MCP server, simply specify the server type and endpoint:

bash
mcpo --port 8000 --api-key "top-secret" --server-type "sse" -- http://127.0.0.1:8001/sse

You can also provide headers for the SSE connection:

bash
mcpo --port 8000 --api-key "top-secret" --server-type "sse" --header '{"Authorization": "Bearer token", "X-Custom-Header": "value"}' -- http://127.0.0.1:8001/sse

To use a Streamable HTTP-compatible MCP server, specify the server type and endpoint:

bash
mcpo --port 8000 --api-key "top-secret" --server-type "streamable-http" -- http://127.0.0.1:8002/mcp

You can also run mcpo via Docker with no installation:

bash
docker run -p 8000:8000 ghcr.io/open-webui/mcpo:main --api-key "top-secret" -- your_mcp_server_command

Example:

bash
uvx mcpo --port 8000 --api-key "top-secret" -- uvx mcp-server-time --local-timezone=America/New_York

That’s it. Your MCP tool is now available at http://localhost:8000 with a generated OpenAPI schema — test it live at http://localhost:8000/docs.

🤝 To integrate with Open WebUI after launching the server, check our docs.

🌐 Serving Under a Subpath (--root-path)

If you need to serve mcpo behind a reverse proxy or under a subpath (e.g., /api/mcpo), use the --root-path argument:

bash
mcpo --port 8000 --root-path "/api/mcpo" --api-key "top-secret" -- your_mcp_server_command

All routes will be served under the specified root path, e.g. http://localhost:8000/api/mcpo/memory.

🔄 Using a Config File

You can serve multiple MCP tools via a single config file that follows the Claude Desktop format.

Enable hot-reload mode with --hot-reload to automatically watch your config file for changes and reload servers without downtime:

Start via:

bash
mcpo --config /path/to/config.json

Or with hot-reload enabled:

bash
mcpo --config /path/to/config.json --hot-reload

Example config.json:

json
{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-memory"]
    },
    "time": {
      "command": "uvx",
      "args": ["mcp-server-time", "--local-timezone=America/New_York"],
      "disabledTools": ["convert_time"] // Disable specific tools if needed
    },
    "mcp_sse": {
      "type": "sse", // Explicitly define type
      "url": "http://127.0.0.1:8001/sse",
      "headers": {
        "Authorization": "Bearer token",
        "X-Custom-Header": "value"
      }
    },
    "mcp_streamable_http": {
      "type": "streamable-http",
      "url": "http://127.0.0.1:8002/mcp"
    } // Streamable HTTP MCP Server
  }
}

Each tool will be accessible under its own unique route, e.g.:

Each with a dedicated OpenAPI schema and proxy handler. Access full schema UI at: http://localhost:8000/<tool>/docs (e.g. /memory/docs, /time/docs)

🔐 OAuth 2.1 Authentication

mcpo supports OAuth 2.1 authentication for MCP servers that require it. The implementation defaults to dynamic client registration, so most servers only need minimal configuration:

json
{
  "mcpServers": {
    "oauth-protected-server": {
      "type": "streamable-http",
      "url": "http://localhost:8000/mcp",
      "oauth": {
        "server_url": "http://localhost:8000"
      }
    }
  }
}

OAuth Configuration Options

Basic Options:

  • server_url (required): OAuth server base URL
  • storage_type: "file" (persistent) or "memory" (session-only, default: "file")
  • callback_port: Local port for OAuth callback (default: 3030)
  • use_loopback: Auto-open browser for auth (default: true)

Advanced Options (rarely needed): For servers that don't support dynamic client registration, you can specify static client metadata:

json
{
  "mcpServers": {
    "legacy-oauth-server": {
      "type": "streamable-http", 
      "url": "http://api.example.com/mcp",
      "oauth": {
        "server_url": "http://api.example.com",
        "client_metadata": {
          "client_name": "My MCPO Client",
          "redirect_uris": ["http://localhost:3030/callback"]
        }
      }
    }
  }
}

Note: Avoid setting scope, authorization_endpoint, or token_endpoint in the config. These are automatically discovered from the server's OAuth metadata during the dynamic registration flow.

On first connection, mcpo will:

  1. Perform dynamic client registration (if supported)
  2. Open your browser for authorization
  3. Capture the OAuth callback automatically
  4. Store tokens securely (in ~/.mcpo/tokens/ for file storage)
  5. Use tokens for all subsequent requests

OAuth is supported for streamable-http server types. See OAUTH_GUIDE.md for detailed documentation.

🔧 Requirements

  • Python 3.8+
  • uv (optional, but highly recommended for performance + packaging)

🛠️ Development & Testing

To contribute or run tests locally:

  1. Set up the environment:

    bash
    # Clone the repository
    git clone https://github.com/open-webui/mcpo.git
    cd mcpo
    
    # Install dependencies (including dev dependencies)
    uv sync --dev
  2. Run tests:

    bash
    uv run pytest
  3. Running Locally with Active Changes:

    To run mcpo with your local modifications from a specific branch (e.g., my-feature-branch):

    bash
    # Ensure you are on your development branch
    git checkout my-feature-branch
    
    # Make your code changes in the src/mcpo directory or elsewhere
    
    # Run mcpo using uv, which will use your local, modified code
    # This command starts mcpo on port 8000 and proxies your_mcp_server_command
    uv run mcpo --port 8000 -- your_mcp_server_command
    
    # Example with a test MCP server (like mcp-server-time):
    # uv run mcpo --port 8000 -- uvx mcp-server-time --local-timezone=America/New_York

    This allows you to test your changes interactively before committing or creating a pull request. Access your locally running mcpo instance at http://localhost:8000 and the auto-generated docs at http://localhost:8000/docs.

🪪 License

MIT

🤝 Contributing

We welcome and strongly encourage contributions from the community!

Whether you're fixing a bug, adding features, improving documentation, or just sharing ideas—your input is incredibly valuable and helps make mcpo better for everyone.

Getting started is easy:

  • Fork the repo
  • Create a new branch
  • Make your changes
  • Open a pull request

Not sure where to start? Feel free to open an issue or ask a question—we’re happy to help you find a good first task.

✨ Star History


✨ Let's build the future of interoperable AI tooling together!

Use MCPO (MCP-to-OpenAPI) MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once MCPO (MCP-to-OpenAPI) 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 MCPO (MCP-to-OpenAPI) 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 MCPO (MCP-to-OpenAPI) 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": {
    "mcpo-mcp-to-openapi": {
      "command": "npx",
      "args": [
        "-y",
        "null"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the MCPO (MCP-to-OpenAPI) 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 MCPO (MCP-to-OpenAPI) 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 MCPO (MCP-to-OpenAPI) to help me with this task?
MCPO (MCP-to-OpenAPI)
Sure. I read it.
Here is what I found using MCPO (MCP-to-OpenAPI).

Frequently asked questions

What is the MCPO (MCP-to-OpenAPI) MCP server used for?

MCPO (MCP-to-OpenAPI) 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 MCPO (MCP-to-OpenAPI) MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use MCPO (MCP-to-OpenAPI) 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 MCPO (MCP-to-OpenAPI) 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 MCPO (MCP-to-OpenAPI) connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect MCPO (MCP-to-OpenAPI) MCP to TypingMind?

MCPO (MCP-to-OpenAPI) 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 MCPO (MCP-to-OpenAPI) MCP provide in TypingMind?

MCPO (MCP-to-OpenAPI) 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 MCPO (MCP-to-OpenAPI) MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If MCPO (MCP-to-OpenAPI) 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 👇