SuperAPI AI Directory

kagi-ken-mcp

Kagi search and summarization without API access, authenticated with a Kagi session token.

Open website

About this tool

Purpose

kagi-ken-mcp is a lightweight Node MCP server that wraps the kagi-ken package, used to access Kagi.com services without Kagi API access. The official Kagi API requires a separate API key and is currently invite-only; if you already have a Kagi subscription but do not yet have API access, and want to let LLMs or agents such as Claude call Kagi services programmatically, this MCP server provides an alternative. The project name "Kagi-ken" is a portmanteau of "Kagi" (the service name) and "token". The author states that this project is not affiliated with or endorsed by Kagi.

Main capabilities

  • Search: Use Kagi Search to get web results, with support for concurrent query processing.
  • Summarizer: Use Kagi's Summarizer to generate summaries from URLs, supporting various document types such as web pages, videos, and audio.

Unlike the official Kagi API, which requires API access, this MCP server uses your existing Kagi session to access search and summarization features.

Usage

Authentication

The server supports two methods for using a Kagi session token, tried in the following order:

  1. KAGI_SESSION_TOKEN environment variable;
  2. A ~/.kagi_session_token file containing the token string.

Steps to obtain a session token:

  1. Visit the Kagi settings page in your browser;
  2. Copy the Session Link;
  3. Extract the token value from the link;
  4. Use that value as the session token: save it to ~/.kagi_session_token(recommended), or pass it in as the KAGI_SESSION_TOKEN environment variable.

Security note: Keep your session token safe; it can access your Kagi account.

Environment requirements

Requires Node.js 22 or later.

Add to Claude Desktop

Add kagi-ken-mcp to claude_desktop_config.json. In the Claude Desktop app, you can open this configuration via Settings → Developer → Local MCP Servers → Edit Config. It is recommended to turn off Claude Desktop's built-in web search so that it uses this MCP server instead; you can also add relevant instructions in Settings under "Personal preferences" (i.e., the system prompt).

Add to Claude Code

You can optionally disable Claude Code's built-in web search by setting permissions in the relevant .claude/settings*.json file.

Usage examples

Issue queries that require tool calls, for example: search-type "Who was time's 2024 person of the year?", summarizer-type "summarize this video: https://www.youtube.com/watch?v=sczwaYyaevY”。

Tool descriptions

  • kagi_search_fetch: Get web results based on one or more queries. Results are numbered consecutively for easy reference. Parameters:queries(string array): one or more search queries.
  • kagi_summarizer: Use the Kagi Summarizer API to generate a summary of URL content, supporting various document types such as web pages, videos, and audio. Parameters:url(string): the URL to summarize;summary_type(enum):"summary" for paragraph-style prose,"takeaway" for a bulleted list (default "summary");target_language(string, optional): language code, such as "EN" for English (default "EN").

Error handling

The server includes fairly comprehensive error handling: connection timeouts (10 seconds per search), invalid input validation, environment variable validation, and graceful error formatting.

Project structure and development

Clone the repository:git clone <repository-url> then cd kagi-ken-mcp; install dependencies:npm install.

In development mode, you can debug with MCP Inspector, then visit http://localhost:5173。若使用环境变量,请在 Add your KAGI_SESSION_TOKENto the environment variables section of the inspector.

Contribution process: Fork the repository, create a feature branch, make your changes, test with MCP Inspector, and submit a pull request.

Use cases

Suitable for users who have subscribed to Kagi but do not have (or have not yet obtained) official API access, and want to let an LLM or agent (such as Claude) call Kagi's search and summarization capabilities programmatically.

Limitations

  • You need to be a paying Kagi customer (subscriber).
  • This is an unofficial project and is not affiliated with or endorsed by Kagi.
  • It relies on session token authentication, so the token must be kept secure.
  • Node.js 22 or later is required.
  • More details regarding specific pricing, platform compatibility, and performance results are not yet available.