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

# Jan.ai で ClickHouse MCPサーバー を使う

> このガイドでは、Jan.ai で ClickHouse MCPサーバー を設定する方法を説明します。

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>;
};

> このガイドでは、[Jan.ai](https://jan.ai/docs) で ClickHouse MCPサーバー を使う方法を説明します。

<Steps>
  <Step>
    ## Jan.ai をインストールする

    Jan.ai は、100% オフラインで動作するオープンソースの ChatGPT 代替アプリです。
    Jan.ai は [Mac](https://jan.ai/docs/desktop/mac)、[Windows](https://jan.ai/docs/desktop/windows)、[Linux](https://jan.ai/docs/desktop/linux) 向けにダウンロードできます。

    ネイティブアプリなので、ダウンロード後すぐに起動できます。
  </Step>

  <Step>
    ## Jan.ai に LLM を追加する

    設定メニューからモデルを有効にできます。

    OpenAI を有効にするには、以下のように APIキーを入力する必要があります。

    <Image img="https://mintcdn.com/private-7c7dfe99-detect-table-modification/pp61YI9DMmfgXVsV/images/use-cases/AI_ML/MCP/0_janai_openai.webp?fit=max&auto=format&n=pp61YI9DMmfgXVsV&q=85&s=d67a0f4cc00ad2dfdaf4b1d994b7a47e" alt="OpenAI モデルを有効化" size="md" width="938" height="359" data-path="images/use-cases/AI_ML/MCP/0_janai_openai.webp" />
  </Step>

  <Step>
    ## MCPサーバーを有効にする

    本稿執筆時点では、MCPサーバーは Jan.ai の実験的機能です。
    実験的機能をオンにすると有効化できます。

    <Image img="https://mintcdn.com/private-7c7dfe99-detect-table-modification/pp61YI9DMmfgXVsV/images/use-cases/AI_ML/MCP/1_janai_mcp_servers.webp?fit=max&auto=format&n=pp61YI9DMmfgXVsV&q=85&s=a579dc803feda25c302487a56054d7de" alt="MCPサーバーを有効化" size="md" width="1320" height="325" data-path="images/use-cases/AI_ML/MCP/1_janai_mcp_servers.webp" />

    このトグルをオンにすると、左側のメニューに `MCP servers` が表示されます。
  </Step>

  <Step>
    ## ClickHouse MCPサーバー を設定する

    `MCP servers` メニューをクリックすると、接続可能な MCPサーバーの一覧が表示されます。

    <Image img="https://mintcdn.com/private-7c7dfe99-detect-table-modification/pp61YI9DMmfgXVsV/images/use-cases/AI_ML/MCP/2_janai_mcp_servers_list.webp?fit=max&auto=format&n=pp61YI9DMmfgXVsV&q=85&s=8f68d0fcb6bdae9d5b950077883a1e40" alt="MCPサーバー一覧" size="md" width="1061" height="793" data-path="images/use-cases/AI_ML/MCP/2_janai_mcp_servers_list.webp" />

    これらのサーバーはデフォルトではすべて無効ですが、トグルをクリックすると有効にできます。

    ClickHouse MCPサーバー をインストールするには、`+` アイコンをクリックし、フォームに次の内容を入力します。

    <Image img="https://mintcdn.com/private-7c7dfe99-detect-table-modification/pp61YI9DMmfgXVsV/images/use-cases/AI_ML/MCP/3_janai_add_mcp_server.webp?fit=max&auto=format&n=pp61YI9DMmfgXVsV&q=85&s=25b68ea7c233bdcafd96809149cb8d85" alt="MCPサーバーを追加" size="md" width="543" height="551" data-path="images/use-cases/AI_ML/MCP/3_janai_add_mcp_server.webp" />

    入力が完了したら、まだ有効になっていない場合は ClickHouse Server のトグルをオンにします。

    <Image img="https://mintcdn.com/private-7c7dfe99-detect-table-modification/pp61YI9DMmfgXVsV/images/use-cases/AI_ML/MCP/4_janai_toggle.webp?fit=max&auto=format&n=pp61YI9DMmfgXVsV&q=85&s=e768c22005c78019fec3afce8676aa7e" alt="MCPサーバーを有効化" size="md" width="759" height="147" data-path="images/use-cases/AI_ML/MCP/4_janai_toggle.webp" />

    これで、ClickHouse MCPサーバー のツールがチャット画面に表示されます。

    <Image img="https://mintcdn.com/private-7c7dfe99-detect-table-modification/pp61YI9DMmfgXVsV/images/use-cases/AI_ML/MCP/5_jani_tools.webp?fit=max&auto=format&n=pp61YI9DMmfgXVsV&q=85&s=b893879bd60c8e2d331cf5b03f852c21" alt="ClickHouse MCPサーバー のツール" size="md" width="625" height="367" data-path="images/use-cases/AI_ML/MCP/5_jani_tools.webp" />
  </Step>

  <Step>
    ## Jan.ai で ClickHouse MCPサーバー とチャットする

    それでは、ClickHouse に保存されているデータについて対話してみましょう。
    質問してみます。

    <Image img="https://mintcdn.com/private-7c7dfe99-detect-table-modification/pp61YI9DMmfgXVsV/images/use-cases/AI_ML/MCP/6_janai_question.webp?fit=max&auto=format&n=pp61YI9DMmfgXVsV&q=85&s=e9c06bc9e10caa0c3b30bd0ec7c17dfc" alt="質問" size="md" width="830" height="183" data-path="images/use-cases/AI_ML/MCP/6_janai_question.webp" />

    Jan.ai はツールを呼び出す前に確認を求めます。

    <Image img="https://mintcdn.com/private-7c7dfe99-detect-table-modification/pp61YI9DMmfgXVsV/images/use-cases/AI_ML/MCP/7_janai_tool_confirmation.webp?fit=max&auto=format&n=pp61YI9DMmfgXVsV&q=85&s=070ade9608123131fcd9d28e77a04105" alt="ツール確認" size="md" width="538" height="274" data-path="images/use-cases/AI_ML/MCP/7_janai_tool_confirmation.webp" />

    その後、実行されたツール呼び出しの一覧が表示されます。

    <Image img="https://mintcdn.com/private-7c7dfe99-detect-table-modification/pp61YI9DMmfgXVsV/images/use-cases/AI_ML/MCP/8_janai_tools_called.webp?fit=max&auto=format&n=pp61YI9DMmfgXVsV&q=85&s=107e43eb3ed63cd225485110f84f7434" alt="呼び出されたツール" size="md" width="1174" height="577" data-path="images/use-cases/AI_ML/MCP/8_janai_tools_called.webp" />

    ツール呼び出しをクリックすると、呼び出しの詳細を確認できます。

    <Image img="https://mintcdn.com/private-7c7dfe99-detect-table-modification/pp61YI9DMmfgXVsV/images/use-cases/AI_ML/MCP/9_janai_tools_called_expanded.webp?fit=max&auto=format&n=pp61YI9DMmfgXVsV&q=85&s=e734278c1e88bce94c054e398a67a977" alt="展開されたツール呼び出し" size="md" width="1139" height="1418" data-path="images/use-cases/AI_ML/MCP/9_janai_tools_called_expanded.webp" />

    その下に、結果が表示されます。

    <Image img="https://mintcdn.com/private-7c7dfe99-detect-table-modification/pp61YI9DMmfgXVsV/images/use-cases/AI_ML/MCP/10_janai_result.webp?fit=max&auto=format&n=pp61YI9DMmfgXVsV&q=85&s=1b58f45c1e3abf7c5321f87ca8a25b57" alt="結果" size="md" width="1122" height="679" data-path="images/use-cases/AI_ML/MCP/10_janai_result.webp" />
  </Step>
</Steps>
