{"id":46278093,"url":"https://github.com/howardpen9/kimi-code-mcp","last_synced_at":"2026-03-09T10:00:39.507Z","repository":{"id":341710198,"uuid":"1171163486","full_name":"howardpen9/kimi-code-mcp","owner":"howardpen9","description":"MCP server for Claude Code × Kimi K2.5 (256K context) — delegate bulk codebase analysis to Kimi, save 90% on token costs. Session caching, parallel agents, TypeScript.","archived":false,"fork":false,"pushed_at":"2026-03-04T03:21:12.000Z","size":559,"stargazers_count":21,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-04T07:29:49.412Z","etag":null,"topics":["ai-agent","ai-coding-assistant","claude-code","code-analysis","developer-tools","kimi","kimi-code","kimi-k2","llm","mcp","mcp-server","model-context-protocol","moonshot-ai","typescript"],"latest_commit_sha":null,"homepage":"https://github.com/howardpen9/kimi-code-mcp#readme","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/howardpen9.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-02T23:57:24.000Z","updated_at":"2026-03-04T03:21:15.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/howardpen9/kimi-code-mcp","commit_stats":null,"previous_names":["howardpen9/kimi-code-mcp"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/howardpen9/kimi-code-mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howardpen9%2Fkimi-code-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howardpen9%2Fkimi-code-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howardpen9%2Fkimi-code-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howardpen9%2Fkimi-code-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/howardpen9","download_url":"https://codeload.github.com/howardpen9/kimi-code-mcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howardpen9%2Fkimi-code-mcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30111779,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T03:40:26.266Z","status":"ssl_error","status_checked_at":"2026-03-05T03:39:15.902Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agent","ai-coding-assistant","claude-code","code-analysis","developer-tools","kimi","kimi-code","kimi-k2","llm","mcp","mcp-server","model-context-protocol","moonshot-ai","typescript"],"created_at":"2026-03-04T05:03:21.935Z","updated_at":"2026-03-05T06:00:44.506Z","avatar_url":"https://github.com/howardpen9.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kimi-code-mcp\n\nEnglish | **[中文說明](README_zh.md)**\n\n---\n\nMCP server that connects [Kimi Code](https://www.kimi.com/code) (K2.5, 256K context) with [Claude Code](https://docs.anthropic.com/en/docs/claude-code) — letting Claude orchestrate while Kimi handles the heavy reading.\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"assets/llm-cost-vs-intelligence.png\" alt=\"LLM Cost vs Intelligence — Kimi K2.5 delivers frontier-level intelligence at a fraction of the cost\" width=\"720\" /\u003e\n  \u003cbr /\u003e\n  \u003csub\u003eKimi K2.5 sits on the efficiency frontier — near-Claude intelligence at 10x lower cost. \u003ca href=\"https://www.kimi.com/code\"\u003ekimi.com/code\u003c/a\u003e\u003c/sub\u003e\n\u003c/div\u003e\n\n\u003e [!TIP]\n\u003e **Stop paying Claude to read files.** Kimi K2.5 delivers frontier-class code intelligence at a fraction of the cost (see chart above). Delegate bulk codebase scanning to Kimi (256K context, near-zero cost) and let Claude focus on what it does best — reasoning, decisions, and precise code edits. One `kimi_analyze` call can replace 50+ file reads.\n\n## What is Kimi Code?\n\n[**Kimi Code**](https://www.kimi.com/code/en) is an AI code agent by Moonshot AI, powered by the **Kimi K2.5** model (1T MoE, 256K context). It works across Terminal, IDE, and CLI — writing, debugging, refactoring, and analyzing code autonomously.\n\nKey specs:\n- **256K token context** — reads entire codebases in one pass\n- **Parallel agent spawning** — handles concurrent tasks\n- **Shell, file, and web access** — full developer toolchain\n- **Install**: `curl -L code.kimi.com/install.sh | bash`\n\n\u003e [!WARNING]\n\u003e **Kimi Code membership required.** This MCP server calls the Kimi CLI under the hood, which requires an active [Kimi Code plan](https://www.kimi.com/code/en). Make sure you have a valid subscription and have run `kimi login` before use.\n\u003e\n\u003e | Plan | Price | Notes |\n\u003e |------|-------|-------|\n\u003e | **Moderato** | **$0** (7-day free trial) | Then $19/mo. Good for trying it out |\n\u003e | **Allegretto** | $39/mo | Recommended — higher weekly quota + concurrency |\n\u003e | **Allegro** | $99/mo | For daily, heavy-duty development |\n\u003e | **Vivace** | $199/mo | Max quota for large codebases |\n\u003e\n\u003e Annual billing saves up to $480. All plans include [Kimi membership benefits](https://www.kimi.com/code/en).\n\n## Quick Start\n\n```bash\n# 1. Install Kimi CLI\nuv tool install kimi-cli \u0026\u0026 kimi login\n\n# 2. Install via npm\nnpm install -g kimi-mcp-server\n```\n\nAdd to `.mcp.json` (project-level or `~/.claude/mcp.json` for global):\n\n```json\n{\n  \"mcpServers\": {\n    \"kimi-code\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"kimi-mcp-server\"]\n    }\n  }\n}\n```\n\nOr build from source:\n\n```bash\ngit clone https://github.com/howardpen9/kimi-code-mcp.git\ncd kimi-code-mcp \u0026\u0026 npm install \u0026\u0026 npm run build\n```\n\n```json\n{\n  \"mcpServers\": {\n    \"kimi-code\": {\n      \"command\": \"node\",\n      \"args\": [\"/absolute/path/to/kimi-code-mcp/dist/index.js\"]\n    }\n  }\n}\n```\n\nRun `/mcp` in Claude Code to verify — you should see `kimi-code` with 4 tools.\n\n## What You Can Do\n\nJust tell Claude what you need. It will delegate to Kimi automatically:\n\n| Prompt | What happens |\n|--------|-------------|\n| \"Analyze this codebase's architecture\" | Kimi reads all files (256K ctx), Claude acts on the report |\n| \"Scan for security vulnerabilities, then review Kimi's findings\" | Kimi audits, Claude cross-examines — AI pair review |\n| \"Map all dependencies of the auth module, then plan the refactoring\" | Kimi builds the dependency graph, Claude plans the changes |\n| \"Review the recent changes for regressions and edge cases\" | Kimi reviews full context (not just the diff), Claude synthesizes |\n| \"Resume the last Kimi session and ask about the API design\" | Kimi retains 256K tokens of context across sessions |\n\n## Why This Exists\n\nClaude Code is powerful but expensive. Every file it reads costs tokens. Meanwhile, many tasks — pre-reviewing large codebases, scanning for patterns, generating audit reports — are **high-certainty work** that doesn't need Claude's full reasoning power.\n\n\u003e [!IMPORTANT]\n\u003e **The cost equation:** Claude reads 50 files to understand your architecture = expensive. Kimi reads 50 files via `kimi_analyze` = near-zero cost. Claude then acts on Kimi's structured report = minimal tokens. **Total savings: 60-80% fewer Claude tokens on analysis-heavy tasks.**\n\n### How It Saves Tokens\n\n```\n                          ┌─────────────────────────────┐\n                          │   You (the developer)       │\n                          └──────────┬──────────────────┘\n                                     │ prompt\n                                     ▼\n                          ┌─────────────────────────────┐\n                          │   Claude Code (conductor)   │\n                          │   - orchestrates workflow    │\n                          │   - makes decisions          │\n                          │   - writes \u0026 edits code      │\n                          └──────┬──────────────┬───────┘\n                      precise    │              │  delegate\n                      edits      │              │  bulk reading\n                      (tokens)   │              │  (FREE)\n                                 ▼              ▼\n                          ┌──────────┐   ┌──────────────┐\n                          │ your     │   │  Kimi Code   │\n                          │ codebase │   │  (K2.5)      │\n                          └──────────┘   │  - 256K ctx  │\n                                         │  - reads all │\n                                         │  - reports   │\n                                         └──────────────┘\n```\n\n1. **Claude** receives your task → decides it needs codebase understanding\n2. **Claude** calls `kimi_analyze` via MCP → Kimi reads the entire codebase (256K context, near-zero cost)\n3. **Kimi** returns a structured analysis\n4. **Claude** acts on the analysis with precise, targeted edits\n\n**Result: Claude only spends tokens on decision-making and code writing, not on reading files.**\n\n### Mutual Code Review with K2.5\n\nKimi Code is powered by K2.5 — a 1T MoE model designed for deep code comprehension. This enables **AI pair review**:\n\n1. **Kimi pre-reviews** — 256K context means it sees the entire codebase at once: security issues, anti-patterns, dead code, architectural problems\n2. **Claude cross-examines** — reviews Kimi's findings, challenges questionable items, adds its own insights\n3. **Two perspectives** — different models catch different things. What one misses, the other finds\n\n## Use Kimi as a Code Reviewer\n\nBeyond ad-hoc analysis, you can use Kimi as a **dedicated reviewer** in your workflow:\n\n### PR Review Workflow\n\n```\n┌──────────────┐   diff    ┌──────────────┐  structured  ┌──────────────┐\n│   Your PR    │ ────────► │  Kimi Code   │  findings    │  Claude Code │\n│  (changes)   │           │  (reviewer)  │ ────────────►│  (decision)  │\n└──────────────┘           └──────────────┘              └──────────────┘\n```\n\n### Continuous Audit Pattern\n\n| When | What | Why |\n|------|------|-----|\n| Before merging | Kimi scans diff + affected modules | Catch regressions early |\n| Weekly | Full codebase sweep | Accumulated tech debt |\n| Pre-release | Security-focused audit | Ship with confidence |\n\nEach review session can be **resumed** (`kimi_resume`) — Kimi retains up to 256K tokens of context from previous sessions, building understanding over time.\n\n### What Kimi Reviews Well\n\n| Review Type | Why Kimi Excels |\n|-------------|----------------|\n| Security audit | 256K context sees full attack surface, not just isolated files |\n| Dead code detection | Can trace imports/exports across entire codebase |\n| API consistency | Compares patterns across all endpoints simultaneously |\n| Dependency analysis | Maps full dependency graph in one pass |\n| Architecture review | Sees the forest and the trees at the same time |\n\n## Tools\n\n| Tool | Description | Timeout |\n|------|-------------|---------|\n| `kimi_analyze` | Deep codebase analysis (architecture, audit, refactoring) | 10 min |\n| `kimi_query` | Quick programming questions, no codebase context | 2 min |\n| `kimi_list_sessions` | List existing Kimi sessions with metadata | instant |\n| `kimi_resume` | Resume a previous session (up to 256K token context) | 10 min |\n\n### Output Control Parameters\n\n`kimi_analyze` and `kimi_resume` support these parameters to control output size:\n\n| Parameter | Values | Default | Effect |\n|-----------|--------|---------|--------|\n| `detail_level` | `summary` / `normal` / `detailed` | `normal` | Controls prompt-side verbosity instructions |\n| `max_output_tokens` | number | `15000` | Hard ceiling — output truncated at clean boundary if exceeded |\n| `include_thinking` | boolean | `false` | Include Kimi's internal reasoning chain (10-30K extra tokens) |\n\n`kimi_query` also supports `max_output_tokens` and `include_thinking`.\n\n## Token Economics\n\n\u003e [!NOTE]\n\u003e The savings come from **compression ratio**, not from free reading. Kimi's subscription cost still applies, but the key benefit is reducing expensive Claude Code token consumption.\n\n```\n                    Without kimi-code-mcp        With kimi-code-mcp (normal)\n                    ─────────────────────        ───────────────────────────\nRaw source:         50 files × ~4K = 200K        Kimi reads (subscription cost)\nClaude reads:       200K tokens                  5-15K token report\nClaude token cost:  $$$                          $\n```\n\n**Compression ratio by `detail_level`:**\n\n| Level | Compression | Output Size | Equivalent Source | Best For |\n|-------|------------|-------------|-------------------|----------|\n| `summary` | 40-100x | ~2-5K tokens | ~8-20K chars / ~200-500 lines of code | Quick orientation, file inventory |\n| `normal` | 15-40x | ~5-15K tokens | ~20-60K chars / ~500-1500 lines of code | Architecture review, dependency mapping |\n| `detailed` | 5-15x | ~15-40K tokens | ~60-160K chars / ~1500-4000 lines of code | Security audit with code snippets |\n\n**When savings happen:**\n- Large codebases (50+ files) — architecture understanding, cross-file scanning\n- Security audits, dead code detection, API consistency checks\n- Pre-review before targeted edits (scan first → edit specific files)\n\n**When to skip and let Claude read directly:**\n- Small codebases (\u003c10 files) — direct reading is faster\n- Single-file modifications — Claude's built-in file reading is sufficient\n- When you need every line of code — `detailed` output approaches raw reading cost\n\n## How It Works\n\n```\n┌──────────────┐  stdio/MCP   ┌──────────────┐  subprocess   ┌──────────────┐\n│  Claude Code │ ◄──────────► │ kimi-code-mcp│ ────────────► │ Kimi CLI     │\n│  (conductor) │              │ (MCP server) │               │ (K2.5, 256K) │\n└──────────────┘              └──────────────┘               └──────────────┘\n```\n\n1. Claude Code calls an MCP tool (e.g., `kimi_analyze`)\n2. This server spawns the `kimi` CLI with the prompt and codebase path\n3. Kimi autonomously reads files, analyzes the code (up to 256K tokens)\n4. The result is parsed from Kimi's JSON output and returned to Claude Code\n5. Claude acts on the structured results — edits, plans, or further analysis\n\n## Advanced Setup\n\nFor development (auto-recompile on changes):\n\n```json\n{\n  \"mcpServers\": {\n    \"kimi-code\": {\n      \"command\": \"npx\",\n      \"args\": [\"tsx\", \"/absolute/path/to/kimi-code-mcp/src/index.ts\"]\n    }\n  }\n}\n```\n\n## npm\n\nPublished as [`kimi-mcp-server`](https://www.npmjs.com/package/kimi-mcp-server) on npm.\n\n```bash\nnpx kimi-mcp-server          # run directly\nnpm install -g kimi-mcp-server # install globally\n```\n\n## Project Structure\n\n```\nsrc/\n├── index.ts           # MCP server setup, tool definitions\n├── kimi-runner.ts     # Spawns kimi CLI, parses output, handles timeouts\n└── session-reader.ts  # Reads Kimi session metadata from ~/.kimi/\n```\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for version history.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhowardpen9%2Fkimi-code-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhowardpen9%2Fkimi-code-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhowardpen9%2Fkimi-code-mcp/lists"}