> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-fix-nav-issues.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP guides

> This page provides an intro to Model Context Protocol (MCP) and has a table of contents for MCP guides.

export const Image = ({img, alt, size}) => {
  return <Frame>
      <img src={img} alt={alt} />
    </Frame>;
};

[Model Context Protocol](https://www.anthropic.com/news/model-context-protocol) (MCP) is a standard developed by Anthropic that enables AI assistants to seamlessly integrate with external systems.
This protocol allows AI assistants to connect to data sources, APIs, databases, and more in a secure and standardized way.

MCP creates a universal interface between AI models and various services, eliminating the need for custom tool implementations for each integration.
You can think of it as a universal API standard designed specifically for AI systems.

The key advantage of MCP is that AI libraries only need to implement support for the protocol once.
After that, all MCP-compatible services become immediately accessible, saving AI library maintainers a lot of time.

<h2 id="mcp-architecture">
  What is MCP's architecture?
</h2>

MCP follows a client-server architecture:

* Clients (like Claude Desktop, Cursor, or VS Code) establish connections with MCP servers. You can see a collection of clients in the [awesome-mcp-clients](https://github.com/punkpeye/awesome-mcp-clients?tab=readme-ov-file#windsurf) GitHub repository.
* Servers expose tools and capabilities through standardized interfaces. You can see a collection of servers in the [awesome-mcp-servers](https://github.com/punkpeye/awesome-mcp-servers) GitHub repository.
* AI models can then use these tools to access external data and functionality when needed

A diagram showing the architecture is below:

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/0q6iTuCC0qup5NC4/images/use-cases/AI_ML/MCP/mcp_overview.png?fit=max&auto=format&n=0q6iTuCC0qup5NC4&q=85&s=1ac2a971dd105c57e8fba82efa570624" alt="MCP overview" size="lg" width="1551" height="641" data-path="images/use-cases/AI_ML/MCP/mcp_overview.png" />

<h2 id="clickhouse-mcp-server">
  Does ClickHouse have an MCP server?
</h2>

It does!
The [ClickHouse MCP server](https://github.com/ClickHouse/mcp-clickhouse) offers the following tools:

* `run_select_query` - Execute SQL queries on your ClickHouse cluster.
* `list_databases` - List all databases on your ClickHouse cluster.
* `list_tables` - List all tables in a database.

If you're looking for a remote MCP server in ClickHouse Cloud, see page ["Remote MCP server in Cloud"](/products/cloud/features/ai-ml/remote-mcp)

<Tip>
  **Agent Skills**

  The [ClickHouse Agent Skills repo](https://github.com/ClickHouse/agent-skills) provides packaged instructions that extend AI coding agents (Claude Code, Cursor, Copilot, etc.) with domain-specific expertise. This repository provides skills for ClickHouse databases—covering schema design, query optimization, and data ingestion patterns.
</Tip>

<h2 id="clickhouse-mcp-server-guides">
  Guides for using the ClickHouse MCP server
</h2>

Below are some guides showing how to use the ClickHouse MCP server.

| Page                                                                                                                                                              | Description                                                                                                                         |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| [How to build a ClickHouse-backed AI Agent with Streamlit](/guides/use-cases/ai-ml/MCP/ai-agent-libraries/streamlit)                                              | Learn how to build a web-based AI Agent with Streamlit and the ClickHouse MCP server                                                |
| [How to build a LangChain/LangGraph AI agent using ClickHouse MCP server.](/guides/use-cases/ai-ml/MCP/ai-agent-libraries/langchain)                              | Learn how to build a LangChain/LangGraph AI agent that can interact with ClickHouse's SQL playground using ClickHouse's MCP server. |
| [How to build a LlamaIndex AI agent using ClickHouse MCP server.](/guides/use-cases/ai-ml/MCP/ai-agent-libraries/llamaindex)                                      | Learn how to build a LlamaIndex AI agent that can interact with ClickHouse MCP server.                                              |
| [How to build a PydanticAI agent using ClickHouse MCP server.](/guides/use-cases/ai-ml/MCP/ai-agent-libraries/pydantic-ai)                                        | Learn how to build a PydanticAI agent that can interact with ClickHouse MCP server.                                                 |
| [How to build a SlackBot agent using ClickHouse MCP server.](/guides/use-cases/ai-ml/MCP/ai-agent-libraries/slackbot)                                             | Learn how to build a SlackBot agent that can interact with ClickHouse MCP server.                                                   |
| [How to build an AI Agent with Agno and the ClickHouse MCP server](/guides/use-cases/ai-ml/MCP/ai-agent-libraries/agno)                                           | Learn how build an AI Agent with Agno and the ClickHouse MCP server                                                                 |
| [How to build an AI Agent with Chainlit and the ClickHouse MCP server](/guides/use-cases/ai-ml/MCP/ai-agent-libraries/chainlit)                                   | Learn how to use Chainlit to build LLM-based chat apps together with the ClickHouse MCP server                                      |
| [How to build an AI Agent with Claude Agent SDK and the ClickHouse MCP server](/guides/use-cases/ai-ml/MCP/ai-agent-libraries/claude-agent-sdk)                   | Learn how build an AI Agent with Claude Agent SDK and the ClickHouse MCP server                                                     |
| [How to build an AI Agent with CopilotKit and the ClickHouse MCP server](/guides/use-cases/ai-ml/MCP/ai-agent-libraries/copilotkit)                               | Learn how to build an agentic application using data stored in ClickHouse with ClickHouse MCP and CopilotKit                        |
| [How to build an AI Agent with CrewAI and the ClickHouse MCP server](/guides/use-cases/ai-ml/MCP/ai-agent-libraries/crewai)                                       | Learn how build an AI Agent with CrewAI and the ClickHouse MCP server                                                               |
| [How to build an AI Agent with DSPy and the ClickHouse MCP server](/guides/use-cases/ai-ml/MCP/ai-agent-libraries/dspy)                                           | Learn how to build an AI agent with DSPy and the ClickHouse MCP server                                                              |
| [How to build an AI Agent with mcp-agent and the ClickHouse MCP server](/guides/use-cases/ai-ml/MCP/ai-agent-libraries/mcp-agent)                                 | Learn how build an AI Agent with mcp-agent and the ClickHouse MCP server                                                            |
| [How to build an AI Agent with Microsoft Agent framework and the ClickHouse MCP server](/guides/use-cases/ai-ml/MCP/ai-agent-libraries/microsoft-agent-framework) | Learn how build an AI Agent with Microsoft Agent framework and the ClickHouse MCP server                                            |
| [How to build an AI Agent with Upsonic and the ClickHouse MCP server](/guides/use-cases/ai-ml/MCP/ai-agent-libraries/upsonic)                                     | Learn how build an AI Agent with Upsonic and the ClickHouse MCP server                                                              |
| [How to build an OpenAI agent using ClickHouse MCP server.](/guides/use-cases/ai-ml/MCP/ai-agent-libraries/openai-agents)                                         | Learn how to build an OpenAI agent that can interact with ClickHouse MCP server.                                                    |
| [Set up ClickHouse MCP server with Ollama](/guides/use-cases/ai-ml/MCP/ollama)                                                                                    | This guide explains how to set up Ollama with a ClickHouse MCP server.                                                              |
| [Using ClickHouse MCP server with AnythingLLM](/guides/use-cases/ai-ml/MCP/anythingllm)                                                                           | This guide explains how to set up AnythingLLM with a ClickHouse MCP server using Docker.                                            |
| [Using ClickHouse MCP server with Claude Desktop](/guides/use-cases/ai-ml/MCP/claude-desktop)                                                                     | This guide explains how to set up Claude Desktop with a ClickHouse MCP server.                                                      |
| [Using ClickHouse MCP server with Jan.ai](/guides/use-cases/ai-ml/MCP/janai)                                                                                      | This guide explains how to set up Jan.ai with a ClickHouse MCP server.                                                              |
| [Using ClickHouse MCP server with LibreChat](/guides/use-cases/ai-ml/MCP/librechat)                                                                               | This guide explains how to set up LibreChat with a ClickHouse MCP server using Docker.                                              |
| [Using ClickHouse MCP server with Open WebUI](/guides/use-cases/ai-ml/MCP/open-webui)                                                                             | This guide explains how to set up Open WebUI with a ClickHouse MCP server using Docker.                                             |
