MCP in Open WebUI: giving models access to external tools

Open WebUI can connect MCP servers and hand their tools to models. We cover step-by-step setup, the limits, and what it does to token usage when you work through a gateway.

5 min · · агенты · автоматизация

Open WebUI MCP lets you attach external tools to a chat: knowledge search, tracker tasks, files, any service with an MCP server. The model decides when to call a tool, and Open WebUI performs the call and returns the result. Below we cover setup, how it differs from OpenAPI tools, working with stdio servers, and how many tokens it adds when models are connected through a gateway.

The description is based on the Open WebUI documentation (the MCP and tools pages). The interface changes between versions, and according to the docs native MCP support starts from version 0.6.31, so verify menu items in your installation.

How it works together with a gateway

The setup has three parts:

  1. The model. Connected to Open WebUI as an OpenAI-compatible provider, address https://api.zukko.pro/v1, key fetch_.... Details are in Open WebUI: connecting to Zukko.
  2. Open WebUI. Keeps the tool list, passes the tool descriptions to the model with the request, and executes the calls.
  3. The MCP server. Lives separately and answers Open WebUI's calls.

The gateway knows nothing about MCP. For it this is an ordinary chat completions request with a tools array and, in the next request, the call results. So MCP needs nothing special from the gateway, but it needs the model to be able to call tools. This is the key point: according to the Open WebUI docs, MCP only connects the tools, while the ability to use them depends on the model. If a model ignores tools or sends wrong arguments, the docs advise trying a stronger model with reliable function calling rather than assuming MCP is broken.

Step-by-step setup

According to the Open WebUI docs:

  1. Open Settings, Admin, Integrations.
  2. In External Tool Servers click Add Connection.
  3. In the Type field choose MCP (Streamable HTTP). Do not choose OpenAPI: pasting an MCP configuration into an OpenAPI connection can leave the interface stuck on an endless loading screen.
  4. Enter the server address and the authorization method.
  5. Save, and restart Open WebUI if prompted.

Then enable the tool you need in the chat itself through the tools menu next to the input field (the exact item name depends on the version).

Authorization methods

  • None: for local servers and closed networks. The docs advise choosing it by default if the server does not require a token: Bearer mode with an empty key sends an empty header, and many servers reject the connection.
  • Bearer: when the MCP server has its own API token; it must be entered in the key field.
  • OAuth 2.1 when the server supports dynamic client registration, and OAuth 2.1 (Static) when you already have a client ID and client secret from the provider.

For OAuth, be sure to set the WEBUI_SECRET_KEY environment variable in the Open WebUI Docker configuration. Without it OAuth tokens cannot be decrypted after the container restarts and you have to authorize again. One more rule from the docs: do not make OAuth 2.1 tools default tools on a model, because authorization needs a browser redirect and cannot happen in the middle of a request.

Server address from Docker

If Open WebUI runs in Docker and the MCP server runs on the host machine, use host.docker.internal with the right port instead of localhost.

MCP or OpenAPI

The Open WebUI docs state directly that OpenAPI is preferable for most deployments: it does better with single sign-on, audit, quotas, typed SDKs and standard error codes. MCP is chosen when you already have MCP servers and want a common protocol. You do not always have to choose: you can keep both and connect whatever you already have.

There is also an important limit. Only an administrator can add MCP servers in Open WebUI. Regular users with the direct tool servers permission can connect only OpenAPI servers. The reason is security: an MCP server runs inside Open WebUI's trust boundary, and a malicious server could read the user's data. So connect only servers you trust and grant access to the right groups through access control.

If the MCP server is stdio only

Many ready-made MCP servers run locally and talk over stdio, while Open WebUI's native support works only with Streamable HTTP. For such servers Open WebUI offers the mcpo proxy, which turns an MCP server into an OpenAPI service. An example from the docs:

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

After launch, documentation for the generated endpoints appears at http://localhost:8000/docs, and the address http://localhost:8000 is added to Open WebUI as an OpenAPI tool server. Take flag and command names from the mcpo documentation: only the Open WebUI docs example is shown here.

Calling tools from code

Tools can also be enabled in requests to Open WebUI's own API, not only in the interface. How to pass the identifiers of connected tool servers in a request is described in the Open WebUI documentation, API Endpoints section: the format depends on the version.

How many tokens tools use

This is the most common surprise when working through a gateway. The descriptions of all enabled tools are sent to the model with every request, and call results are added to the context too. Estimate by hand: say descriptions take 4000 tokens (a hypothetical number, yours will differ) and 50 requests are made per day. Formula: tokens × requests × input price.

  • deepseek-v4.1-flash: 4000 × 50 = 200,000 tokens per day, 0.2 × 0.013 = $0.0026.
  • gpt-6.1-sol: 0.2 × 0.27 = $0.054.
  • claude-sonnet-5-5: 0.2 × 0.4 = $0.08.

Prices as of October 18, 2026. For Claude in the OpenAI format the gateway cannot see the cache, so the whole input is billed at the input price, while for GPT cache reads are counted. See the real picture in the spending history in your account. The practical takeaway: enable only the tools needed in this chat. Twenty unused tools are paid for in every request.

Current models and prices: GET https://api.zukko.pro/v1/models or the "Models" page in your account. Which model calls tools best in your scenarios is something to test yourself; a general overview of the differences is in function calling in Claude, GPT and Qwen and what an MCP server is.

FAQ

Do I need to change anything on the gateway side for MCP?

No. For the gateway these are ordinary chat completions requests with a tools array. Request parameters are described in the reference.

Why does the model not call the tool?

Most often the cause is the model: it calls functions poorly, or the tool is not enabled in this chat. Enable the tool in the chat and try a stronger model.

Can I connect an MCP server without administrator rights?

No, MCP servers are added by an administrator. Users can get access to them through groups. Users can connect their own servers only of the OpenAPI type, if allowed.

Why did OAuth authorization drop after a restart?

Most likely a persistent WEBUI_SECRET_KEY is not set. Set it and authorize again.

To try it, create a key in your account, connect it to Open WebUI and add one MCP server before enabling several.

zukko

Pay 25×
less

for Claude Code & ChatGPT

One fetch_* key and base URL api.zukko.pro — for Cursor, Claude Code, Codex, and any SDK.

Get API keyDocumentation

api.zukko.pro · fetch_*

Open WebUI MCP: connecting tools to your models · Zukko