kagi-kan-mcp
The kagi-ken-mcp server provides programmatic access to Kagi.com's search and summarization services using a session token instead of an API key.
Kagi Search: Fetch web results for one or more queries, with results numbered for easy reference
Kagi Summarizer: Summarize content from URLs (webpages, videos, audio, etc.) with customizable output types:
Paragraph prose summary (
"summary")Bulleted list of key points (
"takeaway")Language-specific summaries using language codes (e.g.,
"EN"for English)
Provides access to Kagi's search and summarization services using session tokens, enabling web search queries and content summarization from URLs with customizable output formats and languages
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@kagi-kan-mcpsearch for recent advancements in quantum computing"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
kagi-ken-mcp
A lightweight Node MCP server around the kagi-ken package, providing access to Kagi.com services using Kagi session tokens:
Search: Searches Kagi
Summarizer: Uses Kagi's Summarizer to create summaries from URLs or text content
Unlike the official Kagi API which requires API access, this MCP server uses your existing Kagi session to access both search and summarization features.
"Kagi-ken" is a portmanteau of "Kagi" (the service) and "token".
Why?
The Kagi API requires a separate API key, which are invite-only at the moment. If you already have a Kagi subscription but no API access, yet want to programmatically access Kagi's services from LLMs or agents like Claude, this MCP server provides an alternative.
Related MCP server: kagi-session2api-mcp
Features
Search: Fetch web results using Kagi Search with concurrent query processing
Summarization: Summarize content from URLs with customizable output types and languages
The server supports two methods for using your Kagi session token (see Installation), in this order:
KAGI_SESSION_TOKENenvironment variable~/.kagi_session_tokenfile containing the token string
It includes comprehensive error handling:
Connection timeouts (10 seconds per search)
Invalid input validation
Environment variable validation
Graceful error formatting
Installation
Node.js 22+ is required.
1. Get Kagi Session Token
Visit Kagi Settings in your browser
Copy the Session Link
Extract the
tokenvalue from the linkUse that value as your session token: save to
~/.kagi_session_token(recommended), alternatively pass asKAGI_SESSION_TOKENenv variable
The server will automatically try the environment variable first, then fall back to the token file.
Security Note: Keep your session token private. It provides access to your Kagi account.
2.a. Add MCP server to Claude Desktop
Add kagi-ken-mcp to your claude_desktop_config.json which you can open from the Claude Desktop app via Settings → Developer → Local MCP Servers → Edit Config.
Option 1: Using token file (recommended)
{
"mcpServers": {
"kagi-ken-mcp": {
"command": "npx",
"args": ["-y", "github:czottmann/kagi-ken-mcp"]
}
}
}Option 2: Using environment variable
{
"mcpServers": {
"kagi-ken-mcp": {
"command": "npx",
"args": ["-y", "github:czottmann/kagi-ken-mcp"],
"env": {
"KAGI_SESSION_TOKEN": "YOUR_SESSION_TOKEN_HERE"
}
}
}
}Post-install
Disable Claude Desktop's built-in websearch so it'll use this here MCP server. And maybe add this to your "Personal preferences" (i.e., system prompt) in Settings:
For web searches, use kagi-ken-mcp MCP server's `kagi_search_fetch` tool.
For summarizing a URL, use the kagi-ken-mcp MCP server's `kagi_summarizer` tool.2.b. Add MCP server to Claude Code
Option 1: Using token file (recommended)
claude mcp add kagi-ken-mcp --scope user -- npx -y github:czottmann/kagi-ken-mcpOption 2: Using environment variable
claude mcp add kagi-ken-mcp \
--scope user \
--env KAGI_SESSION_TOKEN="YOUR_SESSION_TOKEN_HERE" -- \
npx -y github:czottmann/kagi-ken-mcpPost-install
Disable Claude Code's built-in web search (optional) by setting the permission in the relevant .claude/settings*.json file:
{
"permissions": {
"deny": [
"WebSearch"
],
"allow": [
"mcp__kagi-ken-mcp__kagi_search_fetch",
"mcp__kagi-ken-mcp__kagi_summarizer"
]
}
}Usage: Pose query that requires use of a tool
e.g. "Who was time's 2024 person of the year?" for search, or "summarize this video: https://www.youtube.com/watch?v=sczwaYyaevY" for summarizer.
Tools
kagi_search_fetch
Fetch web results based on one or more queries using the Kagi Search API. Results are numbered continuously for easy reference.
Parameters:
queries(array of strings): One or more search queries
kagi_summarizer
Summarize content from URLs using the Kagi Summarizer API. Supports various document types including webpages, videos, and audio.
Parameters:
url(string): URL to summarizesummary_type(enum):"summary"for paragraph prose or"takeaway"for bullet points (default:"summary")target_language(string, optional): Language code (e.g.,"EN"for English, default:"EN")
Development
Project Structure
kagi-ken-mcp/
├── src/
│ ├── index.js # Main server entry point
│ ├── tools/
│ │ ├── search.js # Search tool implementation
│ │ └── summarizer.js # Summarizer tool implementation
│ └── utils/
│ └── formatting.js # Utility functions
├── package.json
└── README.mdInstallation
Clone the repository:
git clone <repository-url> cd kagi-ken-mcpInstall dependencies:
npm install
Running in Development Mode
npm run devDebugging
Use the MCP Inspector to debug:
npx @modelcontextprotocol/inspector node ./src/index.jsThen access the inspector at http://localhost:5173. If using environment variables, add your KAGI_SESSION_TOKEN in the environment variables section of the inspector.
Contributing
Fork the repository
Create a feature branch
Make your changes
Test with the MCP Inspector
Submit a pull request
Author
Carlo Zottmann, carlo@zottmann.dev, https://c.zottmann.dev, https://github.com/czottmann.
This project is neither affiliated with nor endorsed by Kagi. I'm just a very happy customer.
I make Shortcuts-related macOS & iOS productivity apps likeActions For Obsidian, Browser Actions (which adds Shortcuts support for several major browsers), and BarCuts (a surprisingly useful contextual Shortcuts launcher). Check them out!
Related Projects
czottmann/kagi-ken - Unofficial session token-based Kagi client, Node
czottmann/kagi-ken-cli - Unofficial Node session token-based CLI tool, Node
Official Kagi MCP Server - Python
Available Tools
2 toolskagi_search_fetchKagi SearchA
Fetch web results based on one or more queries using the Kagi.com web search engine. Use for general search and when the user explicitly tells you to 'fetch' results/information. Results are from all queries given. They are numbered continuously, so that a user may be able to refer to a result by a specific number. Supports optional limit parameter to control results per query.
| Name | Required | Description | Default |
|---|---|---|---|
| queries | Yes | One or more concise, keyword-focused search queries. Include essential context within each query for standalone use. | |
| limit | No | Maximum number of search results per query (default: 10, max: 50) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It explains that results from multiple queries are merged and numbered continuously, which is helpful beyond the schema. However, it does not disclose auth requirements, rate limits, or error behavior, leaving gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is composed of three concise sentences, each adding necessary information. It front-loads the purpose and provides essential behavioral details without fluff. Every sentence earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the simplicity of the tool, the description covers the main purpose and behavior. However, with no output schema, it lacks details about the response structure (e.g., result fields), which an agent may need to interpret results. It is adequate but not fully complete for a tool with no annotations.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline is 3. The description adds value by explaining how the queries parameter affects output (combined, numbered), which is not in the schema. The limit parameter description in the text is redundant with the schema, but the added context for queries raises the score.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool fetches web results using Kagi search, specifying the action ('fetch') and resource ('web results'). It also provides a specific usage hint ('when the user tells you to fetch'), which distinguishes it from general tasks.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly says 'Use for general search and when the user explicitly tells you to fetch results/information.' This gives clear context for when to invoke, though it does not mention alternatives or when not to use, missing some guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
kagi_summarizerKagi SummarizerA
Summarize content from a URL using the Kagi.com Summarizer API. The Summarizer can summarize any document type (text webpage, video, audio, etc.)
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | A URL to a document to summarize. | |
| summary_type | No | Type of summary to produce. Options are 'summary' for paragraph prose and 'takeaway' for a bulleted list of key points. | summary |
| target_language | No | Desired output language using language codes (e.g., 'EN' for English). If not specified, the document's original language influences the output. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description must bear full burden. It mentions the API and broad document support but does not disclose rate limits, auth needs, or error scenarios. Basic behavior is covered but lacks depth.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, front-loaded with core purpose, no redundant information. Efficient and to the point.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with 3 parameters and no output schema, the description covers purpose and capability well. Lacks output format hint or limitations, but overall adequate given simplicity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline is 3. The description adds value by stating the tool handles any document type (webpage, video, audio), providing context beyond the schema's parameter descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool summarizes content from a URL using Kagi API, specifying support for any document type. It differentiates from the sibling tool 'kagi_search_fetch' which likely retrieves search results.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies general usage ('summarize any document type') but provides no explicit guidance on when to use this tool versus the sibling 'kagi_search_fetch', nor exclusions or prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v1.0.0- Changed
kagi_search_fetch1 field changed- added
Input schema / properties / limitAdded value: +{ + "description": "Maximum number of search results per query (default: 10, max: 50)", + "maximum": 50, + "minimum": 1, + "type": "integer" +}
2 tool updates
- First observed
kagi_search_fetch - First observed
kagi_summarizer
TDQS
Scored across 2 tools
The two tools serve entirely different purposes: one for fetching web search results, the other for summarizing content from a URL. There is no overlap or ambiguity.
Both tools use a consistent 'kagi_<action>' pattern (kagi_search_fetch and kagi_summarizer), making the naming predictable and easy to follow.
With only two tools, the server is minimal but still covers its core capabilities of search and summarization. Each tool earns its place, though the count is slightly below the typical 3-15 range.
The tool set covers the fundamental operations for the server's purpose: searching the web and summarizing content. Minor gaps like additional result filtering or multiple summary modes exist, but the core workflow is complete.
Maintenance
Related MCP Connectors
MCP server for Google search results via SERP API
Docs: https://docs.keenable.ai/mcp-server Keenable is a free, remote MCP server that gives agents access to the web index. Search the web with ranked results and date/site filters, then fetch any indexed page as clean markdown. Works out of the box with no account or API key.
Serper MCP — wraps the Serper Google Search API (serper.dev)
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables integration with Kagi search engine services including web search, content summarization from URLs, and AI assistant conversations. Uses session tokens to access Kagi's search API, summarizer, and AI models directly within MCP-compatible applications.10 npm3MIT
- AlicenseAqualityDmaintenanceProvides free web search and URL summarization using Kagi session tokens, compatible with any MCP client.283MIT
- AlicenseAqualityAmaintenanceMCP server for private web search via self-hosted SearXNG with local reranking, full-page content fetching via Firecrawl, and optional Ollama-powered query expansion and summaries.71,117 npm22MIT
- AlicenseNot gradedqualityDmaintenanceFree web search MCP server using SearXNG, supporting web search, news search, and search summaries.MIT