KagiSAFE
The Official Model Context Protocol (MCP) server for Kagi Search & other tools.
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
An MCP server backed by the Kagi API. It exposes search and extraction tools to MCP-compatible clients.
Tools
- `kagi_search_fetch` - web, news, videos, podcasts, and image search with optional page extracts, filters, and Kagi lenses.
- `kagi_extract` - fetch a page's full content as markdown.
Note: The previouskagi_fastgptandkagi_summarizertools have been removed. Both are planned to return in a future release.
Hosted Server
We run a hosted MCP server at `https://mcp.kagi.com/mcp` — no install required. Point any HTTP-capable MCP client at it and authenticate with your Kagi API key.
OAuth2 isn't supported yet (it's on our roadmap), so for now grab your API key from the dashboard and pass it via Bearer HTTP authentication.
Example with Claude Code:
claude mcp add kagi https://mcp.kagi.com/mcp --transport http --header "Authorization: Bearer $(read -sp 'API key: ' k; echo $k)" --scope user
Prefer to run it yourself? See Client Setup for the local uvx install, or Self-Hosting to host the HTTP server on your own infrastructure.
Requirements
- A Kagi API key in
KAGI_API_KEY. - `uv` for the recommended
uvxinstall path.
Install uv:
curl -LsSf https://astral.sh/uv/install.sh | sh
Windows:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Client Setup
Codex CLI
codex mcp add kagi --env KAGI_API_KEY= -- uvx kagimcp
Codex writes MCP configuration to ~/.codex/config.toml.
Claude Desktop
Install uv first.
MacOS/Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh
Windows:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Then in your Claude Desktop config (found through Settings ->
b5ff88619e6bOBSERVED · 2026-09-30Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control. Replace the environment placeholders with a token scoped to the least it needs.
claude mcp add kagimcp --env KAGI_API_KEY=${KAGI_API_KEY} -- uvx kagimcp{
"mcpServers": {
"kagimcp": {
"command": "uvx",
"args": [
"kagimcp"
],
"env": {
"KAGI_API_KEY": "${KAGI_API_KEY}"
}
}
}
}Exposed tools (1)
1 read · 0 write · 0 destructive.
| Tool | Risk | Description |
|---|---|---|
kagi_extract | read | Extract the content of a web page as markdown using the Kagi Extract API. Use this to read the full content of a page when needed. |
Trust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | PASS |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- declared (1 observation(s))
- Network
- none-observed
- Shell
- none-observed
- Dependencies
- pinned
- Secrets in source
- none-found
Findings (4)
curl -sL http://127.0.0.1:8000/mcp -X POST \
claude mcp add kagi https://mcp.kagi.com/mcp --transport http --header "Authorization: Bearer $(read -sp 'API key: ' k; echo $k)" --scope user
curl -LsSf https://astral.sh/uv/install.sh | sh
curl -LsSf https://astral.sh/uv/install.sh | sh
Gates applied: no_behavioural_pass.
b5ff88619e6bfull audit observations/trust-audit/mcp-server/kagisearch__kagi.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-09-30 | b5ff88619e6b | SAFE | B | 89 | first audit |
Questions
What is the Kagi MCP server?
The Official Model Context Protocol (MCP) server for Kagi Search & other tools.
What tools does Kagi expose?
1 in total: 1 read-only, 0 that write, and 0 that can delete or overwrite. Every one is listed on this page with its risk.
Is Kagi safe to connect to an agent?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean server reads B.
What credentials does Kagi need?
It reads KAGI_API_KEY from the environment. Give it a token scoped to the least it needs — an agent that can be talked into calling a tool can be talked into calling it with your credentials.
How does Kagi run?
It speaks streamable-http, so it runs as a service you connect to over the network. It is published on PyPI as kagimcp.
How current is this page?
The grade is for one exact copy of the source (b5ff88619e6b), read on 2026-09-30. The repository is watched and re-audited when it changes.