# KnowMan MCP server for Qwen Code

Client: Qwen Code

Add KnowMan under the `mcpServers` key in Qwen Code's `settings.json`, using `npx` to start the local `@knowman/mcp` [stdio server](https://www.knowman.io/guides/what-is-an-mcp-server). [Sign in](https://www.knowman.io/guides/personal-knowledge-base) once with `knowman login`, or add a `KNOWMAN_API_KEY`, then restart Qwen Code and confirm the server is connected.

## Qwen Code settings.json

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

## Where to add the KnowMan server

Qwen Code reads [MCP servers](https://www.knowman.io/guides/mcp-server-knowledge-base) from the `mcpServers` key in `settings.json`. Use `~/.qwen/settings.json` for user scope, which applies across projects, or `.qwen/settings.json` in the project root for project scope. Editing the file and using `qwen mcp` commands produce the same entries, according to the [Qwen Code MCP documentation](https://qwenlm.github.io/qwen-code-docs/en/users/features/mcp/).

## Use Qwen Code's stdio format

Qwen Code supports `stdio`, `sse`, and `http` transports. Its stdio transport runs local processes such as scripts and CLIs, and accepts `command`, `args`, optional `cwd`, and optional `env` values. The KnowMan MCP server is a [local stdio server](https://www.knowman.io/guides/what-is-an-mcp-server) started with `npx -y @knowman/mcp`, so it fits this format. See [Qwen Code MCP documentation](https://qwenlm.github.io/qwen-code-docs/en/users/features/mcp/) and the [KnowMan MCP guide](https://www.knowman.io/guides/mcp-server-knowledge-base).

## Add the configuration

Add the `knowman` entry shown in the configuration above to `mcpServers` in the Qwen Code settings file you want to use. Keep the placeholder as `km_...` until you replace it with a key. Qwen Code environment values can also reference shell variables with `$VAR_NAME` or `${VAR_NAME}`, as documented by [Qwen Code](https://qwenlm.github.io/qwen-code-docs/en/users/features/mcp/).

## Sign in once with knowman login

Run `npx -p @knowman/mcp knowman login` and approve access in the browser. The saved credential is shared by the KnowMan CLI and MCP server, so you can remove the `env` block afterward. On Windows, stored credentials are not supported yet, so set `KNOWMAN_API_KEY` instead. See the [KnowMan MCP guide](https://www.knowman.io/guides/mcp-server-knowledge-base).

## Create a key when needed

To use an environment key, open the KnowMan web app and go to **Settings → Connections → Connect an AI agent**. Create an agent key, then place it in the `env` block as `KNOWMAN_API_KEY`. Keys start with `km_` and are shown once. See the [KnowMan MCP guide](https://www.knowman.io/guides/mcp-server-knowledge-base).

## Verify the connection

Restart Qwen Code in the same project if it was already running when you added the server. Open the `/mcp` dialog to inspect MCP servers and manage authentication. You can also watch the MCP status pill in the bottom-right, which shows how many servers are ready while discovery runs. See [Qwen Code MCP documentation](https://qwenlm.github.io/qwen-code-docs/en/users/features/mcp/).

## KnowMan's six MCP tools

KnowMan exposes `kb_search`, `kb_ask`, `kb_get_item`, `kb_save`, `kb_recent`, and `kb_memories`. They search [saved items](https://www.knowman.io/guides/how-to-save-articles), answer questions with citations, read one item, save a URL, list recent items, and list saved claims, decisions, and playbooks. Tool behavior is documented in the [KnowMan MCP guide](https://www.knowman.io/guides/mcp-server-knowledge-base).

## Troubleshoot a disconnected server

If the server appears disconnected in `qwen mcp list`, verify the command and increase the timeout. If a stdio server fails to start, use an absolute command path and check `cwd` and `env`. Qwen Code's default discovery timeout for stdio servers is 30 seconds. See [Qwen Code MCP documentation](https://qwenlm.github.io/qwen-code-docs/en/users/features/mcp/).

## Questions

### Does Qwen Code support a local stdio MCP server?

Yes. Qwen Code supports stdio, sse, and http, and stdio runs local processes such as scripts and CLIs. The KnowMan MCP server is a local stdio server. See [Qwen Code MCP documentation](https://qwenlm.github.io/qwen-code-docs/en/users/features/mcp/) and the [KnowMan MCP guide](https://www.knowman.io/guides/mcp-server-knowledge-base).

### Should I keep KNOWMAN_API_KEY after running knowman login?

No. After `knowman login`, the saved credential is shared by the CLI and MCP server, so the `env` block can be dropped. Windows does not support stored credentials yet, so use `KNOWMAN_API_KEY` there. See the [KnowMan MCP guide](https://www.knowman.io/guides/mcp-server-knowledge-base).

### How do I check whether KnowMan is connected in Qwen Code?

Open the `/mcp` dialog to inspect MCP servers and manage authentication. The status pill in the bottom-right shows how many MCP servers are ready while discovery is in progress. See [Qwen Code MCP documentation](https://qwenlm.github.io/qwen-code-docs/en/users/features/mcp/).

### What can Qwen Code do with the KnowMan MCP server?

Qwen Code can use `kb_search`, `kb_ask`, `kb_get_item`, `kb_save`, `kb_recent`, and `kb_memories`. These cover search, cited answers, item reading, saving, recent items, and saved memories. See the [KnowMan MCP guide](https://www.knowman.io/guides/mcp-server-knowledge-base).

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

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

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

- [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 Warp](https://www.knowman.io/integrations/warp)
- [Add the KnowMan MCP server to Grok Build](https://www.knowman.io/integrations/grok)
- [Connect Claude to your knowledge base](https://www.knowman.io/integrations/connect-claude-ai-to-your-knowledge-base)

## More for Qwen Code

- [How to give Qwen Code better memory](https://www.knowman.io/guides/qwen-code-memory)
- [How to teach Qwen Code your knowledge](https://www.knowman.io/guides/teach-qwen-code-your-knowledge)

## Give Qwen Code your saved knowledge

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/qwen-code
