--- slug: /use-cases/AI/MCP sidebar_label: 'MCP' title: 'MCP guides' pagination_prev: null pagination_next: null description: 'This page provides an intro to Model Context Protocol (MCP) and has a table of contents for MCP guides.' keywords: ['ClickHouse', 'MCP'] show_related_blogs: true doc_type: 'guide' --- import Image from '@theme/IdealImage'; import overview from '@site/static/images/use-cases/AI_ML/MCP/mcp_overview.png'; [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. ## What is MCP's architecture? {#mcp-architecture} 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: MCP overview ## Does ClickHouse have an MCP server? {#clickhouse-mcp-server} 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"](/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. ::: ## Guides for using the ClickHouse MCP server {#clickhouse-mcp-server-guides} Below are some guides showing how to use the ClickHouse MCP server. | Page | Description | |-----|-----| | [How to build a ClickHouse-backed AI Agent with Streamlit](/use-cases/AI/MCP/ai-agent-libraries/streamlit-agent) | 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.](/use-cases/AI/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.](/use-cases/AI/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.](/use-cases/AI/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.](/use-cases/AI/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](/use-cases/AI/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](/use-cases/AI/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](/use-cases/AI/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](/use-cases/AI/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](/use-cases/AI/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](/use-cases/AI/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](/use-cases/AI/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](/use-cases/AI/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](/use-cases/AI/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.](/use-cases/AI/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 AnythingLLM and ClickHouse Cloud](/use-cases/AI/MCP/anythingllm) | This guide explains how to set up AnythingLLM with a ClickHouse MCP server using Docker. | | [Set up ClickHouse MCP server with Claude Desktop](/use-cases/AI/MCP/claude-desktop) | This guide explains how to set up Claude Desktop with a ClickHouse MCP server. | | [Set up ClickHouse MCP server with Jan.ai](/use-cases/AI/MCP/janai) | This guide explains how to set up Jan.ai with a ClickHouse MCP server. | | [Set up ClickHouse MCP server with LibreChat and ClickHouse Cloud](/use-cases/AI/MCP/librechat) | This guide explains how to set up LibreChat with a ClickHouse MCP server using Docker. | | [Set up ClickHouse MCP server with Ollama](/use-cases/AI/MCP/ollama) | This guide explains how to set up Ollama with a ClickHouse MCP server. | | [Set up ClickHouse MCP server with Open WebUI and ClickHouse Cloud](/use-cases/AI/MCP/open-webui) | This guide explains how to set up Open WebUI with a ClickHouse MCP server using Docker. |