kagi mcp
Run a stdio JSON-RPC server that exposes Kagi tools for agents.
Synopsis
Install into an AI agent
kagi mcp install, kagi mcp setup, and kagi mcp auth are aliases for the same setup flow. On a TTY, the command asks which agents to configure. In scripts, pass one or more --target values:
Use
--server-name <NAME> to choose a different MCP server key, or --kagi-path <PATH> if the client needs a specific executable path. By default, setup uses the currently running kagi executable.
Setup merges into existing config and preserves other MCP servers. It updates only the selected server key, which defaults to kagi-mcp.
Use with Codex
kagi mcp is a stdio server. You normally do not run it in a separate terminal; your MCP client launches it when it needs Kagi tools.
Start by making sure kagi works from your shell:
command pointing at the kagi binary and args set to mcp.
If Codex will not run from the directory that contains your ./.kagi.toml, pass credentials through the MCP entry instead:
KAGI_SESSION_TOKEN unlocks subscriber-backed search, Quick Answer, and news search. Add --env KAGI_API_KEY="$KAGI_API_KEY" when you want current /api/v1 Search or Extract. Add --env KAGI_API_TOKEN="$KAGI_API_TOKEN" when you want the legacy public summarizer.
If you previously used the separate kagi-mcp wrapper, replace it with the native CLI server:
./.kagi.toml, put --profile after mcp:
Tools
Default read/query tools:kagi_searchandkagi_batch_search- web search, News-tab search, filters, lenses, snaps, dates, ordering, templates, follow summaries, cache options, and output formats.kagi_summarize- public API or subscriber summarizer with engine, summary type, target language, length, cache, and local cache options.kagi_extract- Extract API markdown, JSON, compact JSON, or TOON output.kagi_quick- Quick Answer with lens, cache, and output options.kagi_news,kagi_news_categories,kagi_news_chaos, andkagi_news_filter_presets- public Kagi News feed and metadata.kagi_news_search- subscriber News-tab search clusters.kagi_assistant,kagi_assistant_models,kagi_assistant_thread_list,kagi_assistant_thread_get, andkagi_assistant_thread_export- Assistant prompt and thread reads.kagi_assistant_custom_listandkagi_assistant_custom_get- read saved assistant definitions.kagi_ask_page- page-focused Assistant question.kagi_translate- Kagi Translate text mode.kagi_fastgpt- FastGPT API answers.kagi_enrich_webandkagi_enrich_news- enrichment indexes.kagi_smallweb- Small Web feed.kagi_lens_list,kagi_lens_get,kagi_custom_bang_list,kagi_custom_bang_get,kagi_redirect_list, andkagi_redirect_get- read account search settings.kagi_auth_statusandkagi_auth_check- inspect and validate selected credentials.kagi_history_list,kagi_history_stats, andkagi_site_pref_list- inspect local CLI state.
--enable-mutating-tools:
kagi_assistant_thread_deletekagi_assistant_custom_create,kagi_assistant_custom_update,kagi_assistant_custom_deletekagi_lens_create,kagi_lens_update,kagi_lens_delete,kagi_lens_enable,kagi_lens_disablekagi_custom_bang_create,kagi_custom_bang_update,kagi_custom_bang_deletekagi_redirect_create,kagi_redirect_update,kagi_redirect_delete,kagi_redirect_enable,kagi_redirect_disablekagi_site_pref_set,kagi_site_pref_removekagi_cli- run any non-mcpkagicommand by passing anargsarray and optionalstdin. Use this for exact CLI parity when a workflow is not modeled as a structured MCP tool.
Authentication
The server uses the same credentials as the CLI. Use--profile <NAME> to select a profile before mcp.