Get the FREE Ultimate OpenClaw Setup Guide →

kagi-ken

Unofficial MCP server for working with Kagi *without* API access (you'll need to be a customer). Searches and summarizes. Uses Kagi session token for easy authentication. Works well with your agent.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio czottmann-kagi-ken-mcp npx -y github:czottmann/kagi-ken-mcp

How to use

The kagi-ken-mcp server is a lightweight Node MCP server that exposes Kagi services using your existing Kagi session token. It provides two tools: kagi_search_fetch, which fetches web results from Kagi Search for one or more queries, and kagi_summarizer, which uses Kagi's Summarizer to generate a concise summary (or takeaway) from a URL or text content. You can configure the server to use your Kagi session token either via the KAGI_SESSION_TOKEN environment variable or by placing the token in your ~/.kagi_session_token file. Once running, you can direct your agent or client to call kagi_search_fetch for web search results and kagi_summarizer to obtain summaries of content, all through the MCP interface.

How to install

Prerequisites

  • Node.js 22+ (as required by the server)
  • npm (comes with Node.js)
  • An active Kagi subscription (token-based access)

Install and run locally

  1. Install dependencies (from the repository root):
npm install
  1. Run in development mode to start the MCP server (or set up via npx as shown in the README):
npm run dev
  1. (Optional) Run the MCP Inspector for debugging:
npx @modelcontextprotocol/inspector node ./src/index.js

Notes

  • The server is designed to use your Kagi session token either from KAGI_SESSION_TOKEN or from ~/.kagi_session_token. Ensure the token has the appropriate permissions and keep it secure.

Additional notes

Environment variables and token handling:

  • KAGI_SESSION_TOKEN: Directly provide your session token (as a string). If present, the server will use this first before consulting the token file.
  • ~/.kagi_session_token: A file containing only your Kagi session token; the server will read this if the env var is not set. Common issues:
  • If you see authentication errors, verify that the token is valid and has not expired.
  • For deployments, ensure the token file has restricted permissions (e.g., 600) to protect the token.
  • When integrating with Claude Desktop or Claude Code, use the provided MCP server configuration examples and ensure the local environment can reach the MCP server endpoint.
  • The MCP server exposes two tools: kagi_search_fetch and kagi_summarizer; ensure you call these tool names exactly as shown.

Related MCP Servers

Sponsor this space

Reach thousands of developers