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
Related MCP server: Database Tools for Claude AI
本地/开发设置说明
克隆仓库
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下。
高级配置