kimi-code-agent-integration
Skill10 starsChanged todayMITView on GitHub
Use when integrating Kimi Code CLI with external agent tooling (harnesses, adapters, CI wrappers): where its MCP config and skills live, how to run it headless, and what cannot be detected from the environment
In this repository44 other files it gives its agents.
- llms-full.txtllms.txt
- llms.txtllms.txt
- ai-prompt-engineering-safety-reviewSkill
- ast-codemapSkill
- ast-grepSkill
- autoharnessSkill
- autonomous-backlog-driverSkill
- claude-kimi-mcp-normalizationSkill
- cli-self-updaterSkill
- code-frugalitySkill
- codemode-gatewaySkill
- codemode-typesSkill
- consequence-simulationSkill
- context-pruningSkill
- github-update-checkerSkill
- google-agents-cli-evalSkill
- google-agents-cli-scaffoldSkill
- history-searchSkill
- hook-gatingSkill
- hybrid-semantic-searchSkill
- kimi-mcp-configurationSkill
- leann-vectorSkill
- log-summarizerSkill
- markdown-vagueSkill
- memory-reconciliationSkill
- mode-classificationSkill
- multiagent-orchestrationSkill
- output-compressionSkill
- prompt-injectionSkill
- python-anti-patternsSkill
- regression-sentinelSkill
- restart-trackingSkill
- rollback-guardSkill
- rust-call-graphSkill
- secrets-managementSkill
- security-best-practicesSkill
- session-compactorSkill
- sqlite-memorySkill
- swarm-barrierSkill
- swarm-dagSkill
- autoharnessSkill
- code-reliability-checksSkill
- skill-threat-rulesSkill
- autoharnessSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use when a tool must drive, configure, or detect Kimi Code CLI the way it drives other coding agents (Claude Code, Codex, Cursor): writing …
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Kimi Code integration for agent tooling
When to use
Use when a tool must drive, configure, or detect Kimi Code CLI the way it drives other coding agents (Claude Code, Codex, Cursor): writing MCP server entries, installing skills, running a headless review, or deciding how to detect that it runs inside Kimi.
Steps
- Resolve the data root from
KIMI_CODE_HOME, falling back to~/.kimi-code; do not hardcode the fallback, the variable relocates config, sessions and OAuth data together. - MCP config is
{"mcpServers": {...}}JSON: user-global at<data root>/mcp.json, project at.kimi-code/mcp.json(cwd-level; project root is the nearest.gitupward). Some builds also read a project-root.mcp.json(Claude-compatible scope). Entries: stdiocommand(+args,env,cwd), HTTPurl(+headers,bearerTokenEnvVar), legacy SSE needstransport: "sse". AnAuthorization: Bearer ${VAR}header becomesbearerTokenEnvVar: "VAR". - Skills: Kimi scans
.kimi-code/skills/and.agents/skills/at project level,<data root>/skills/and~/.agents/skills/at user level (directory form<name>/SKILL.mdwithnameanddescriptionfrontmatter required, or flat<name>.md). Writing to.agents/skillsserves Codex/agy/Kimi from one copy. - Headless run:
kimi -p "<prompt>"(auto permission, text to stdout,--output-format stream-jsonfor JSONL). It cannot combine with--yolo/--auto/--plan, so a read-only reviewer run is instruction-based: point it at a prompt file and forbid edits. Project-level MCP servers stay disabled in headless runs unless the workspace is trusted (KIMI_CODE_TRUST_WORKSPACE=1for that process, or[workspace] require_trust = false). - Detection: Kimi Code sets no documented env marker for subprocesses and no session-id env var
(hooks receive
session_idvia stdin JSON only) — do not invent aKIMI_*detection variable; rely on an explicit override (e.g.AUTOHARNESS_AGENT=kimi).
How to verify
Confirm a written .kimi-code/mcp.json is accepted by the real CLI: a headless
KIMI_CODE_TRUST_WORKSPACE=1 kimi -p "..." in that directory can see and call the server's
mcp__<server>__* tools. Validate config.toml/tui.toml with kimi doctor; it does not check
mcp.json — parse that JSON separately.
Facts found here
- Measured 2026-11-05 with a stdio probe server: Kimi Code passes the literal
${VAR}inmcp.jsonenv(no expansion), and a stdio server inherits the CLI's environment (a var exported tokimireached the server with noenventry at all). kimi -ploads.kimi-code/mcp.jsonof the cwd and exposesmcp__<server>__*tools when run withKIMI_CODE_TRUST_WORKSPACE=1(project servers stay disabled in headless runs in untrusted folders).kimi -poutput prefixes transcript lines with•; tool progress goes to stderr.kimi doctorvalidates onlyconfig.tomlandtui.toml, notmcp.json.- Reference: https://www.kimi.com/code/docs/en/kimi-code-cli/customization/mcp.html , .../customization/skills.html , .../reference/kimi-command.html
Docs fetched 2026-11-05 from kimi.com/code/docs/en.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

