Kagi MCP Server

Official
MIT License
51
  • Apple
  • Linux

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Integrates with Kagi search API to provide search capabilities to Claude AI, allowing Claude to answer questions requiring up-to-date information through internet search

Kagi MCP 服务器

设置说明

首先,除非您只使用非搜索工具,否则请确保您有权访问搜索 API。该 API 目前处于封闭测试阶段,可根据要求提供。请联系support@kagi.com获取邀请。

首先安装 uv。

MacOS/Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

视窗:

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

通过 Smithery 安装

或者,您可以通过Smithery安装 Kagi for Claude Desktop:

npx -y @smithery/cli install kagimcp --client claude

使用 Claude Desktop 进行设置

// claude_desktop_config.json // Can find location through: // Hamburger Menu -> File -> Settings -> Developer -> Edit Config { "mcpServers": { "kagi": { "command": "uvx", "args": ["kagimcp"], "env": { "KAGI_API_KEY": "YOUR_API_KEY_HERE" "KAGI_SUMMARIZER_ENGINE": "YOUR_ENGINE_CHOICE_HERE" // Defaults to "cecil" engine if env var not present } } } }

需要使用工具的姿势查询

例如搜索“谁是《时代》杂志 2024 年度人物?”,或总结“总结这个视频: https://www.youtube.com/watch?v =jNQXAC9IVRw”。

调试

跑步:

npx @modelcontextprotocol/inspector uvx kagimcp

本地/开发设置说明

克隆仓库

git clone https://github.com/kagisearch/kagimcp.git

安装依赖项

首先安装 uv。

MacOS/Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

视窗:

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

然后安装 MCP 服务器依赖项:

cd kagimcp # Create virtual environment and activate it uv venv source .venv/bin/activate # MacOS/Linux # OR .venv/Scripts/activate # Windows # Install dependencies uv sync

使用 Claude Desktop 进行设置

使用 MCP CLI SDK

# `pip install mcp[cli]` if you haven't mcp install /ABSOLUTE/PATH/TO/PARENT/FOLDER/kagimcp/src/kagimcp/server.py -v "KAGI_API_KEY=API_KEY_HERE"

手动

# claude_desktop_config.json # Can find location through: # Hamburger Menu -> File -> Settings -> Developer -> Edit Config { "mcpServers": { "kagi": { "command": "uv", "args": [ "--directory", "/ABSOLUTE/PATH/TO/PARENT/FOLDER/kagimcp", "run", "kagimcp" ], "env": { "KAGI_API_KEY": "YOUR_API_KEY_HERE" "KAGI_SUMMARIZER_ENGINE": "YOUR_ENGINE_CHOICE_HERE" // Defaults to "cecil" engine if env var not present } } } }

需要使用工具的姿势查询

例如搜索“谁是《时代》杂志 2024 年度人物?”,或总结“总结这个视频: https://www.youtube.com/watch?v =jNQXAC9IVRw”。

调试

跑步:

# If mcp cli installed (`pip install mcp[cli]`) mcp dev /ABSOLUTE/PATH/TO/PARENT/FOLDER/kagimcp/src/kagimcp/server.py # If not npx @modelcontextprotocol/inspector \ uv \ --directory /ABSOLUTE/PATH/TO/PARENT/FOLDER/kagimcp \ run \ kagimcp

然后通过http://localhost:5173访问 MCP 检查器。您可能需要在检查器的环境变量中,将 Kagi API 密钥添加到KAGI_API_KEY下。

高级配置

  • 可以通过FASTMCP_LOG_LEVEL环境变量调整日志记录级别(例如FASTMCP_LOG_LEVEL="ERROR"
  • 可以使用KAGI_SUMMARIZER_ENGINE环境变量定制摘要引擎(例如KAGI_SUMMARIZER_ENGINE="daphne"

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

Tools

将 Kagi 搜索功能与 Claude AI 相集成的 MCP 服务器,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

  1. Setup Intructions
    1. Installing via Smithery
    2. Setup with Claude Desktop
    3. Pose query that requires use of a tool
    4. Debugging
  2. Local/Dev Setup Instructions
    1. Clone repo
    2. Install dependencies
    3. Setup with Claude Desktop
    4. Pose query that requires use of a tool
    5. Debugging
  3. Advanced Configuration
    ID: xabrrs4bka