KK

kagisearch/kagimcp

开发工具

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

557 stars 51 forks 质量 86 趋势 43MIT

Kagi 搜索及其他工具的官方模型上下文协议(MCP)服务器。

概览

一个由Kagi API支持的MCP服务器。它向兼容MCP的客户端开放搜索和提取工具。 - - 提供网页、新闻、视频、播客和图片搜索,并可选页面提取、滤镜和Kagi镜头。- - 以Markdown格式获取页面的完整内容。 之前的kagi_fastgpt和kagi_summarizer工具已被移除。这两者计划在未来的版本中回归。 我们运行一个托管的MCP服务器——无需安装。指向任何支持HTTP的MCP客户端,并用你的Kagi API密钥进行认证。 OAuth2 还不支持(它在我们的路线图上),所以现在先从仪表盘获取你的 API 密钥,并通过 Bearer HTTP 认证传递。 更喜欢自己运行?请参见本地 uvx 安装的客户端设置,或者在自己的基础设施上自托管 HTTP 服务器。 - KAGI_API_KEY 的 Kagi API 密钥。- UV 用于推荐的 UVX 安装路径。 Codex 将 MCP 配置写入 ~/.codex/config.toml。

概述(AI 翻译)

一个由Kagi API支持的MCP服务器。它向兼容MCP的客户端开放搜索和提取工具。

工具

  • kagi_search_fetch - 网页、新闻、视频、播客和图片搜索,可选页面提取、滤镜和Kagi镜头。
  • kagi_extract - 获取页面的全部内容作为 markdown。

注: 之前的kagi_fastgpt和kagi_summarizer工具已被移除。这两者计划在未来版本中回归。

托管服务器

我们在**https://mcp.kagi.com/mcp**运行一个托管的MCP服务器——无需安装。指向任何支持HTTP的MCP客户端,并用你的Kagi API密钥进行身份验证。

OAuth2 还不支持(它在我们的路线图上),所以目前先从仪表盘获取你的 API 密钥,并通过 Bearer HTTP 认证传递。

用Claude代码的例子:

更喜欢自己运行吗?请参见本地uvx安装客户端设置,或者在自家基础设施上自托管HTTP服务器。

要求

  • Kagi API 密钥在 KAGI_API_KEY 中。
  • uv 推荐的 uvx 安装路径。

安装uv:

Windows:

客户端设置

Codex CLI

Codex 将 MCP 配置写入 ~/.codex/config.toml。

克劳德桌面

先安装UV。

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

README

以下为原文 README 节选,完整内容请查看原文。

Kagi MCP Server

An MCP server backed by the Kagi API. It exposes search and extraction tools to MCP-compatible clients.

Tools

  • kagi_search_fetch - web, news, videos, podcasts, and image search with optional page extracts, filters, and Kagi lenses.
  • kagi_extract - fetch a page’s full content as markdown.

Note: The previous kagi_fastgpt and kagi_summarizer tools have been removed. Both are planned to return in a future release.

Hosted Server

We run a hosted MCP server at https://mcp.kagi.com/mcp — no install required. Point any HTTP-capable MCP client at it and authenticate with your Kagi API key.

OAuth2 isn’t supported yet (it’s on our roadmap), so for now grab your API key from the dashboard and pass it via Bearer HTTP authentication.

Example with Claude Code:

claude mcp add kagi https://mcp.kagi.com/mcp --transport http --header "Authorization: Bearer $(read -sp 'API key: ' k; echo $k)" --scope user

Prefer to run it yourself? See Client Setup for the local uvx install, or Self-Hosting to host the HTTP server on your own infrastructure.

Requirements

  • A Kagi API key in KAGI_API_KEY.
  • uv for the recommended uvx install path.

Install uv:

curl -LsSf https://astral.sh/uv/install.sh | sh

Windows:

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Client Setup

Codex CLI

codex mcp add kagi --env KAGI_API_KEY= -- uvx kagimcp

Codex writes MCP configuration to ~/.codex/config.toml.

Claude Desktop

Install uv first.

MacOS/Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

Windows:

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Then in your Claude Desktop config (found through Settings -> Developer -> Edit Config):

{
  "mcpServers": {
    "kagi": {
      "command": "uvx",
      "args": ["kagimcp"],
      "env": {
        "KAGI_API_KEY": "YOUR_API_KEY_HERE"
      }
    }
  }
}

Claude Code

claude mcp add kagi -e KAGI_API_KEY="YOUR_API_KEY_HERE" -- uvx kagimcp

Smithery

npx -y @smithery/cli install kagimcp --client claude

Kiro

Add to your Kiro MCP config file (~/.kiro/settings/mcp.json for global, or .kiro/settings/mcp.json for project-scoped) using the same mcpServers JSON as Claude Desktop. See the Kiro MCP documentation for more details.

OpenCode

Edit the OpenCode configuration file in ~/.config/opencode/opencode.json and add the following:

{
  "mcp": {
    "kagi": {
      "type": "local",
      "command": ["uvx", "kagimcp"],
      "enabled": true,
      "environment": {
        "KAGI_API_KEY": ""
      }
    }
  }
}
在 GitHub 查看完整 README

安装

uvx kagimcp
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "kagi": { "command": "uvx", "args": ["kagimcp"], "env": { "KAGI_API_KEY": "YOUR_API_KEY_HERE" } } } }