Skip to content
FunCoding

mcpo

A simple, secure MCP-to-OpenAPI proxy server

Star
4,433
Category
Security
License
MIT
Last commit
Nov 30, 2026

mcpo

mcpo is an MCP-to-OpenAPI proxy. It takes any MCP server and serves its tools as a standard OpenAPI HTTP server, with interactive docs and API key auth, so they work with Open WebUI and any other app that speaks OpenAPI.

GitHub stars GitHub forks PyPI GitHub last commit Discord

Read the docs →

Why mcpo

Most MCP servers talk over stdio and run as a local process. An app in the browser or on another machine cannot reach them. mcpo runs the MCP server for you and puts plain HTTP in front of it. Every tool gets its own endpoint, its own OpenAPI schema and live docs at /docs, with no glue code.

Open WebUI connects to Streamable HTTP MCP servers natively. Use mcpo for stdio and SSE servers, or when a client only speaks OpenAPI.

Installation

Python
# With uv installed
uvx mcpo --port 8000 --api-key "top-secret" -- your_mcp_server_command

# Or install and run with pip (Python 3.11+)
pip install mcpo
mcpo --port 8000 --api-key "top-secret" -- your_mcp_server_command

For example, with the MCP time server:

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

Then open http://localhost:8000/docs to try the tools live.

mcpo listens on 127.0.0.1 by default. Add --host 0.0.0.0 when Open WebUI or another client runs on a different machine or in a container.

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

The image listens on all interfaces and runs as a non-root user.

Connect to Open WebUI

Add the mcpo URL as a tool server in Open WebUI. See the Open WebUI integration guide for the steps.

Remote MCP Servers

mcpo also proxies MCP servers that already run over the network.

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

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

# With headers for the remote server
mcpo --port 8000 --api-key "top-secret" --server-type "sse" --header '{"Authorization": "Bearer token"}' -- http://127.0.0.1:8001/sse

Config File

Serve several MCP servers from one mcpo instance with a config file in the Claude Desktop format.

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

# Reload servers automatically when the file changes
mcpo --config /path/to/config.json --hot-reload
{
  "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 server gets its own route, such as http://localhost:8000/memory and http://localhost:8000/time, with its own docs at /memory/docs and /time/docs.

KeyPurpose
command, argsCommand that starts a local (stdio) server
envExtra environment variables for a local server
cwdFolder a local server starts in
typesse or streamable-http for a remote server
url, headersAddress of a remote server and the headers sent to it
disabledToolsTools to hide from the generated API
oauthOAuth settings, see OAuth

Options

OptionPurpose
--host, --portAddress to listen on (default 127.0.0.1:8000)
--api-keyAPI key that clients send as a bearer token. Also read from MCPO_API_KEY, which keeps it out of the process list
--strict-authAlso protect the docs and OpenAPI schema with the API key
--server-typestdio (default), sse or streamable-http
--headerHeaders in JSON for a remote server
--config, --hot-reloadConfig file, and reload it when it changes
--env, --env-pathEnvironment variables for the MCP server
--cors-allow-originsAllowed CORS origins (default *)
--root-pathServe under a subpath behind a reverse proxy, such as /api/mcpo
--path-prefixURL prefix for the server routes
--ssl-certfile, --ssl-keyfileServe over HTTPS
--name, --description, --versionTitle, description and version shown in the docs
--log-levelDEBUG, INFO, WARNING, ERROR or CRITICAL

Run mcpo --help for the full list. Setting MCPO_API_KEY through --env or --env-path has no effect.

OAuth

mcpo supports OAuth 2.1 for Streamable HTTP servers that require it. It uses dynamic client registration by default, so most servers need only the server URL.

{
  "mcpServers": {
    "oauth-protected-server": {
      "type": "streamable-http",
      "url": "http://localhost:8000/mcp",
      "oauth": {
        "server_url": "http://localhost:8000"
      }
    }
  }
}
OptionPurpose
server_urlOAuth server base URL (required)
storage_typefile (default, persistent) or memory (session only)
callback_portLocal port for the OAuth callback (default 3030)
use_loopbackOpen the browser for sign-in automatically (default true)

On first connection mcpo registers a client if needed, opens the browser for sign-in, captures the callback and stores the tokens in ~/.mcpo/tokens/. Later requests reuse them.

For a provider without dynamic client registration, register a client with the provider and put its client ID and secret into the client metadata.

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

Leave out scope, authorization_endpoint and token_endpoint. mcpo discovers them from the server's OAuth metadata. See the OAuth guide for details.

Development

git clone https://github.com/open-webui/mcpo.git
cd mcpo
uv sync --dev

# Run the tests
uv run pytest

# Run mcpo from your checkout
uv run mcpo --port 8000 -- uvx mcp-server-time --local-timezone=America/New_York

Support

Open an issue or ask on Discord.

Security

Report vulnerabilities privately through GitHub security advisories. See SECURITY.md for the policy.

Star History

Star History Chart
License

MIT. See LICENSE.

Created by Timothy Jaeryang Baek.

Similar MCP servers

REA

Reverse engineer anything from your terminal or agent with one CLI and MCP server.

MOmorluto/rea485k9,215 new stars in the last 7 days

Featured

Filesystem

Read and write files, create and search directories, update access without restart.

MOmodelcontextprotocol/servers92k200 new stars in the last 7 days

hexstrike-ai

HexStrike AI MCP Agents is an advanced MCP server that lets AI agents (Claude, GPT, Copilot, etc.) autonomously run 150+ cybersecurity tools for automated pentesting, vulnerability discovery, bug bounty automation, and security research. Seamlessly bridge LLMs with real-world offensive security capabilities.

0X0x4m4/hexstrike-ai14k167 new stars in the last 7 days

ida-pro-mcp

AI-powered reverse engineering assistant that bridges IDA Pro with language models through MCP.

MRmrexodia/ida-pro-mcp14k97 new stars in the last 7 days

GhidraMCP

MCP Server for Ghidra

LALaurieWired/GhidraMCP12k89 new stars in the last 7 days

AiSOC

Open-source AI Security Operations Center: alert fusion, LLM-agent triage, MITRE ATT&CK investigation, and a replayable decision ledger for every agent step. Self-hostable, runs with no API keys, MIT licensed. Ships an MCP server for Claude, Cursor and Continue.

BEbeenuar/AiSOC8.7k1,078 new stars in the last 7 days