$git clone https://github.com/open-webui/mcpoExpose any MCP tool as an OpenAPI-compatible HTTP server—instantly.
| 1 | # ⚡️ mcpo |
| 2 | |
| 3 | Expose any MCP tool as an OpenAPI-compatible HTTP server—instantly. |
| 4 | |
| 5 | 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. |
| 6 | |
| 7 | No custom protocol. No glue code. No hassle. |
| 8 | |
| 9 | ## 🤔 Why Use mcpo Instead of Native MCP? |
| 10 | |
| 11 | MCP servers usually speak over raw stdio, which is: |
| 12 | |
| 13 | - 🔓 Inherently insecure |
| 14 | - ❌ Incompatible with most tools |
| 15 | - 🧩 Missing standard features like docs, auth, error handling, etc. |
| 16 | |
| 17 | mcpo solves all of that—without extra effort: |
| 18 | |
| 19 | - ✅ Works instantly with OpenAPI tools, SDKs, and UIs |
| 20 | - 🛡 Adds security, stability, and scalability using trusted web standards |
| 21 | - 🧠 Auto-generates interactive docs for every tool, no config needed |
| 22 | - 🔌 Uses pure HTTP—no sockets, no glue code, no surprises |
| 23 | |
| 24 | What feels like "one more step" is really fewer steps with better outcomes. |
| 25 | |
| 26 | mcpo makes your AI tools usable, secure, and interoperable—right now, with zero hassle. |
| 27 | |
| 28 | ## 🚀 Quick Usage |
| 29 | |
| 30 | We recommend using uv for lightning-fast startup and zero config. |
| 31 | |
| 32 | ```bash |
| 33 | uvx mcpo --port 8000 --api-key "top-secret" -- your_mcp_server_command |
| 34 | ``` |
| 35 | |
| 36 | Or, if you’re using Python: |
| 37 | |
| 38 | ```bash |
| 39 | pip install mcpo |
| 40 | mcpo --port 8000 --api-key "top-secret" -- your_mcp_server_command |
| 41 | ``` |
| 42 | |
| 43 | To use an SSE-compatible MCP server, simply specify the server type and endpoint: |
| 44 | |
| 45 | ```bash |
| 46 | mcpo --port 8000 --api-key "top-secret" --server-type "sse" -- http://127.0.0.1:8001/sse |
| 47 | ``` |
| 48 | |
| 49 | You can also provide headers for the SSE connection: |
| 50 | |
| 51 | ```bash |
| 52 | 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 |
| 53 | ``` |
| 54 | |
| 55 | To use a Streamable HTTP-compatible MCP server, specify the server type and endpoint: |
| 56 | |
| 57 | ```bash |
| 58 | mcpo --port 8000 --api-key "top-secret" --server-type "streamable-http" -- http://127.0.0.1:8002/mcp |
| 59 | ``` |
| 60 | |
| 61 | You can also run mcpo via Docker with no installation: |
| 62 | |
| 63 | ```bash |
| 64 | docker run -p 8000:8000 ghcr.io/open-webui/mcpo:main --api-key "top-secret" -- your_mcp_server_command |
| 65 | ``` |
| 66 | |
| 67 | Example: |
| 68 | |
| 69 | ```bash |
| 70 | uvx mcpo --port 8000 --api-key "top-secret" -- uvx mcp-server-time --local-timezone=America/New_York |
| 71 | ``` |
| 72 | |
| 73 | 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](http://localhost:8000/docs). |
| 74 | |
| 75 | 🤝 **To integrate with Open WebUI after launching the server, check our [docs](https://docs.openwebui.com/openapi-servers/open-webui/).** |
| 76 | |
| 77 | |
| 78 | ### 🌐 Serving Under a Subpath (`--root-path`) |
| 79 | |
| 80 | If you need to serve mcpo behind a reverse proxy or under a subpath (e.g., `/api/mcpo`), use the `--root-path` argument: |
| 81 | |
| 82 | ```bash |
| 83 | mcpo --port 8000 --root-path "/api/mcpo" --api-key "top-secret" -- your_mcp_server_command |
| 84 | ``` |
| 85 | |
| 86 | All routes will be served under the specified root path, e.g. `http://localhost:8000/api/mcpo/memory`. |
| 87 | |
| 88 | |
| 89 | ### 🔄 Using a Config File |
| 90 | |
| 91 | You can serve multiple MCP tools via a single config file that follows the [Claude Desktop](https://modelcontextprotocol.io/quickstart/user) format. |
| 92 | |
| 93 | Enable hot-reload mode with `--hot-reload` to automatically watch your config file for changes and reload servers without downtime: |
| 94 | |
| 95 | Start via: |
| 96 | |
| 97 | ```bash |
| 98 | mcpo --config /path/to/config.json |
| 99 | ``` |
| 100 | |
| 101 | Or with hot-reload enabled: |
| 102 | |
| 103 | ```bash |
| 104 | mcpo --config /path/to/config.json --hot-reload |
| 105 | ``` |
| 106 | |
| 107 | Example config.json: |
| 108 | |
| 109 | ```json |
| 110 | { |
| 111 | "mcpServers": { |
| 112 | "memory": { |
| 113 | "command": "npx", |
| 114 | "args": ["-y", "@modelcontextprotocol/server-memory"] |
| 115 | }, |
| 116 | "time": { |
| 117 | "command": "uvx", |
| 118 | "args": ["mcp-server-time", "--local-timezone=America/New_York"], |
| 119 | "disabledTools": ["convert_time"] // Disable specific tools if needed |
| 120 | }, |
| 121 | "mcp_sse": { |
| 122 | "type": "sse", // Explicitly define type |
| 123 | "url": "http://127.0.0.1:8001/sse", |
| 124 | "headers": { |
| 125 | "Authorization": "Bearer token", |
| 126 | "X-Custom-Header": "value" |
| 127 | } |
| 128 | }, |
| 129 | "mcp_streamable_http": { |
| 130 | "type": "streamable- |