Kagi MCP Server
Published
At a glance
- Category
- Vector & search
- GitHub repository
- kagisearch/kagimcp
- Watch out for
- Every call uses the Kagi API, so you need an API key with credit topped up in the Kagi API Portal.
Kagi maintains its own MCP server in the kagisearch/kagimcp repository. It is a Python package, kagimcp (version 1.2.0 in pyproject.toml), built on FastMCP and backed by the Kagi API. It gives an agent Kagi's search results and a page extractor, which is handy if you already pay for Kagi and would rather not route agent searches through an ad-funded engine.
Kagi documents three ways to run it. The simplest is Kagi's hosted endpoint at https://mcp.kagi.com/mcp, which needs no install and accepts either a Kagi account sign-in over OAuth or an API key as a bearer token. Locally it runs over stdio through uvx kagimcp with KAGI_API_KEY set. There is also a streamable HTTP mode and a Dockerfile for self-hosting.
The tool set is small on purpose. The README says the older kagi_fastgpt and kagi_summarizer tools were removed and are planned to return in a future release, so older tutorials that mention them are out of date.
How it connects
Your AI app
An assistant or agent that supports MCP
Kagi MCP Server
Runs as
- Python (uv / pip)
- Remote (HTTP)
Gives the agent
- Web search
- News, video, podcast and image search
- Kagi lenses
- Page extraction
- Schema trimming
Kagi
Signs in with
- API key
What it can do
- Web search
- kagi_search_fetch runs Kagi web searches and can attach page extracts to each result, with filters such as include_domains, exclude_domains, after, before and file_type.
- News, video, podcast and image search
- The same kagi_search_fetch tool covers news, videos, podcasts and images, so one tool handles most lookups.
- Kagi lenses
- kagi_search_fetch accepts a lens_id, letting the agent search through one of your Kagi lenses instead of the open web.
- Page extraction
- kagi_extract fetches a page's full content as markdown, useful when a search snippet is not enough.
- Schema trimming
- KAGI_HIDDEN_PARAMS hides chosen search parameters from the schema the model sees, and KAGI_SEARCH_FORMAT switches results between json and markdown.
Setting it up
For the hosted server in Claude Code, run claude mcp add kagi https://mcp.kagi.com/mcp --transport http --client-id 393794653092071821 --scope user, then open /mcp, select kagi and choose Authenticate to sign in at account.kagi.com. If you prefer an API key, create one at kagi.com/api/keys and pass it as an Authorization: Bearer header instead of the client ID. To run it locally, install uv and use claude mcp add kagi -e KAGI_API_KEY="YOUR_API_KEY_HERE" -- uvx kagimcp. Claude Desktop takes an mcpServers entry with command uvx, args ["kagimcp"] and KAGI_API_KEY in env, and Codex CLI uses codex mcp add kagi --env KAGI_API_KEY=<YOUR_API_KEY_HERE> -- uvx kagimcp. Optional variables include KAGI_SEARCH_TIMEOUT (default 10 seconds), KAGI_EXTRACT_TIMEOUT (default 30) and KAGI_MAX_RETRIES (default 2).
claude mcp add --transport http kagi https://mcp.kagi.com/mcpIf the server needs a sign-in or an API key, the setup notes above say which. Combine several servers in the MCP config generator
Where each client keeps its MCP config file, and the JSON it expects (cheat sheet)
Where it helps
- Look up current documentation or release notes for a library and cite the pages it found
- Search only a set of trusted domains while researching a bug, using include_domains
- Pull the full text of a blog post or spec as markdown with kagi_extract before summarising it
- Check recent news coverage on a topic with a date filter
Limitations and things to watch
- Every call uses the Kagi API, so you need an API key with credit topped up in the Kagi API Portal.
- On Family and Team plans only the account owner can reach the API portal, and automatic key setup through OAuth sign-in currently works only for the owner.
- Signing in with a Kagi account is only available over HTTP; the local stdio install requires KAGI_API_KEY.
- The kagi_fastgpt and kagi_summarizer tools have been removed from this server for now.
- Self-hosted HTTP instances must set KAGI_MCP_PUBLIC_URL, or OAuth discovery points clients at Kagi's hosted server.
Sources
Written from the project's own documentation, checked November 2026.
- github.com /kagisearch/kagimcp
- github.com /kagisearch/kagimcp/blob/main/pyproject.toml
- help.kagi.com /kagi/api/overview.html
How we research: where our facts come from, how often we re-check them, and why no one can pay for a review or a verdict.