# Add the KnowMan MCP server to VS Code

Client: VS Code

Add KnowMan to VS Code as a [Command (stdio) server](https://code.visualstudio.com/docs/agent-customization/mcp-servers) launched with `npx -y @knowman/mcp` and a `KNOWMAN_API_KEY` ([KnowMan MCP guide](https://www.knowman.io/guides/mcp-server-knowledge-base)). 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](https://code.visualstudio.com/docs/agent-customization/mcp-servers)). The workspace-root `.mcp.json` destination for team-shared Copilot configuration is offered when `chat.mcp.workspaceRootConfig.enabled` is on ([VS Code docs](https://code.visualstudio.com/docs/agent-customization/mcp-servers)).

## VS Code MCP configuration (servers format)

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

## What you need

The KnowMan MCP server is a standalone stdio server started with `npx -y @knowman/mcp`, which needs [Node 22 or newer](https://www.knowman.io/guides/mcp-server-knowledge-base). VS Code supports [stdio servers](https://www.knowman.io/guides/what-is-an-mcp-server), which communicate through standard input and output ([VS Code docs](https://code.visualstudio.com/docs/agent-customization/mcp-servers)).

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](https://code.visualstudio.com/docs/agent-customization/mcp-servers)).

## 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](https://code.visualstudio.com/docs/agent-customization/mcp-servers)).

Choose Command (stdio) and enter the command and its arguments ([VS Code docs](https://code.visualstudio.com/docs/agent-customization/mcp-servers)). 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](https://code.visualstudio.com/docs/agent-customization/mcp-servers)).

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](https://code.visualstudio.com/docs/agent-customization/mcp-servers)).

## Edit the config file directly

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

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](https://code.visualstudio.com/docs/agent-customization/mcp-servers)).

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](https://code.visualstudio.com/docs/agent-customization/mcp-servers)). For example, ask the agent to run `kb_search`, which searches your [saved items](https://www.knowman.io/guides/how-to-save-articles) by [keyword or meaning](https://www.knowman.io/guides/ai-knowledge-base).

## 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](https://www.knowman.io/guides/personal-knowledge-base). `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](https://code.visualstudio.com/docs/agent-customization/mcp-servers)).

Local MCP servers can run code on your machine, and tools can access external services using your permissions ([VS Code docs](https://code.visualstudio.com/docs/agent-customization/mcp-servers)). 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](https://code.visualstudio.com/docs/agent-customization/mcp-servers)).

## 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](https://github.com/Essatt/knowman-mcp).

## Questions

### 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](https://code.visualstudio.com/docs/agent-customization/mcp-servers).

### 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](https://code.visualstudio.com/docs/agent-customization/mcp-servers)). 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](https://code.visualstudio.com/docs/agent-customization/mcp-servers)).

### 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](https://www.knowman.io/guides/mcp-server-knowledge-base).

### 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](https://code.visualstudio.com/docs/agent-customization/mcp-servers)). 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](https://code.visualstudio.com/docs/agent-customization/mcp-servers)). See the [KnowMan MCP guide](https://www.knowman.io/guides/mcp-server-knowledge-base) for the tools you can call.

## Related pages

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

- [How to Build a Claude Knowledge Base](https://www.knowman.io/guides/claude-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

- [KnowMan MCP server for Zed](https://www.knowman.io/integrations/zed)
- [Connect KnowMan to JetBrains AI Assistant](https://www.knowman.io/integrations/jetbrains)
- [Connect KnowMan to Augment Code](https://www.knowman.io/integrations/augment)

## More for VS Code

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

## Give your VS Code agent your library

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/vscode
