CK

czottmann/kagi-ken-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

42 stars 7 forks 质量 71 趋势 0MIT

czottmann/kagi-ken-mcp 是从 https://github.com/czottmann/kagi-ken-mcp. 导入的 MCP 服务器候选

概览

czottmann/kagi-ken-mcp 是从 https://github.com/czottmann/kagi-ken-mcp. 导入的 MCP 服务器候选

概述(AI 翻译)

一个围绕kagi-ken包的轻量级Node MCP服务器,利用Kagi会话令牌访问 Kagi.com 服务:

  • 搜索:搜索加木
  • 摘要器:使用Kagi的摘要工具从URL或文本内容生成摘要

与需要访问API的官方Kagi API不同,这个MCP服务器利用您现有的Kagi会话访问搜索和摘要功能。

“Kagi-ken”是“Kagi”(服务)和_“token”_的合成词。

为什么?

Kagi API 需要单独的 API 密钥,目前仅限邀请者使用。如果你已经有 Kagi 订阅但没有 API 访问权限,但想通过 LLM 或代理(如 Claude)程序访问 Kagi 的服务,这个 MCP 服务器提供了替代方案。

特色

  • 搜索:利用带有并发查询处理的Kagi搜索获取网页结果
  • 摘要:从可自定义输出类型和语言的URL中总结内容

服务器支持两种使用 Kagi 会话令牌的方法(参见安装),顺序如下:

  1. KAGI_SESSION_TOKEN 环境变量
  2. ~/.kagi_session_token 文件,包含令牌字符串

它包含全面的错误处理:

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 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.

{
  "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

在 GitHub 查看完整 README

安装

npx -y github:czottmann/kagi-ken-mcp
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "kagi-ken-mcp": { "command": "npx", "args": ["-y", "github:czottmann/kagi-ken-mcp"] } } }