Skip to main content

πŸ›°οΈ MCP Support

This documentation explains how to easily set up and deploy the MCP (Model Context Protocol)-to-OpenAPI proxy server provided by Open WebUI. Learn how you can effortlessly expose MCP-based tool servers using standard, familiar OpenAPI endpoints suitable for end-users and developers.

πŸ“Œ What is the MCP Proxy Server?​

The MCP-to-OpenAPI proxy server lets you use tool servers implemented with MCP (Model Context Protocol) directly via standard REST/OpenAPI APIsβ€”no need to manage unfamiliar or complicated custom protocols. If you're an end-user or application developer, this means you can interact easily with powerful MCP-based tooling directly through familiar REST-like endpoints.

βœ… Quickstart: Running the Proxy Locally​

Here's how simple it is to launch the MCP-to-OpenAPI proxy server using the lightweight, easy-to-use tool mcpo (GitHub Repository):

  1. Prerequisites

    • Python 3.8+ with pip installed.
    • MCP-compatible application (for example: mcp-server-time)
    • (Optional but recommended) uv installed for faster startup and zero-config convenience.
  2. Install mcpo

Using uv (recommended):

uvx mcpo --port 8000 -- your_mcp_server_command

Or using pip:

pip install mcpo
mcpo --port 8000 -- your_mcp_server_command
  1. πŸš€ Run the Proxy Server

To start your MCP-to-OpenAPI proxy server, you need an MCP-compatible tool server. If you don't have one yet, the MCP community provides various ready-to-use MCP server implementations.

✨ Where to find MCP Servers?

You can discover officially supported MCP servers at the following repository example:

For instance, the popular Time MCP Server is documented here, and is typically referenced clearly in the README, inside the provided MCP configuration. Specifically, the README states:

Add to your Claude settings:

"mcpServers": {   
"time": {
"command": "uvx",
"args": ["mcp-server-time", "--local-timezone=America/New_York"]
}
}

πŸ”‘ Translating this MCP setup to a quick local proxy command:

You can easily run the recommended MCP server (mcp-server-time) directly through the MCP-to-OpenAPI proxy (mcpo) like this:

uvx mcpo --port 8000 -- uvx mcp-server-time --local-timezone=America/New_York

That's it! You're now running the MCP-to-OpenAPI Proxy locally and exposing the powerful MCP Time Server through standard OpenAPI endpoints accessible at:

Feel free to replace uvx mcp-server-time --local-timezone=America/New_York with your preferred MCP Server command from other available MCP implementations found in the official repository.

πŸš€ Accessing the Generated APIs​

As soon as it starts, the MCP Proxy (mcpo) automatically:

  • Discovers MCP tools dynamically and generates REST endpoints.
  • Creates interactive, human-readable OpenAPI documentation accessible at:
    • http://localhost:8000/docs

Simply call the auto-generated API endpoints directly via HTTP clients, AI agents, or other OpenAPI tools of your preference.

πŸ“– Example Workflow for End-Users​

Assuming you started the above server command (uvx mcp-server-time):

  • Visit your local API documentation at http://localhost:8000/docs.
  • Select a generated endpoint (e.g. /get_current_time) and use the provided interactive form.
  • Click "Execute" and instantly receive your response.

No setup complexityβ€”just instant REST APIs.

πŸš€ Deploying in Production (Example)​

Deploying your MCP-to-OpenAPI proxy (powered by mcpo) is straightforward. Here's how to easily Dockerize and deploy it to cloud or VPS solutions:

🐳 Dockerize your Proxy Server using mcpo​

  1. Dockerfile Example

Create the following Dockerfile inside your deployment directory:

FROM python:3.11-slim
WORKDIR /app
RUN pip install mcpo uv
# Replace with your MCP server command; example: uvx mcp-server-time
CMD ["uvx", "mcpo", "--host", "0.0.0.0", "--port", "8000", "--", "uvx", "mcp-server-time", "--local-timezone=America/New_York"]
  1. Build & Run the Container Locally
docker build -t mcp-proxy-server .
docker run -d -p 8000:8000 mcp-proxy-server
  1. Deploying Your Container

Push to DockerHub or another registry:

docker tag mcp-proxy-server yourdockerusername/mcp-proxy-server:latest
docker push yourdockerusername/mcp-proxy-server:latest

Deploy using Docker Compose, Kubernetes YAML manifests, or your favorite cloud container services (AWS ECS, Azure Container Instances, Render.com, or Heroku).

βœ”οΈ Your production MCP servers are now effortlessly available via REST APIs!

πŸ§‘β€πŸ’» Technical Details and Background​

πŸƒ How It Works (Technical Summary)​

  • Dynamic Schema Discovery & Endpoints: At server startup, the proxy connects to the MCP server to query available tools. It automatically builds FastAPI endpoints based on the MCP tool schemas, creating concise and clear REST endpoints.

  • OpenAPI Auto-documentation: Endpoints generated are seamlessly documented and available via FastAPI's built-in Swagger UI (/docs). No extra doc writing required.

  • Asynchronous & Performant: Built on robust asynchronous libraries, ensuring speed and reliability for concurrent users.

πŸ“š Under the Hood:​

  • FastAPI (Automatic routing & docs generation)
  • MCP Client (Standard MCP integration & schema discovery)
  • Standard JSON over HTTP (Easy integration)

⚑️ Why is the MCP-to-OpenAPI Proxy Superior?​

Here's why leveraging MCP servers through OpenAPI via the proxy approach is significantly better and why Open WebUI enthusiastically supports it:

  • User-friendly & Familiar Interface: No custom clients; just HTTP REST endpoints you already know.
  • Instant Integration: Immediately compatible with thousands of existing REST/OpenAPI tools, SDKs, and services.
  • Powerful & Automatic Docs: Built-in Swagger UI documentation is automatically generated, always accurate, and maintained.
  • No New Protocol overhead: Eliminates the necessity to directly handle MCP-specific protocol complexities and socket communication issues.
  • Battle-Tested Security & Stability: Inherits well-established HTTPS transport, standard auth methods (JWT, API keys), solid async libraries, and FastAPI’s proven robustness.
  • Future-Proof: MCP proxy uses existing, stable, standard REST/OpenAPI formats guaranteed long-term community support and evolution.

🌟 Bottom line: MCP-to-OpenAPI makes your powerful MCP-based AI tools broadly accessible through intuitive, reliable, and scalable REST endpoints. Open WebUI proudly supports and recommends this best-in-class approach.

πŸ“’ Community & Support​

Happy integrations! πŸŒŸπŸš€