Skip to content
v0.1.0MIT

Kagi web search for coding agents, with only the tools you choose

kagi

Kagi web search for coding agents, with only the tools you choose. The plugin runs the kagi CLI's MCP server (kagi mcp, markdown output), which shows the agent only the tools named in KAGI_MCP_TOOLS. It adds the kagi skill (searching, the CLI fallback, signing in) and, for omp, the always-on rule web-search: every web search goes through Kagi.

The kagi CLI is pinned (mise.toml); bin/launcher runs the pinned build, downloading and verifying it on first use (on Linux, the static build, which runs on any distribution, NixOS included). scripts/mcp.sh starts the MCP server. skills/kagi/scripts/kagi.sh runs the CLI as kagi from any working directory; the skill's CLI fallback uses it by its absolute path.

Requirements

A Kagi account. Sign in once, from the plugin folder: skills/kagi/scripts/kagi.sh auth (a wizard), or skills/kagi/scripts/kagi.sh auth set --session-token <token or Session Link URL>. The sign-in lives in kagi's own config, shared by every kagi binary.

Choosing tools

KAGI_MCP_TOOLS, kagi's own allowlist, set in the agent's environment, is a comma-separated list of tool names. Unset or empty, the plugin sets it to the default: kagi_auth_status, search, quick answers and news. Set, it replaces the default, so list the default tools too to keep them. kagi refuses to start when the list names a tool it doesn't have.

The tools, grouped:

GroupToolsDefaultNeeds
statuskagi_auth_statusyes
searchkagi_search, kagi_batch_searchyes
quick answerskagi_quickyes
newskagi_news, kagi_news_categories, kagi_news_chaos, kagi_news_filter_presets, kagi_news_search, kagi_smallwebyes
APIkagi_extractan API key
legacy APIkagi_fastgpt, kagi_enrich_web, kagi_enrich_newsa legacy API token
Assistantkagi_assistant_custom_get, kagi_assistant_custom_list, kagi_assistant_models, kagi_assistant_thread_export, kagi_assistant_thread_get, kagi_assistant_thread_list, kagi_summarize, kagi_translate
accountkagi_auth_check, kagi_custom_bang_get, kagi_custom_bang_list, kagi_history_list, kagi_history_stats, kagi_lens_get, kagi_lens_list, kagi_redirect_get, kagi_redirect_list, kagi_site_pref_list

For example, KAGI_MCP_TOOLS=kagi_search,kagi_batch_search,kagi_extract shows only search and kagi_extract.

A tool that needs a key works only with it, so set the key when you enable the tool: the API key in KAGI_API_KEY or with skills/kagi/scripts/kagi.sh auth set --api-key <key>, the legacy API token in KAGI_API_TOKEN or with auth set --api-token <token>.