Start free
Terminal and CLI agents

KnowMan MCP server for Qwen Code

Updated 3 min read

Setup in brief

Add KnowMan under the mcpServers key in Qwen Code's settings.json, using npx to start the local @knowman/mcp stdio server. Sign in 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_..."
      }
    }
  }
}
On this page9 sections
  1. Where to add the KnowMan server
  2. Use Qwen Code's stdio format
  3. Add the configuration
  4. Sign in once with knowman login
  5. Create a key when needed
  6. Verify the connection
  7. KnowMan's six MCP tools
  8. Troubleshoot a disconnected server
  9. Questions people ask

Where to add the KnowMan server

Qwen Code reads MCP servers 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.

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 started with npx -y @knowman/mcp, so it fits this format. See Qwen Code MCP documentation and the KnowMan MCP guide.

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.

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.

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.

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.

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, 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.

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.

Questions people ask

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 and the KnowMan MCP guide.

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.

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.

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.

Give Qwen Code your saved knowledge

Try KnowMan Pro for 14 days with no credit card. Create your account

Start free

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