Kagi智能搜索
一个将Kagi搜索功能与Claude AI集成的MCP服务器,使Claude在回答需要最新信息的问题时能够进行实时网络搜索。
可用工具 (1 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
search 1 个参数 需填 1 项
Perform web search based on one or more queries. Results are from all queries given. They are numbered continuously, so that a user may be able to refer to a result by a specific number.
必填参数:queries
服务介绍
Kagi MCP 服务器
设置说明
在开始之前,请确保您已获得搜索 API 的访问权限。该 API 目前处于封闭测试阶段,需要申请才能使用。请发送邮件至 support@kagi.com 获取邀请。
首先安装 uv。
MacOS/Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh
Windows:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
使用 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"
}
}
}
}
通过 Smithery 安装
或者,您可以使用 Smithery 自动为 Claude Desktop 安装 Kagi:
npx -y @smithery/cli install kagimcp --client claude
向 Claude 提出需要搜索的问题
例如:“谁是《时代》杂志 2024 年的年度人物?”
调试
运行:
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
Windows:
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"
}
}
}
}
向 Claude 提出需要搜索的问题
例如:“谁是《时代》杂志 2024 年的年度人物?”
调试
运行:
# 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
然后访问 MCP 检查器 http://localhost:5173。您可能需要在检查器中的环境变量里添加您的 Kagi API 密钥(KAGI_API_KEY)。
注意事项
- 日志级别可以通过
FASTMCP_LOG_LEVEL环境变量进行调整(例如FASTMCP_LOG_LEVEL="ERROR")- 相关问题:https://github.com/kagisearch/kagimcp/issues/4