Skip to main content
Glama
yuki-yano

Kagi MCP

by yuki-yano

Kagi MCP (Node.js)

A Node.js implementation of the Kagi Model Context Protocol (MCP) server. This provides a more stable alternative to the official Python implementation, especially when running multiple instances.

Features

  • Search web content using Kagi Search API

  • Summarize documents, videos, and audio using Kagi Summarizer API

  • No port conflicts when running multiple instances

  • Full compatibility with Claude Desktop

Related MCP server: MCP Web Research Server

Prerequisites

  • Node.js 18 or higher

  • Kagi API key (request from support@kagi.com)

  • Note: The Search API is in closed beta. You may need to request access separately.

Installation

No installation needed! Claude Desktop can run the package directly using npx.

Method 2: Install from npm

npm install -g kagi-mcp

Or use it directly with npx:

npx kagi-mcp

Method 3: Install from GitHub directly

npm install -g github:yuki-yano/kagi-mcp

Method 4: Install from source

git clone https://github.com/yuki-yano/kagi-mcp.git
cd kagi-mcp
npm install
npm run build
npm link

Configuration

Environment Variables

  • KAGI_API_KEY (required): Your Kagi API key

  • KAGI_SUMMARIZER_ENGINE (optional): Summarization engine - cecil (default), agnes, daphne, or muriel

Claude Desktop Configuration

Add the following to your Claude Desktop config file:

MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "kagi": {
      "command": "npx",
      "args": ["kagi-mcp"],
      "env": {
        "KAGI_API_KEY": "your-kagi-api-key"
      }
    }
  }
}

This method automatically downloads and runs the latest version from npm without requiring manual installation.

Method 2: Using globally installed package

{
  "mcpServers": {
    "kagi": {
      "command": "kagi-mcp",
      "env": {
        "KAGI_API_KEY": "your-kagi-api-key"
      }
    }
  }
}

Claude Code Configuration

To use with Claude Code CLI, run the following command:

claude mcp add kagi -s user -e KAGI_API_KEY="your-kagi-api-key" -- npx kagi-mcp

This will:

  • Add the Kagi MCP server to your Claude Code configuration

  • Set it up at the user level (-s user)

  • Configure your API key as an environment variable

  • Use npx to automatically download and run the latest version from npm

You can also use the MCP inspector for debugging:

# Method 1: Using npx (requires npm package to be published)
KAGI_API_KEY="your-kagi-api-key" npx @modelcontextprotocol/inspector npx kagi-mcp

# Method 2: Using local installation (more reliable)
npm install -g kagi-mcp
KAGI_API_KEY="your-kagi-api-key" npx @modelcontextprotocol/inspector kagi-mcp

# Method 3: Using source build
KAGI_API_KEY="your-kagi-api-key" npx @modelcontextprotocol/inspector node dist/index.js

Usage

The MCP server provides two tools:

kagi_search_fetch

Search the web using Kagi Search API.

{
  "queries": ["array of search queries"]
}

kagi_summarizer

Summarize content from a URL.

{
  "url": "https://example.com/article",
  "summary_type": "summary" | "takeaway",  // optional
  "target_language": "EN"  // optional
}

Development

# Install dependencies
npm install

# Run in development mode
npm run dev

# Build
npm run build

# Run built version
npm start

Troubleshooting

"Malformed authorization token" error

This error indicates that your API key is invalid or not properly formatted. Make sure:

  • You have a valid Kagi API key from support@kagi.com

  • The key is correctly set in your environment variable

  • You're not adding extra quotes or spaces around the key

"401 Unauthorized" error for Search API

The Search API is in closed beta. You may need to:

  1. Request access to the Search API separately from support@kagi.com

  2. Ensure your API key has the necessary permissions

Testing your API key

You can test your API key using the included test script:

KAGI_API_KEY="your-api-key" node test-api.js

License

MIT

Available Tools

2 tools
kagi_search_fetchA

Fetch web results based on one or more queries using the Kagi Search API. 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.

ParametersJSON Schema
NameRequiredDescriptionDefault
queriesYesOne or more concise, keyword-focused search queries. Include essential context within each query for standalone use.

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It explains that 'Results are from all queries given' and 'They are numbered continuously, so that a user may be able to refer to a result by a specific number,' which adds useful context about result aggregation and numbering. However, it doesn't cover important behavioral aspects like rate limits, authentication needs, pagination, or error handling, leaving significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately concise with three sentences that each serve a distinct purpose: stating the tool's function, providing usage guidelines, and explaining result formatting. It's front-loaded with the core purpose. A slight improvement could be made by combining the last two sentences for even tighter structure.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (search API with result aggregation), no annotations, and no output schema, the description provides adequate but incomplete context. It covers the basic purpose, usage triggers, and result numbering, but lacks details about return format, error cases, rate limits, or how results from multiple queries are integrated. This is minimally viable but has clear gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the 'queries' parameter well-documented in the schema itself. The description doesn't add any meaningful parameter semantics beyond what's already in the schema description ('One or more concise, keyword-focused search queries'). This meets the baseline of 3 when schema coverage is high.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Fetch web results based on one or more queries using the Kagi Search API.' It specifies the verb ('fetch'), resource ('web results'), and method ('Kagi Search API'). However, it doesn't explicitly differentiate from its sibling tool 'kagi_summarizer' beyond the general search focus, which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear usage context: 'Use for general search and when the user explicitly tells you to 'fetch' results/information.' This gives practical guidance on when to invoke the tool. It doesn't explicitly state when NOT to use it or mention alternatives like the sibling summarizer tool, which keeps it from a score of 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

kagi_summarizerB

Summarize content from a URL using the Kagi Summarizer API. The Summarizer can summarize any document type (text webpage, video, audio, etc.)

ParametersJSON Schema
NameRequiredDescriptionDefault
summary_typeNoType of summary to produce. Options are 'summary' for paragraph prose and 'takeaway' for a bulleted list of key points.summary
target_languageNoDesired output language using language codes (e.g., 'EN' for English). If not specified, the document's original language influences the output.
urlYesA URL to a document to summarize.

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the API and document type support, but fails to disclose critical behavioral traits such as rate limits, authentication requirements, error handling, or what the output looks like (e.g., format, length). For a tool with no annotations, this leaves significant gaps in understanding its operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded: two concise sentences that directly state the tool's function and capabilities without unnecessary details. Every sentence earns its place by providing essential information about the tool's purpose and scope.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a summarization tool with no annotations and no output schema, the description is incomplete. It lacks information on output format, error conditions, performance characteristics, and integration details. The description does not compensate for the absence of structured data, leaving the agent with insufficient context for reliable use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all three parameters thoroughly. The description adds no additional parameter semantics beyond what the schema provides (e.g., no examples, edge cases, or usage tips). According to the rules, with high schema coverage, the baseline is 3 even with no param info in the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Summarize content from a URL using the Kagi Summarizer API' with a specific verb ('summarize') and resource ('content from a URL'). It distinguishes from the sibling tool 'kagi_search_fetch' by focusing on summarization rather than search/fetch operations. However, it doesn't explicitly differentiate the API from other summarization tools beyond mentioning Kagi.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides some implied usage context by stating it can 'summarize any document type (text webpage, video, audio, etc.)', which suggests when to use it (for diverse content types). However, it lacks explicit guidance on when to use this tool versus alternatives, prerequisites, or exclusions. No comparison with the sibling tool 'kagi_search_fetch' is provided.

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. 2 tool updatesv1.0.0
    • First observedkagi_search_fetch
    • First observedkagi_summarizer

TDQS

B3.4/5.0

Scored across 2 tools

Disambiguation5/5

The two tools have clearly distinct purposes: one is for fetching search results from queries, and the other is for summarizing content from URLs. There is no overlap in functionality, making it easy for an agent to choose the right tool based on the task.

Naming Consistency5/5

Both tools follow a consistent naming pattern with the prefix 'kagi_' followed by a descriptive verb_noun format (search_fetch and summarizer). This consistency aids in predictability and readability.

Tool Count2/5

With only 2 tools, the server feels thin for a search and summarization domain, as it lacks operations like advanced search filtering, result management, or summarization customization. This minimal set may limit agent workflows.

Completeness2/5

The server covers basic search and summarization but has significant gaps: no tools for updating or deleting search results, handling search history, or managing summarization settings. This incompleteness could lead to agent failures in more complex scenarios.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    C
    quality
    D
    maintenance
    A Node.js implementation that enables Claude to interact with Perplexity AI's language models through Anthropic's Model Context Protocol, providing tools for advanced chat completions and quick queries.
    2
    81 npm
    6
    Apache 2.0
  • A
    license
    B
    quality
    C
    maintenance
    A Model Context Protocol server that enables LLM clients like VSCode, Copilot, and Claude Desktop to search the web using Google Programmable Search Engine API.
    1
    1,172 npm
    12
    Apache 2.0