# Connect KnowMan to Kimi Code CLI

Client: Kimi Code CLI

Add KnowMan as a local stdio [MCP server](https://www.knowman.io/guides/mcp-server-knowledge-base) in Kimi Code CLI using `~/.kimi/mcp.json` and the config below. [Kimi Code CLI reads named servers from an `mcpServers` object](https://moonshotai.github.io/kimi-cli/en/customization/mcp.html), while [KnowMan's server runs with `npx -y @knowman/mcp` and uses a `KNOWMAN_API_KEY`](https://github.com/Essatt/knowman-mcp).

## ~/.kimi/mcp.json

```json
{
  "mcpServers": {
    "knowman": {
      "command": "npx",
      "args": ["-y", "@knowman/mcp"],
      "env": {
        "KNOWMAN_API_KEY": "km_..."
      }
    }
  }
}
```

## Add the local server

Create or edit `~/.kimi/mcp.json`, the documented location for Kimi Code CLI MCP server configuration, and add the JSON above. [Kimi Code CLI uses named entries under `mcpServers`](https://moonshotai.github.io/kimi-cli/en/customization/mcp.html).

The entry uses Kimi's documented local stdio fields, `command`, `args`, and `env`, with KnowMan's package and API key variable. [Kimi Code CLI documents these fields](https://moonshotai.github.io/kimi-cli/en/customization/mcp.html), and [KnowMan documents the package command and `KNOWMAN_API_KEY`](https://github.com/Essatt/knowman-mcp).

## Sign in once with KnowMan

To create the credential, run `npx -p @knowman/mcp knowman login` and complete browser sign-in. [KnowMan documents this one-time login flow and says its saved credential is shared by the CLI and MCP server](https://github.com/Essatt/knowman-mcp).

After login, you can drop the `env` block from the config. Alternatively, create an agent key in KnowMan under Settings > Connections > Connect an AI agent and put it in the `KNOWMAN_API_KEY` environment variable. [KnowMan documents both credential options](https://github.com/Essatt/knowman-mcp).

## Check the connection

Run `kimi mcp test knowman` to check the connection and list the available tools. [Kimi Code CLI documents this command and its connection status, tool count, names, and descriptions](https://moonshotai.github.io/kimi-cli/en/customization/mcp.html).

In a running session, enter `/mcp` to view connected servers and loaded tools. [Kimi Code CLI documents this session command](https://moonshotai.github.io/kimi-cli/en/customization/mcp.html).

## Use KnowMan's six tools

[KnowMan's MCP server exposes six tools](https://github.com/Essatt/knowman-mcp): `kb_search` searches [saved items](https://www.knowman.io/guides/how-to-save-articles), `kb_ask` answers with citations, and `kb_get_item` retrieves one item's readable content.

[The other tools are](https://github.com/Essatt/knowman-mcp) `kb_save` for saving a URL with an optional note, `kb_recent` for [recent items](https://www.knowman.io/guides/personal-knowledge-base), and `kb_memories` for saved claims, decisions, and playbooks.

## KnowMan runs locally

This setup starts KnowMan's standalone [stdio server](https://www.knowman.io/guides/what-is-an-mcp-server) with `npx -y @knowman/mcp`; [the package requires Node 22 or newer](https://github.com/Essatt/knowman-mcp).

KnowMan also provides a hosted remote MCP server at `https://api.knowman.io/mcp` using Streamable HTTP, but this page configures the local stdio option. [KnowMan documents both server modes](https://github.com/Essatt/knowman-mcp).

## MCP tool confirmations

Kimi Code CLI prompts for confirmation for MCP tool calls. [Its documentation says calls are automatically approved in YOLO or AFK mode](https://moonshotai.github.io/kimi-cli/en/customization/mcp.html). For the wider picture of how agents use a personal library, see [knowledge bases for AI agents](https://www.knowman.io/guides/knowledge-base-for-ai-agents).

## Questions

### Where does Kimi Code CLI store MCP configuration?

The documented configuration file is `~/.kimi/mcp.json`, with named servers under `mcpServers`. [See Kimi Code CLI's MCP configuration guide](https://moonshotai.github.io/kimi-cli/en/customization/mcp.html).

### How can I check that KnowMan connected?

Run `kimi mcp test knowman` to check the connection and list available tools. You can also enter `/mcp` in a running session to view connected servers and loaded tools. [These commands are documented by Kimi Code CLI](https://moonshotai.github.io/kimi-cli/en/customization/mcp.html).

### Do MCP tool calls need approval?

Kimi Code CLI prompts for confirmation for MCP tool calls. In YOLO or AFK mode, calls are automatically approved. [See Kimi Code CLI's MCP guide](https://moonshotai.github.io/kimi-cli/en/customization/mcp.html).

### Can I use KnowMan without an API key in the config?

Yes. Run `npx -p @knowman/mcp knowman login` and complete browser sign-in; the saved credential is shared with the MCP server. [KnowMan documents this login method](https://github.com/Essatt/knowman-mcp).

## Related pages

- [Connect your knowledge base through KnowMan's MCP server](https://www.knowman.io/guides/mcp-server-knowledge-base)

- [What Is a Knowledge Base for AI Agents?](https://www.knowman.io/guides/knowledge-base-for-ai-agents)

- [How Do You Connect AI to Your Notes?](https://www.knowman.io/guides/connect-any-ai-to-your-notes)

## More in this topic

- [Connect KnowMan to Claude Code](https://www.knowman.io/integrations/claude-code)
- [KnowMan MCP server for Msty](https://www.knowman.io/integrations/msty)
- [Add the KnowMan MCP server to OpenHands](https://www.knowman.io/integrations/openhands)

## Give your coding assistant useful context

Try KnowMan Pro for 14 days with no credit card. [Create your account](https://app.knowman.io/signup)

[Start free](https://app.knowman.io/signup)

Every new account starts with 14 days of Pro. No credit card.

Source: https://www.knowman.io/integrations/kimi-code-cli
