Kimi Coding Search MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add --transport http -H "X-Kimi-Api-Key: sk-kimi-your-key" kimi-coding-search https://kimi-mcp.example.com/mcp
Required:KIMI_API_KEY+ 2 optional
README.md

Wraps Kimi Coding Search and Fetch APIs into MCP tools for web retrieval.

Kimi Coding MCP

Kimi Coding MCP 是一个把 Kimi Coding Search / Fetch 接口封装成 MCP 工具的服务,适合部署到服务器后,以远程 MCP 的方式接入你的客户端。

它提供两个工具:

  • kimi_search:调用 POST https://api.kimi.com/coding/v1/search
  • kimi_fetch:调用 POST https://api.kimi.com/coding/v1/fetch

核心实现是 server.py,容器入口是 Dockerfile

1. 快速开始

安装依赖:

pip install -r requirements.txt

远程模式启动:

python server.py --transport streamable-http --host 0.0.0.0 --port 8000

默认 MCP 地址:

http://127.0.0.1:8000/mcp

如果你部署在带 HTTPS 的域名上,对外地址通常就是:

https://your-domain.com/mcp

2. 工具说明

`kimi_search`

输入参数:

{
  "text_query": "食贫道 最新视频 2025 2026",
  "limit": 10,
  "enable_page_crawling": false,
  "timeout_seconds": 30
}

`kimi_fetch`

输入参数:

{
  "url": "https://search.bilibili.com/all?keyword=食贫道"
}

3. Docker 部署

方式 A:不带代理,直接暴露端口

这种方式适合内网使用、临时测试,或者你已经有其他网关负责对外转发。

构建镜像:

docker build -t kimi-coding-mcp .

单租户模式:

docker run -d \
  --name kimi-coding-mcp \
  -p 8000:8000 \
  -e KIMI_API_KEY=sk-kimi-你的key \
  kimi-coding-mcp

多租户模式:

docker run -d \
  --name kimi-coding-mcp \
  -p 8000:8000 \
  kimi-coding-mcp

部署完成后,对外 MCP 地址通常是:

http://你的服务器IP:8000/mcp

方式 B:带代理,通过 HTTPS 域名访问

这种方式适合公网部署。仓库里已经提供了 compose.yamlCaddyfile

  1. 复制环境变量模板:
cp .env.production.example .env.production
  1. 编辑 .env.production

单租户模式:

KIMI_API_KEY=sk-kimi-你的key
APP_DOMAIN=kimi-mcp.example.com

多租户模式:

KIMI_API_KEY=
APP_DOMAIN=kimi-mcp.example.com
  1. 确保域名已经解析到服务器公网 IP,并放行 80443

  2. 启动:

docker compose up -d --build

部署完成后,对外 MCP 地址通常是:

https://kimi-mcp.example.com/mcp

4. 客户端配置

推荐使用多租户模式,让每个客户端自己携带 Kimi key。

多租户模式:

{
  "mcpServers": {
    "kimi-coding-remote": {
      "type": "streamable_http",
      "url": "https://kimi-mcp.example.com/mcp",
      "headers": {
        "X-Kimi-Api-Key": "sk-kimi-替换成你的key"
      }
    }
  }
}

单租户模式:

{
  "mcpServers": {
    "kimi-coding-remote": {
      "type": "streamable_http",
      "url": "https://kimi-mcp.example.com/mcp"
    }
  }
}

远程模式下,API key 的优先级是:

  1. X-Kimi-Api-Key 请求头
  2. Authorization: Bearer sk-... 请求头
  3. 服务端环境变量 KIMI_API_KEY

5. 环境变量

常用环境变量如下:

KIMI_API_KEY=sk-kimi-你的key
KIMI_BASE_URL=https://api.kimi.com/coding/v1
KIMI_USER_AGENT=KimiCLI/1.24.0
KIMI_MSH_PLATFORM=kimi_cli
KIMI_MSH_VERSION=1.24.0
KIMI_DEVICE_NAME=YOUR-PC
KIMI_DEVICE_MODEL=Windows 11 AMD64
KIMI_OS_VERSION=10.0.26200
KIMI_DEVICE_ID=自定义设备ID
KIMI_LOG_DIR=logs
KIMI_LOG_LEVEL=INFO
KIMI_LOG_MAX_BYTES=5242880
KIMI_LOG_BACKUP_COUNT=3
KIMI_LOG_PREVIEW_BYTES=100
MCP_TRANSPORT=streamable-http
MCP_HOST=0.0.0.0
MCP_PORT=8000
MCP_STREAMABLE_HTTP_PATH=/mcp

如果没有显式设置 KIMI_DEVICE_ID,服务会优先读取 ~/.kimi/device_id;读不到时才会按 device_name 生成一个稳定 UUID。

日志默认写入 logs/server.log,并按大小轮转。日志会记录:

  • 调用的 endpoint
  • 入参预览(默认最多 100 字节)
  • 返回结果预览(默认最多 100 字节)
  • 状态码与耗时

为了安全,api_keyauthorizationtokensecret 等敏感字段会自动脱敏。

本地运行时可以参考 .env.example,带代理的 Docker 部署可以参考 .env.production.example

6. 本地调试

如果你需要本地调试 stdio 模式,可以直接运行:

python server.py --transport stdio

如果你需要本地验证容器:

docker build -t kimi-coding-mcp .
docker run --rm -p 8000:8000 -e KIMI_API_KEY=sk-kimi-你的key kimi-coding-mcp

7. 说明

  • kimi_search 使用 text_querylimitenable_page_crawlingtimeout_seconds 请求搜索接口;如果响应是 JSON,会自动格式化。
  • kimi_fetch 使用 url 请求抓取接口,并默认按 Accept: text/markdown 返回文本。

Tools (2)

kimi_searchPerforms a web search using the Kimi Coding Search API.
kimi_fetchFetches content from a specific URL using the Kimi Coding Fetch API.

Environment Variables

KIMI_API_KEYrequiredThe API key for accessing Kimi services.
KIMI_BASE_URLThe base URL for the Kimi Coding API.
MCP_PORTThe port for the MCP server to listen on.

Configuration

claude_desktop_config.json
{"mcpServers": {"kimi-coding-remote": {"type": "streamable_http", "url": "https://kimi-mcp.example.com/mcp", "headers": {"X-Kimi-Api-Key": "sk-kimi-your-key"}}}}

Try it

Search for the latest updates on the Kimi Coding API documentation.
Fetch the content from this URL: https://example.com/article and summarize it.
Find recent news about AI development in 2025 using Kimi search.
Search for technical tutorials on building MCP servers.

Frequently Asked Questions

What are the key features of Kimi Coding Search?

Provides standardized MCP interfaces for Kimi search and fetch APIs.. Supports both single-tenant and multi-tenant deployment modes.. Includes built-in logging with automatic sensitive data masking.. Supports both stdio and streamable-http transport protocols..

What can I use Kimi Coding Search for?

Enabling LLMs to perform real-time web searches for up-to-date information.. Retrieving and parsing web page content directly into an AI context.. Building a centralized search service for multiple AI clients.. Automating research tasks by chaining search and fetch operations..

How do I install Kimi Coding Search?

Install Kimi Coding Search by running: docker run -d --name kimi-coding-mcp -p 8000:8000 -e KIMI_API_KEY=sk-kimi-your-key kimi-coding-mcp

What MCP clients work with Kimi Coding Search?

Kimi Coding Search works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Kimi Coding Search docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare