npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@iflow-mcp/kagi-ken-mcp

v1.1.0

Published

Kagi MCP server using kagi-ken package

Readme

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.

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:

  1. KAGI_SESSION_TOKEN environment variable
  2. ~/.kagi_session_token file 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

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

The server will automatically try the environment variable first, then fall back to the token file.

[!WARNING] 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-mcp

Option 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-mcp

Post-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 summarize
  • summary_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.md

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd kagi-ken-mcp
  2. Install dependencies:

    npm install

Running in Development Mode

npm run dev

Debugging

Use the MCP Inspector to debug:

npx @modelcontextprotocol/inspector node ./src/index.js

Then 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

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test with the MCP Inspector
  5. Submit a pull request

Author

Carlo Zottmann, [email protected], 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.

[!TIP] I make Shortcuts-related macOS & iOS productivity apps like Actions 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