kagi-mcp is a tiny MCP server built on top of kagi-cli.
It is intentionally just an extra repo:
- separate repo
- one Rust binary
- wraps the
kagiCLI instead of reimplementing Kagi logic - returns the same JSON the CLI already emits
- A working
kagibinary onPATH, orKAGI_CLI_PATHpointing to it - Kagi credentials provided through environment variables
KAGI_SESSION_TOKENKAGI_API_TOKEN
.kagi.toml is not the recommended auth path for MCP usage because the CLI resolves it relative to the server process working directory.
cargo build --releaseKAGI_CLI_PATH=/path/to/kagi \
KAGI_SESSION_TOKEN=... \
KAGI_API_TOKEN=... \
./target/release/kagi-mcpOptional:
KAGI_CLI_PATH: explicit path to thekagibinaryKAGI_MCP_TIMEOUT_MS: subprocess timeout in milliseconds, default30000
{
"mcpServers": {
"kagi": {
"command": "/home/ubuntu/workspace/kagi-mcp/target/release/kagi-mcp",
"env": {
"KAGI_CLI_PATH": "/home/ubuntu/.nvm/versions/node/v24.13.0/bin/kagi",
"KAGI_SESSION_TOKEN": "your-session-token",
"KAGI_API_TOKEN": "your-api-token"
}
}
}
}kagi_searchkagi_summarizekagi_newskagi_news_categorieskagi_news_chaoskagi_assistantkagi_fastgptkagi_enrich_webkagi_enrich_newskagi_smallwebkagi_auth_statuskagi_auth_check
cargo test