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

# Using ClickHouse MCP server with Jan.ai

> This guide explains how to set up Jan.ai with a ClickHouse MCP server.

export const Image = ({img, alt, size = "lg"}) => {
  const normalizedSize = ["sm", "md", "lg"].includes(size) ? size : "lg";
  return <div className={`ch-image-${normalizedSize}`}>
      <Frame>
        <img src={img} alt={alt} />
      </Frame>
    </div>;
};

> This guide explains how to use the ClickHouse MCP server with [Jan.ai](https://jan.ai/docs).

<Steps>
  <Step title="Install Jan.ai" id="install-janai">
    Jan.ai is an open source ChatGPT-alternative that runs 100% offline.
    You can download Jan.ai for [Mac](https://jan.ai/docs/desktop/install/mac), [Windows](https://jan.ai/docs/desktop/windows), or [Linux](https://jan.ai/docs/desktop/linux).

    It's a native app, so once it's downloaded, you can launch it.
  </Step>

  <Step title="Add LLM to Jan.ai" id="add-llm-to-janai">
    We can enabled models via the settings menu.

    To enable OpenAI, we need to provide an API key, as shown below:

    <Image img="https://mintcdn.com/private-7c7dfe99-framing-web-ui/JD8rhpHOLGi1SSTp/images/use-cases/AI_ML/MCP/0_janai_openai.webp?fit=max&auto=format&n=JD8rhpHOLGi1SSTp&q=85&s=b268513149825358cca8c6800381e6aa" alt="Enable OpenAI models" size="md" width="938" height="359" data-path="images/use-cases/AI_ML/MCP/0_janai_openai.webp" />
  </Step>

  <Step title="Enable MCP servers" id="enable-mcp-servers">
    At the time of writing, MCP servers are an experimental feature in Jan.ai.
    We can enable them by toggling experimental features:

    <Image img="https://mintcdn.com/private-7c7dfe99-framing-web-ui/JD8rhpHOLGi1SSTp/images/use-cases/AI_ML/MCP/1_janai_mcp_servers.webp?fit=max&auto=format&n=JD8rhpHOLGi1SSTp&q=85&s=fda12d0489036b8b0c089b1a52ecf121" alt="Enable MCP servers" size="md" width="1320" height="325" data-path="images/use-cases/AI_ML/MCP/1_janai_mcp_servers.webp" />

    Once that toggle is pressed, we'll see `MCP servers` on the left menu.
  </Step>

  <Step title="Configure ClickHouse MCP server" id="configure-clickhouse-mcp-server">
    If we click on the `MCP servers` menu, we'll see a list of MCP servers that we can connect to:

    <Image img="https://mintcdn.com/private-7c7dfe99-framing-web-ui/JD8rhpHOLGi1SSTp/images/use-cases/AI_ML/MCP/2_janai_mcp_servers_list.webp?fit=max&auto=format&n=JD8rhpHOLGi1SSTp&q=85&s=cfe9db939d2cd04b2f13dbf6a2f99e04" alt="MCP servers list" size="md" width="1061" height="793" data-path="images/use-cases/AI_ML/MCP/2_janai_mcp_servers_list.webp" />

    There servers are all disabled by default, but we can able them by clicking the toggle.

    To install the ClickHouse MCP server, we need to click on the `+` icon and then populate the form with the following:

    <Image img="https://mintcdn.com/private-7c7dfe99-framing-web-ui/JD8rhpHOLGi1SSTp/images/use-cases/AI_ML/MCP/3_janai_add_mcp_server.webp?fit=max&auto=format&n=JD8rhpHOLGi1SSTp&q=85&s=1e1cf1e10d1c3e0865929092c2212983" alt="Add MCP server" size="md" width="543" height="551" data-path="images/use-cases/AI_ML/MCP/3_janai_add_mcp_server.webp" />

    Once we've done that, we'll need to toggle the ClickHouse Server if it's not already toggled:

    <Image img="https://mintcdn.com/private-7c7dfe99-framing-web-ui/JD8rhpHOLGi1SSTp/images/use-cases/AI_ML/MCP/4_janai_toggle.webp?fit=max&auto=format&n=JD8rhpHOLGi1SSTp&q=85&s=b939989bb6e461d244ef36c204626cb5" alt="Enable MCP server" size="md" width="759" height="147" data-path="images/use-cases/AI_ML/MCP/4_janai_toggle.webp" />

    The ClickHouse MCP server's tools will now be visible on the chat dialog:

    <Image img="https://mintcdn.com/private-7c7dfe99-framing-web-ui/JD8rhpHOLGi1SSTp/images/use-cases/AI_ML/MCP/5_jani_tools.webp?fit=max&auto=format&n=JD8rhpHOLGi1SSTp&q=85&s=b009c681091af629ac929b885ef0701e" alt="ClickHouse MCP server tools" size="md" width="625" height="367" data-path="images/use-cases/AI_ML/MCP/5_jani_tools.webp" />
  </Step>

  <Step title="Chat to ClickHouse MCP server with Jan.ai" id="chat-to-clickhouse-mcp-server">
    It's time to have a conversation about some data stored in ClickHouse!
    Let's ask a question:

    <Image img="https://mintcdn.com/private-7c7dfe99-framing-web-ui/JD8rhpHOLGi1SSTp/images/use-cases/AI_ML/MCP/6_janai_question.webp?fit=max&auto=format&n=JD8rhpHOLGi1SSTp&q=85&s=451e8eaa0eca2ace92a41ed45d8989e7" alt="Question" size="md" width="830" height="183" data-path="images/use-cases/AI_ML/MCP/6_janai_question.webp" />

    Jan.ai will ask confirmation before calling a tool:

    <Image img="https://mintcdn.com/private-7c7dfe99-framing-web-ui/JD8rhpHOLGi1SSTp/images/use-cases/AI_ML/MCP/7_janai_tool_confirmation.webp?fit=max&auto=format&n=JD8rhpHOLGi1SSTp&q=85&s=041ce39e558b2dc67e75c6bba6313def" alt="Tool confirmation" size="md" width="538" height="274" data-path="images/use-cases/AI_ML/MCP/7_janai_tool_confirmation.webp" />

    It will then show us the list of tool calls that were made:

    <Image img="https://mintcdn.com/private-7c7dfe99-framing-web-ui/JD8rhpHOLGi1SSTp/images/use-cases/AI_ML/MCP/8_janai_tools_called.webp?fit=max&auto=format&n=JD8rhpHOLGi1SSTp&q=85&s=5ddd06b2b27d226cb2ce01b947f86366" alt="Tools called" size="md" width="1174" height="577" data-path="images/use-cases/AI_ML/MCP/8_janai_tools_called.webp" />

    If we click on the tool call, we can see the details of the call:

    <Image img="https://mintcdn.com/private-7c7dfe99-framing-web-ui/JD8rhpHOLGi1SSTp/images/use-cases/AI_ML/MCP/9_janai_tools_called_expanded.webp?fit=max&auto=format&n=JD8rhpHOLGi1SSTp&q=85&s=5566ccaec6c7ca70b1dc7c0b1c520750" alt="Tools called expanded" size="md" width="1139" height="1418" data-path="images/use-cases/AI_ML/MCP/9_janai_tools_called_expanded.webp" />

    And then underneath, we have our result:

    <Image img="https://mintcdn.com/private-7c7dfe99-framing-web-ui/JD8rhpHOLGi1SSTp/images/use-cases/AI_ML/MCP/10_janai_result.webp?fit=max&auto=format&n=JD8rhpHOLGi1SSTp&q=85&s=350e43a9633972ffbf43be4e6736c950" alt="Result" size="md" width="1122" height="679" data-path="images/use-cases/AI_ML/MCP/10_janai_result.webp" />
  </Step>
</Steps>
