# Add the KnowMan MCP server to Devin CLI

Client: Devin CLI

Devin CLI runs local [MCP servers](https://www.knowman.io/guides/mcp-server-knowledge-base) over stdio, so you can add KnowMan with `devin mcp add knowman -- npx -y @knowman/mcp`, saved to local scope by default, or by editing an MCP config file ([Devin CLI docs](https://docs.devin.ai/cli/extensibility/mcp/configuration.md)). The KnowMan server is the `@knowman/mcp` package on Node 22 or newer, and it authenticates with a `KNOWMAN_API_KEY` created in the web app, or with one `knowman login` run after which no key sits in the config (KnowMan guide).

## .devin/mcp_config.local.json (default local scope)

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

```

## What you need

You need Devin CLI with MCP support, Node 22 or newer, and a KnowMan account (KnowMan guide). Devin CLI supports two kinds of MCP servers, a local command over stdio or a remote server over HTTP ([Devin CLI docs](https://docs.devin.ai/cli/extensibility/mcp/configuration.md)). The KnowMan MCP server is a local [stdio server](https://www.knowman.io/guides/what-is-an-mcp-server), so it uses the local command form (KnowMan guide).

Create a key in the KnowMan web app under Settings > Connections > Connect an AI agent; keys look like `km_...` (KnowMan guide). Or skip the key entirely and [sign in](https://www.knowman.io/guides/personal-knowledge-base) with `knowman login`, covered below (KnowMan guide).

## Add the server with devin mcp add

Run `devin mcp add knowman -- npx -y @knowman/mcp`. Trailing arguments after `--` imply the stdio transport, so Devin treats this as a local command ([Devin CLI docs](https://docs.devin.ai/cli/extensibility/mcp/configuration.md)).

By default the entry is saved to local scope, `.devin/mcp_config.local.json`, which is gitignored ([Devin CLI docs](https://docs.devin.ai/cli/extensibility/mcp/configuration.md)). `devin mcp add -s project` shares the entry with a team through `.devin/mcp_config.json` via version control, so keep the API key out of a shared file ([Devin CLI docs](https://docs.devin.ai/cli/extensibility/mcp/configuration.md)).

To authenticate, run `npx -p @knowman/mcp knowman login` once, or set `KNOWMAN_API_KEY` in the config file entry as shown next (KnowMan guide).

## Or write the MCP config file directly

Devin CLI reads server definitions from a `mcpServers` section in JSON config files ([Devin CLI docs](https://docs.devin.ai/cli/extensibility/mcp/configuration.md)). A stdio entry needs `command`; `args` and `env` are optional ([Devin CLI docs](https://docs.devin.ai/cli/extensibility/mcp/configuration.md)). Since v3000.3 these live in dedicated files: `.devin/mcp_config.local.json` for local scope, `.devin/mcp_config.json` for project scope, and `~/.config/devin/mcp_config.json`, or `%APPDATA%\devin\mcp_config.json` on Windows, for user scope ([Devin CLI docs](https://docs.devin.ai/cli/extensibility/mcp/configuration.md)).

Paste the config at the top of this page into `.devin/mcp_config.local.json`. Devin advises never committing API keys and using the local, gitignored file for sensitive values ([Devin CLI docs](https://docs.devin.ai/cli/extensibility/mcp/configuration.md)). If you already ran `knowman login`, drop the `env` block; the server picks up the saved credential (KnowMan guide).

On versions older than v3000.3, MCP servers sat under `mcpServers` in the main config files. Devin migrates those entries to the dedicated files automatically on startup ([Devin CLI docs](https://docs.devin.ai/cli/extensibility/mcp/configuration.md)).

## Sign in once with knowman login

Run `npx -p @knowman/mcp knowman login` once. A browser opens for sign-in, and the saved credential is shared by the CLI and the MCP server, so the `env` block in the config can be dropped (KnowMan guide).

Check the state with `npx -p @knowman/mcp knowman status`. The same package installs the `knowman` CLI, which includes `kb-search`, `ask`, `save`, `recent`, `memories`, `login`, `status` and `logout` (KnowMan guide).

## Verify the setup

Run `devin mcp list` to see configured servers and `devin mcp get knowman` for details on the entry ([Devin CLI docs](https://docs.devin.ai/cli/extensibility/mcp/configuration.md)). The server may need a moment to initialize ([Devin CLI docs](https://docs.devin.ai/cli/extensibility/mcp/configuration.md)).

Then ask the Devin agent to list MCP servers and tools, as Devin's docs suggest ([Devin CLI docs](https://docs.devin.ai/cli/extensibility/mcp/configuration.md)). You should see six tools whose names start with `kb_` (KnowMan guide).

## The six tools KnowMan exposes

Once connected, the agent can call these tools against your KnowMan library (KnowMan guide):
- `kb_search`: search [saved items](https://www.knowman.io/guides/how-to-save-articles) by [keyword or meaning](https://www.knowman.io/guides/ai-knowledge-base), returning titles, URLs and metadata.
- `kb_ask`: ask a question and get an answer with citations.
- `kb_get_item`: fetch the readable content of one saved item.
- `kb_save`: save a URL to the Inbox or the Knowledge Base, with an optional note.
- `kb_recent`: list recently saved items.
- `kb_memories`: list saved claims, decisions and playbooks.

For a wider view of what this enables, see an MCP server for a knowledge base and [knowledge bases for AI agents](https://www.knowman.io/guides/knowledge-base-for-ai-agents).

## If the tools do not appear

Wait a moment first, since Devin notes a server may need time to initialize ([Devin CLI docs](https://docs.devin.ai/cli/extensibility/mcp/configuration.md)). If tools still do not appear, ask the agent to list MCP servers and tools ([Devin CLI docs](https://docs.devin.ai/cli/extensibility/mcp/configuration.md)).

Devin's docs also suggest verifying the command works outside Devin CLI and checking required environment variables ([Devin CLI docs](https://docs.devin.ai/cli/extensibility/mcp/configuration.md)). For KnowMan, the server talks to KnowMan's HTTP API with a Bearer key from `KNOWMAN_API_KEY`, or uses the credential saved by `knowman login` (KnowMan guide).

In a managed workspace, a configured server can be blocked when MCP is disabled for your team, or when it is not on the team allowlist or in an enforced MCP registry ([Devin CLI docs](https://docs.devin.ai/cli/extensibility/mcp/configuration.md)).

## Use the hosted KnowMan server in Devin CLI

KnowMan also runs as a hosted remote MCP server at https://api.knowman.io/mcp over Streamable HTTP, so you can skip the local Node process. You need a KnowMan account at https://app.knowman.io. The open-source local client remains available at https://github.com/Essatt/knowman-mcp.

In clients that support remote MCP servers, you add the server URL https://api.knowman.io/mcp and sign in. With OAuth, the client opens a KnowMan consent page where you approve the knowman.read and knowman.write scopes; access tokens last one hour and refresh automatically.

Alternatively, create an API key in your KnowMan settings and send it as an `Authorization: Bearer <key>` header. Devin CLI accepts remote HTTP servers, so either path can replace the local `npx -y @knowman/mcp` setup used in this guide.

## Questions

### Which file does Devin CLI save MCP servers in?

By default `devin mcp add` writes to local scope, `.devin/mcp_config.local.json`, which is gitignored. Project scope uses `.devin/mcp_config.json`, and user scope uses `~/.config/devin/mcp_config.json`, or `%APPDATA%\devin\mcp_config.json` on Windows. See [Devin CLI docs](https://docs.devin.ai/cli/extensibility/mcp/configuration.md).

### Do I need to restart Devin CLI after adding the server?

Devin's documentation states no restart step. It only notes that a server may need a moment to initialize. See [Devin CLI docs](https://docs.devin.ai/cli/extensibility/mcp/configuration.md).

### Can I put the KnowMan API key in a shared project config?

Devin advises never committing API keys or secrets and recommends `.devin/mcp_config.local.json` for sensitive values, so keep the key out of shared project configs ([Devin CLI docs](https://docs.devin.ai/cli/extensibility/mcp/configuration.md)). A cleaner route is `knowman login`, after which the config needs no key at all (KnowMan guide).

### Why a local command and not a URL?

Devin CLI supports local stdio commands and remote HTTP servers ([Devin CLI docs](https://docs.devin.ai/cli/extensibility/mcp/configuration.md)). The KnowMan MCP server runs locally with `npx -y @knowman/mcp` and as a hosted remote server at https://api.knowman.io/mcp, so it fits both local and remote client setups (KnowMan guide).

## 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)

- [Give Claude Code a knowledge base built from your reading](https://www.knowman.io/guides/claude-code-knowledge-base)

- [Persistent Memory for AI Agents](https://www.knowman.io/guides/persistent-memory-for-ai-agents)

- [How to Give Your AI Context from What You Read](https://www.knowman.io/guides/give-your-ai-context)

## More in this topic

- [KnowMan MCP server for OpenCode](https://www.knowman.io/integrations/opencode)
- [Connect KnowMan to OpenClaw](https://www.knowman.io/integrations/openclaw)
- [KnowMan MCP server for Qwen Code](https://www.knowman.io/integrations/qwen-code)

## More for Devin CLI

- [How to give Devin CLI better memory](https://www.knowman.io/guides/devin-cli-memory)
- [How to teach Devin CLI your knowledge](https://www.knowman.io/guides/teach-devin-cli-your-knowledge)

## Bring your reading into the loop

Try [KnowMan Pro free for 14 days](https://app.knowman.io/signup), no credit card.

[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/devin-cli
