Skip to main content
Glama
kimi-acp-mcp

kimi-acp-mcp

by TuTouPower

kimi-acp-mcp

License: MIT GitHub

把 Claude Code 通过 MCP 接到本机已登录的 Kimi Code 的桥,走 Moonshot 官方 kimi acp ACP 协议,非逆向。让 Claude Code 把子任务委派给 Kimi 在指定 cwd 自主干活(读写文件、跑命令、多步推理)。

架构

Claude Code (MCP client)
    │ MCP / stdio
    ▼
kimi-acp-mcp (本项目)
    ├─ MCP server  ← 暴露工具:kimi_prompt / kimi_status / kimi_sessions
    └─ ACP client  ← 长驻子进程 spawn `kimi acp`
        │ ACP / stdio
        ▼
    Kimi K2.7 Code (256K 上下文)

完整设计见 docs/blueprint/architecture.md。

Related MCP server: Kimi MCP Server

前置

  • Node ≥ 18

  • 本机已装 Kimi Code CLI 并完成 kimi login(验证:kimi --version 返回版本号)

安装与构建

cd ~/karson_ubuntu/kimi-acp-mcp
npm install
npm run build

配置到 Claude Code

Claude Code 的 MCP 配置在 ~/.claude.json(user scope)或项目根 .mcp.json(project scope),不是 ~/.claude/settings.json。推荐用 claude mcp add CLI(user scope,全局可用):

claude mcp add kimi-acp \
  -e KIMI_BIN=/home/<user>/.kimi-code/bin/kimi \
  -e KIMI_ACP_PERMISSION=readwrite \
  -- node /home/<user>/kimi-acp-mcp/dist/index.js

或在项目根建 .mcp.json:

{
  "mcpServers": {
    "kimi-acp": {
      "command": "node",
      "args": ["/home/<user>/kimi-acp-mcp/dist/index.js"],
      "env": {
        "KIMI_BIN": "/home/<user>/.kimi-code/bin/kimi",
        "KIMI_ACP_PERMISSION": "readwrite"
      }
    }
  }
}

KIMI_BIN 可省略(默认从 PATH 找 kimi)。KIMI_ACP_PERMISSION 可选 readonly / readwrite。

重启 Claude Code 后,/mcp 应能看到 kimi-acp。

详细配置、env 说明、故障排查见 docs/guides/claude-code-setup.md。

配置到 opencode

opencode 1.17+ 也支持,配置位置和键名与 Claude Code 不同:

opencode mcp add kimi-acp \
  --env KIMI_BIN=/home/<user>/.kimi-code/bin/kimi \
  --env KIMI_ACP_PERMISSION=readwrite \
  -- node /home/<user>/kimi-acp-mcp/dist/index.js

写入 ~/.config/opencode/opencode.json 的 mcp 字段。验证:opencode mcp list 应显示 kimi-acp ✓ connected。工具调用以 kimi-acp_kimi_prompt 暴露。

opencode 详细配置(含 Claude Code 与 opencode 格式差异表)见 guide。

测试

npm test                   # 单元 + 集成(默认排除 e2e)
KIMI_ACP_E2E=1 npm test    # e2e(需本机 kimi 已 kimi login;真实消耗 Kimi 配额)

e2e 会真实 spawn kimi acp,让 Kimi 在临时 cwd 创建文件验证全链路。已在本机验证通过。

文档入口

License

MIT

Available Tools

2 tools
kimi_sessionsA

列出桥本地维护的 session(按 newSession/loadSession 顺序),非 ACP session/list。

Inputs: no named parameters.

kimi_statusA

检查 Kimi ACP 子进程与握手状态、活跃 session 数。不消耗 Kimi 配额。返回 {rows: [{label, ok, detail}]} 结构,便于 host 程序化解析。

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools serve entirely different purposes: one lists sessions, the other checks status. There is no overlap in functionality.

    Naming Consistency4/5

    Both tools share the 'kimi_' prefix and follow a noun pattern ('sessions', 'status'), which is consistent. However, the lack of a verb-noun pattern is a minor deviation.

    Tool Count2/5

    With only 2 tools, the server feels too thin for its apparent domain of session management, which typically requires more operations.

    Completeness2/5

    The server provides listing and status checking but lacks essential operations like creating, loading, or deleting sessions, leaving significant gaps.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      F
      maintenance
      The self-hosted MCP bridge between Claude Chat and Claude Code.
      46
      AGPL 3.0
    • F
      license
      Not graded
      quality
      D
      maintenance
      An MCP bridge that enables Claude Code to consult the Kimi AI model in a structured challenge-loop for code review, debugging, and architecture evaluation.
      2
      -
    • A
      license
      A
      quality
      B
      maintenance
      Bridges Claude Code and OpenAI Codex through MCP, allowing cross-harness querying, code review, explanation, and implementation delegation.
      6
      3 npm
      1
      MIT