{
  "markdown": "# Kimi MCP Server\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n\nMCP server (stdio) that bridges Claude / Cursor / any MCP client to **Moonshot AI's [Kimi Code CLI](https://github.com/MoonshotAI/kimi-cli)**.\n\nArchitecture mirrors [`@trishchuk/codex-mcp-tool`](https://github.com/x51xxx/codex-mcp-tool) — same patterns, adapted to Kimi's flag surface (`--print`, `--quiet`, `-r`, `--continue`, `--add-dir`, `--mcp-config-file`, `--config`).\n\n## Why\n\nKimi 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.\n\n## Install\n\n```sh\nnpm install -g @trishchuk/kimi-mcp-server\n```\n\nYou also need Kimi Code CLI:\n\n```sh\ncurl -LsSf https://code.kimi.com/install.sh | bash\n# OR\nuv tool install --python 3.13 kimi-cli\n```\n\nThen run `kimi` once and use `/login` to authenticate via the Kimi Code platform — or set `MOONSHOT_API_KEY`.\n\n## Configure (Claude Desktop / Cursor / Claude Code)\n\nMinimal — working directory is auto-detected from `PWD` / `INIT_CWD` / `process.cwd()`, just like codex-mcp-tool:\n\n```json\n{\n  \"mcpServers\": {\n    \"kimi\": {\n      \"command\": \"kimi-mcp\"\n    }\n  }\n}\n```\n\nPin a specific project root only if your client launches the server from somewhere unrelated:\n\n```json\n{\n  \"mcpServers\": {\n    \"kimi\": {\n      \"command\": \"kimi-mcp\",\n      \"env\": { \"KIMI_MCP_CWD\": \"/absolute/path/to/your/project\" }\n    }\n  }\n}\n```\n\nYou 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()`.\n\n## Tools\n\n| Tool                        | What it does                                                                                       |\n| --------------------------- | -------------------------------------------------------------------------------------------------- |\n| `ask-kimi`                  | Main entry — file analysis (`@path`), session resume, MCP passthrough                              |\n| `brainstorm`                | Structured ideation (divergent / convergent / SCAMPER / design-thinking / lateral / auto)          |\n| `batch-kimi`                | Sequential or parallel atomic tasks with priority, stop-on-error, structured report                |\n| `review-changes`            | Code review of working tree / branch diff / specific commit (collects `git diff` and prompts Kimi) |\n| `list-sessions`             | List, delete, or clear active conversation sessions                                                |\n| `health`                    | Diagnose Kimi CLI installation, auth, and session state                                            |\n| `ping` / `Help` / `version` | Smoke tests + help passthrough                                                                     |\n\n### `ask-kimi` highlights\n\n- `prompt` — supports `@path/to/file` to drop file context (Kimi reads via working dir).\n- `model` — overrides `default_model` at runtime via `--config`. Known: `kimi-for-coding`, `kimi-k2-6`, `kimi-k2-thinking-turbo`, `kimi-k2-5`, `kimi-latest`.\n- `thinking` — toggles thinking mode (writes `default_thinking` into runtime config).\n- `outputFormat` — `text` (default) or `stream-json` (JSONL of assistant + tool messages, parsed transparently).\n- `responseMode` — `clean` (default; final assistant text only) or `full` (tool calls + stderr log + final).\n- `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>`.\n- `continueLatest` — sets `--continue` (resume the most recent session in the cwd).\n- `mcpConfigFile` — passes `--mcp-config-file` so Kimi can talk to other MCP servers from inside this process.\n- `addDirs` — repeats `--add-dir` for multi-root projects.\n- `yolo` / `afk` — approval shortcuts (print mode auto-approves anyway, but useful for documentation/logging).\n\n## CLI compatibility\n\n| Feature                 | Kimi CLI                                                                                      |\n| ----------------------- | --------------------------------------------------------------------------------------------- |\n| Print / non-interactive | `--print` (required for MCP); `--quiet` = `--print --output-format text --final-message-only` |\n| JSON streaming          | `--output-format=stream-json`, `--input-format=stream-json`                                   |\n| Sessions                | `--continue`, `--session <id>`, `-r <id>`                                                     |\n| Configuration           | `--config-file <path>`, `--config '<json/toml>'`                                              |\n| Workspace               | spawn cwd + `--add-dir <path>` (no `--cd` flag)                                               |\n| MCP passthrough         | `--mcp-config-file` or `kimi mcp add`                                                         |\n| Exit codes              | `0` ok, `1` fatal, `75` retryable transient                                                   |\n\n## Environment\n\n| Var                   | Default        | Purpose                                        |\n| --------------------- | -------------- | ---------------------------------------------- |\n| `KIMI_MCP_CWD`        | —              | Override working directory for every tool call |\n| `KIMI_SESSION_TTL_MS` | 86400000 (24h) | Session expiration                             |\n| `KIMI_MAX_SESSIONS`   | 50             | Max concurrent sessions                        |\n| `MOONSHOT_API_KEY`    | —              | Forwarded to Kimi CLI for unattended auth      |\n\n## Development\n\n```sh\nnpm install\nnpm run build       # tsc → dist/\nnpm run lint        # tsc --noEmit\nnode dist/index.js  # smoke run on stdio\n```\n\n## License\n\nMIT — Taras Trishchuk\n",
  "bytes": 6107,
  "sha": "2ea44fd02251f2c1173162b74a7f8af80b5cbf2e1d9772221a9dff5398079fb1",
  "repo_slug": "x51xxx/kimi-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_x51xxx_kimi_mcp_server_831f8296/readme"
}