Kimi Code CLI

How do I give Kimi Code CLI my project's rules and fixes with cachly?

You fixed a bug with Kimi Code CLI yesterday. Today you start a new session, and the agent knows nothing about that fix. cachly keeps your project's rules, decisions and fixes and gives them to every AI tool through MCP, so you explain them once.

Kimi Code CLI is a client for the Model Context Protocol (MCP), so cachly connects as an MCP server. This page shows the two ways to set it up and what we checked.

The short answer

Add a cachly entry to ~/.kimi-code/mcp.json. Then start kimi and type /mcp. The server should show as connected, with its tools.

This page is about Kimi Code CLI (npm package @moonshot-ai/kimi-code, repository MoonshotAI/kimi-code). The older Python kimi-cli is archived. Its README says it gets no more updates and points to Kimi Code CLI.

Kimi Code CLI 2.8.0 has no kimi mcp add command. You edit mcp.json or use /mcp-config inside the program.

Option 1: the remote endpoint

Nothing to install. Kimi Code CLI connects to cachly's hosted MCP server. Put this into ~/.kimi-code/mcp.json (for all projects) or .kimi-code/mcp.json in a project:

~/.kimi-code/mcp.json
{
  "mcpServers": {
    "cachly": {
      "url": "https://mcp.cachly.dev/mcp"
    }
  }
}

Listing the tools needs no sign-in. Calling them does. Kimi Code CLI documents /mcp-config login cachly for browser-based OAuth sign-in. We did not run that step. More on the remote endpoint and which Brain opens.

Option 2: the local server

Kimi Code CLI starts the cachly MCP server itself with npx. Node.js must be on your PATH. The first start downloads the package.

~/.kimi-code/mcp.json
{
  "mcpServers": {
    "cachly": {
      "command": "npx",
      "args": ["-y", "@cachly-dev/mcp-server@latest"]
    }
  }
}

The local server reads your key from the environment or from ~/.cachly/credentials.json. Run npx @cachly-dev/mcp-server@latest setup once to sign in and write that file. Nothing then goes into mcp.json, so no key ends up in a project that you commit.

Check the connection

  1. Start kimi in a project folder. If you used a project-level .kimi-code/mcp.json, Kimi asks you to trust the folder first. It shows the command or URL it would start.
  2. Type /mcp. You should see one line per server:
    /mcp (remote, then local)
    cachly  connected  http   27 tools
    cachly  connected  stdio  27 tools
  3. If the line says failed, check the URL, or run npx -y @cachly-dev/mcp-server@latest in a terminal to see the error.

Kimi Code CLI reads mcp.json when a session starts. A server you add while a session is open joins only later sessions.

What we tested

On 26 November 2026, on Windows 11 with Node.js 22.16, we installed Kimi Code CLI 2.8.0 from the npm package and wrote both files above. Both showed connected with 27 tools. The remote endpoint lists the same 27 tools to a plain request without sign-in.

We have no Kimi account, so no model call was made. We did not test that the model picks the cachly tools, the OAuth sign-in, or saving and recalling a lesson. cachly's automatic hooks exist for Claude Code and Cursor, not for Kimi Code CLI. Here the agent uses smart_recall and learn_from_attempts only when it decides to, or when you ask it to.

Sources

More: cachly with Qwen Code · GLM or DeepSeek in Claude Code · Remote MCP · All docs