This guide explains how to use the ClickHouse MCP server with Ollama.
Install Ollama
Ollama is a library for running Large Language Models (LLMs) on your own machine. It has a wide range of models available and is easy to use.You can download Ollama for Mac, Windows, or Linux from the download page.Once you run Ollama, it will start a local server in the background that you can use to run models. Alternatively, you can run the server manually by runningollama serve.Once installed, you can pull a model down to your machine like this:Only models that have tool support will work with MCP servers.
Install MCPHost
At the time of writing (July 2025) there is no native functionality for using Ollama with MCP servers. However, we can use MCPHost to run Ollama models with MCP servers.MCPHost is a Go application, so you’ll need to make sure that you have Go installed on your machine. You can then install MCPHost by running the following command:~/go/bin so we need to make sure that directory is on our path.Configuring ClickHouse MCP server
We can configure MCP servers with MCPHost in YAML or JSON files. MCPHost will look for config files in your home directory the following order:.mcphost.ymlor.mcphost.json(preferred).mcp.ymlor.mcp.json(backwards compatibility)
~/.mcphost.json file:type.
The type is used to indicate the transport type used by the MCP server.local→ stdio transportremote→ streamable transportbuiltin→ inprocess transport
In theory, you should be able to provide these variables under the
environment key in the MCP configuration file, but we’ve found that this doesn’t work.Running MCPHost
Once you’ve configured the ClickHouse MCP server, you can run MCPHost by running the following command:/servers command to list the MCP servers:/tools to list the tools available: