Start free
Editors and IDEs

Add the KnowMan MCP server to VS Code

Updated 4 min read

Setup in brief

Add KnowMan to VS Code as a Command (stdio) server launched with npx -y @knowman/mcp and a KNOWMAN_API_KEY (KnowMan MCP guide). VS Code configuration uses a servers object, kept in a workspace .vscode/mcp.json or a user-profile mcp.json, and the guided flow can write the entry for you (VS Code docs). The workspace-root .mcp.json destination for team-shared Copilot configuration is offered when chat.mcp.workspaceRootConfig.enabled is on (VS Code docs).

VS Code MCP configuration (servers format) JSON
{
  "servers": {
    "knowman": {
      "command": "npx",
      "args": ["-y", "@knowman/mcp"],
      "env": {
        "KNOWMAN_API_KEY": "km_..."
      }
    }
  }
}
On this page10 sections
  1. What you need
  2. Add the server with the guided flow
  3. Edit the config file directly
  4. Create a KnowMan API key
  5. Sign in once with knowman login
  6. Verify the install
  7. The six KnowMan tools
  8. Good to know
  9. Use the hosted KnowMan server in VS Code
  10. Questions people ask

What you need

The KnowMan MCP server is a standalone stdio server started with npx -y @knowman/mcp, which needs Node 22 or newer. VS Code supports stdio servers, which communicate through standard input and output (VS Code docs).

You also need a KnowMan API key that starts with km_, or one saved sign-in from knowman login. A server launched by a command needs its runtime installed on the machine that runs it (VS Code docs).

Add the server with the guided flow

Open the Command Palette and run Chat: Open Customizations, then select MCP Servers. Select Add Server (+) in the User or Workspace group. You can also run MCP: Add Server from the Command Palette to start the guided flow (VS Code docs).

Choose Command (stdio) and enter the command and its arguments (VS Code docs). VS Code documents npx -y @playwright/mcp@latest for Playwright; for KnowMan, enter npx -y @knowman/mcp. Enter a server ID, such as knowman, that is not already used in the destination configuration (VS Code docs).

The guided flow offers the workspace-root .mcp.json destination when the chat.mcp.workspaceRootConfig.enabled setting is on. The workspace and user-profile destinations remain available for compatibility and are labeled deprecated (VS Code docs).

Edit the config file directly

Portable files use a top-level mcpServers object, while the VS Code format uses servers (VS Code docs). VS Code keeps workspace configuration at .vscode/mcp.json and user-profile configuration in a file named mcp.json (VS Code docs). The workspace-root .mcp.json file is for team-shared Copilot configuration (VS Code docs).

The snippet on this page uses the VS Code servers format with KnowMan's documented command, arguments, and environment variable. If you have already run knowman login, drop the env block, because the saved credential is shared by the CLI and the MCP server.

Create a KnowMan API key

In the web app, open Settings > Connections > Connect an AI agent and create a key. Keys look like km_.... The server talks to KnowMan's HTTP API with the key as a Bearer token, passed in the KNOWMAN_API_KEY environment variable.

Paste the key into the KNOWMAN_API_KEY value in the config snippet above. If you would rather not keep a key in a config file, use the one-time sign-in described next.

Sign in once with knowman login

Run npx -p @knowman/mcp knowman login once. It signs you in through the browser and saves a credential. The saved credential is shared by the CLI and the MCP server, so after one login the env block in the config can be dropped.

On a headless machine, use the KNOWMAN_API_KEY environment variable instead of the browser flow. The same package also installs the knowman CLI, which includes status and logout commands.

Verify the install

The documented check is to invoke a tool from the agent chat, then expand the tool call in the conversation. Check that the call belongs to the server you added and inspect its returned output (VS Code docs).

A working connection needs a tool from the intended MCP server called in your session, tool output returned without a connection error, and an answer that reflects that output (VS Code docs). For example, ask the agent to run kb_search, which searches your saved items by keyword or meaning.

The six KnowMan tools

The KnowMan MCP server offers six tools. kb_search searches saved items by keyword or meaning and returns titles, URLs and metadata. kb_ask answers a question with citations. kb_get_item returns the readable content of one item.

kb_save saves a URL to the Inbox or Knowledge Base with an optional note. kb_recent lists recent items. kb_memories lists saved claims, decisions and playbooks.

Good to know

KnowMan offers a local stdio MCP server and a hosted server at https://api.knowman.io/mcp for clients that accept remote MCP servers. VS Code also documents an HTTP option for URL-based servers (VS Code docs).

Local MCP servers can run code on your machine, and tools can access external services using your permissions (VS Code docs). The KnowMan server talks to KnowMan's HTTP API with a Bearer key. Portable configurations do not support VS Code input variables or environment files (VS Code docs).

Use the hosted KnowMan server in VS Code

KnowMan also runs as a hosted MCP server at https://api.knowman.io/mcp. In clients that support remote MCP servers, add the server URL and sign in with OAuth on the KnowMan consent page, or use an API key as an Authorization: Bearer header.

For VS Code, use its documented HTTP server setup with the KnowMan server URL. You can also use the local client from the open-source repository.

Questions people ask

Where does VS Code keep MCP server configuration?

User-profile MCP configuration lives in a file named mcp.json, and workspace configuration lives at .vscode/mcp.json. Team-shared Copilot configuration uses a workspace-root .mcp.json file. See the VS Code MCP docs.

Does the config use mcpServers or servers?

Portable files use a top-level mcpServers object, and the VS Code format uses servers (VS Code docs). In the guided flow, the workspace and user-profile destinations are labeled deprecated, and the workspace-root .mcp.json destination appears when chat.mcp.workspaceRootConfig.enabled is on (VS Code docs).

Can I skip the API key?

Yes, if you run npx -p @knowman/mcp knowman login once. The saved credential is shared by the CLI and the MCP server, so the env block can be dropped. See the KnowMan MCP guide.

How do I check the server works?

Invoke a tool in the agent chat, then expand the tool call in the conversation and confirm it belongs to your server (VS Code docs). A working connection needs a tool call from your server, tool output returned without a connection error, and an answer that reflects that output (VS Code docs). See the KnowMan MCP guide for the tools you can call.

Give your VS Code agent your library

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.