跳到主要内容
跳到主要内容

Using ClickHouse MCP server with Open WebUI

This guide explains how to set up Open WebUI with a ClickHouse MCP server and connect it to the ClickHouse example datasets.

Install uv

You will need to install uv to follow the instructions in this guide. If you don't want to use uv, you will need to update the MCP Server config to use an alternative package manager.

Launch Open WebUI

To launch Open WebUI, you can run the following command:

Navigate to http://localhost:8080/ to see the UI.

Configure ClickHouse MCP Server

To setup the ClickHouse MCP Server, we'll need to convert the MCP Server to Open API endpoints. Let's first set environmental variables that will let us connect to the ClickHouse SQL Playground:

And, then, we can run mcpo to create the Open API endpoints:

You can see a list of the endpoints created by navigating to http://localhost:8000/docs

Open API endpoints

To use these endpoints with Open WebUI, we need to navigate to settings:

Open WebUI settings

Click on Tools:

Open WebUI tools

Add http://localhost:8000 as the tool URL:

Open WebUI tool

Once we've done this, we should see a 1 next to the tool icon on the chat bar:

Open WebUI tools available

If we click on the tool icon, we can then list the available tools:

Open WebUI tool listing

Configure OpenAI

By default, Open WebUI works with Ollama models, but we can add OpenAI compatible endpoints as well. These are configured via the settings menu, but this time we need to click on the Connections tab:

Open WebUI connections

Let's add the endpoint and our OpenAI key:

Open WebUI - Add OpenAI as a connection

The OpenAI models will then be available on the top menu:

Open WebUI - Models

Chat to ClickHouse MCP Server with Open WebUI

We can then have a conversation and Open WebUI will call the MCP Server if necessary:

Open WebUI - Chat with ClickHouse MCP Server