Kimi MCP Server

io.github.x51xxx由 GitHub 账号 x51xxx 发布v0.2.0更新于 Oct 24, 2026

MCP server bridging AI assistants to Moonshot AI Kimi Code CLI for code analysis and review

已验证STDIO仅桌面开发者工具AI 与机器学习

概览

AI 生成的概览

一个本地 stdio MCP 服务器,让助手把 Moonshot AI 的 Kimi Code CLI 当作子代理调用,用于代码分析、审查、头脑风暴和批量任务。

可以做什么
让 Kimi 分析以路径引用的文件,可设置模型、思考模式、输出格式和会话续接,并通过配置文件把其他 MCP 服务器透传给 Kimi,还可用额外目录支持多根项目。运行结构化头脑风暴,支持发散、收敛、SCAMPER、设计思维或横向等模式。按优先级顺序或并行执行原子任务,可设置出错即停,并返回结构化报告。收集 git diff 后审查工作区、分支差异或指定提交的代码改动。列出、删除或清空对话会话,并诊断 CLI 安装、认证和会话状态。
适用场景
适合在支持 MCP 的编辑器或 Claude Desktop 中工作、希望不离开当前界面就能使用第二个编码代理(Kimi)做代码审查、文件分析或构思的用户。也适合已经安装或愿意安装 Kimi Code CLI 的人。
运行要求
以 npm 包 @trishchuk/kimi-mcp-server 通过 stdio 在本地运行,需要 Node.js,并需另行安装 Kimi Code CLI。认证方式为交互式 Kimi 登录或设置 MOONSHOT_API_KEY 环境变量。可选变量 KIMI_MCP_CWD、KIMI_SESSION_TTL_MS 和 KIMI_MAX_SESSIONS 控制工作目录与会话限制。仅限桌面客户端。
安装前请注意
服务器会启动 Kimi CLI,把你的提示和引用的文件内容发送到 Moonshot AI 的服务,避免用于敏感代码。MOONSHOT_API_KEY 是转发给 CLI 的密钥。打印模式会自动批准操作,yolo 和 afk 是审批快捷选项,Kimi 可能不经逐步确认就执行动作。review-changes 会读取 git diff,会话工具可删除或清空会话。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Kimi MCP Server,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Kimi MCP Server

[License: MIT]

MCP server (stdio) that bridges Claude / Cursor / any MCP client to Moonshot AI's Kimi Code CLI.

Architecture mirrors @trishchuk/codex-mcp-tool — same patterns, adapted to Kimi's flag surface (--print, --quiet, -r, --continue, --add-dir, --mcp-config-file, --config).

Why

Kimi K2.6 (April 2026) is a 1T-parameter MoE open-weight model with native agent-swarm orchestration, 262k context, and SWE-Bench Pro on par with GPT-5.5. Kimi Code CLI is the reference agent harness. This server lets MCP-aware editors call Kimi as a sub-agent without leaving their primary interface.

Install

sh
npm install -g @trishchuk/kimi-mcp-server

You also need Kimi Code CLI:

sh
curl -LsSf https://code.kimi.com/install.sh | bash# ORuv tool install --python 3.13 kimi-cli

Then run kimi once and use /login to authenticate via the Kimi Code platform — or set MOONSHOT_API_KEY.

Configure (Claude Desktop / Cursor / Claude Code)

Minimal — working directory is auto-detected from PWD / INIT_CWD / process.cwd(), just like codex-mcp-tool:

json
{  "mcpServers": {    "kimi": {      "command": "kimi-mcp"    }  }}

Pin a specific project root only if your client launches the server from somewhere unrelated:

json
{  "mcpServers": {    "kimi": {      "command": "kimi-mcp",      "env": { "KIMI_MCP_CWD": "/absolute/path/to/your/project" }    }  }}

You can also override per call via the workingDir argument on ask-kimi, or let the server infer it from @path/to/file references in the prompt — same priority chain as codex-mcp-tool: workingDir arg → KIMI_MCP_CWD → PWD → INIT_CWD → @path inference → process.cwd().

Tools

ToolWhat it does
ask-kimiMain entry — file analysis (@path), session resume, MCP passthrough
brainstormStructured ideation (divergent / convergent / SCAMPER / design-thinking / lateral / auto)
batch-kimiSequential or parallel atomic tasks with priority, stop-on-error, structured report
review-changesCode review of working tree / branch diff / specific commit (collects git diff and prompts Kimi)
list-sessionsList, delete, or clear active conversation sessions
healthDiagnose Kimi CLI installation, auth, and session state
ping / Help / versionSmoke tests + help passthrough

ask-kimi highlights

  • prompt — supports @path/to/file to drop file context (Kimi reads via working dir).
  • model — overrides default_model at runtime via --config. Known: kimi-for-coding, kimi-k2-6, kimi-k2-thinking-turbo, kimi-k2-5, kimi-latest.
  • thinking — toggles thinking mode (writes default_thinking into runtime config).
  • outputFormat — text (default) or stream-json (JSONL of assistant + tool messages, parsed transparently).
  • responseMode — clean (default; final assistant text only) or full (tool calls + stderr log + final).
  • sessionId — workspace-isolated session ID (md5 of repo:head:path). The server tracks the native Kimi session ID returned by the CLI and replays it via kimi -r <id>.
  • continueLatest — sets --continue (resume the most recent session in the cwd).
  • mcpConfigFile — passes --mcp-config-file so Kimi can talk to other MCP servers from inside this process.
  • addDirs — repeats --add-dir for multi-root projects.
  • yolo / afk — approval shortcuts (print mode auto-approves anyway, but useful for documentation/logging).

CLI compatibility

FeatureKimi CLI
Print / non-interactive--print (required for MCP); --quiet = --print --output-format text --final-message-only
JSON streaming--output-format=stream-json, --input-format=stream-json
Sessions--continue, --session <id>, -r <id>
Configuration--config-file <path>, --config '<json/toml>'
Workspacespawn cwd + --add-dir <path> (no --cd flag)
MCP passthrough--mcp-config-file or kimi mcp add
Exit codes0 ok, 1 fatal, 75 retryable transient

Environment

VarDefaultPurpose
KIMI_MCP_CWD—Override working directory for every tool call
KIMI_SESSION_TTL_MS86400000 (24h)Session expiration
KIMI_MAX_SESSIONS50Max concurrent sessions
MOONSHOT_API_KEY—Forwarded to Kimi CLI for unattended auth

Development

sh
npm installnpm run build       # tsc → dist/npm run lint        # tsc --noEmitnode dist/index.js  # smoke run on stdio

License

MIT — Taras Trishchuk

来源:README.md,提交 83eee42

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.2.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分