# Add the KnowMan MCP server to Grok Build

Client: Grok Build

Add the KnowMan MCP server to Grok Build with `grok mcp add knowman -- npx -y @knowman/mcp`, or with one [mcp_servers.knowman] block in ~/.grok/config.toml ([Grok Build docs](https://docs.x.ai/build/features/mcp-servers.md)). The server is the stdio package @knowman/mcp, needs Node 22 or newer, and authenticates with a Bearer key in KNOWMAN_API_KEY, or with one `knowman login` ([KnowMan MCP guide](https://www.knowman.io/guides/mcp-server-knowledge-base)). Run `grok mcp list` to confirm it loaded ([Grok Build docs](https://docs.x.ai/build/features/mcp-servers.md)).

## ~/.grok/config.toml, user-level entry for KnowMan

```toml
[mcp_servers.knowman]
command = "npx"
args = ["-y", "@knowman/mcp"]
# km_... below is a placeholder; replace it with your actual key, created at Settings > Connections > Connect an AI agent
env = { KNOWMAN_API_KEY = "km_..." }
```

## Add the server with grok mcp add

Grok Build adds a local stdio MCP server with `grok mcp add <name> -- <command>` ([Grok Build docs](https://docs.x.ai/build/features/mcp-servers.md)). For KnowMan, run `grok mcp add knowman -- npx -y @knowman/mcp`; the package is @knowman/mcp and needs Node 22 or newer.

For the API key, the server expects a Bearer key in the environment variable KNOWMAN_API_KEY, so add the env line from the config block above with your actual key. You can instead run `npx -p @knowman/mcp knowman login` once and drop the env entry entirely.

## Or declare it in ~/.grok/config.toml

User-level MCP servers for Grok Build are declared directly in ~/.grok/config.toml ([Grok Build docs](https://docs.x.ai/build/features/mcp-servers.md)). A [stdio server](https://www.knowman.io/guides/what-is-an-mcp-server) is declared under [mcp_servers.<name>] with command and args keys, and an env key carries environment variables ([Grok Build docs](https://docs.x.ai/build/features/mcp-servers.md)). The entry also supports startup_timeout_sec and tool_timeout_sec keys ([Grok Build docs](https://docs.x.ai/build/features/mcp-servers.md)). Grok notes that cold-start npx servers that download packages on first launch may need a higher startup_timeout_sec ([Grok Build docs](https://docs.x.ai/build/features/mcp-servers.md)).

Grok expands ${VAR} and ${VAR:-default} in url, command, args, env and headers ([Grok Build docs](https://docs.x.ai/build/features/mcp-servers.md)). For a repo-scoped server, pass --scope project to grok mcp add, which writes .grok/config.toml in the current directory ([Grok Build docs](https://docs.x.ai/build/features/mcp-servers.md)). Grok reads each .grok/config.toml from the current directory up to the git root, and a project server with the same name as a user server replaces it entirely ([Grok Build docs](https://docs.x.ai/build/features/mcp-servers.md)).

## Create a key, or sign in once with knowman login

KnowMan's MCP server talks to KnowMan's HTTP API with a Bearer key in the environment variable KNOWMAN_API_KEY. You can create a key in the web app at Settings > Connections > Connect an AI agent, and keys look like km_....

Or run `npx -p @knowman/mcp knowman login` once, which opens a browser sign-in. The saved credential is shared by the CLI and the MCP server, so the env entry can be dropped from config.toml.

## Verify the connection

`grok mcp list` shows configured servers, and `grok mcp doctor knowman` diagnoses configuration and connectivity ([Grok Build docs](https://docs.x.ai/build/features/mcp-servers.md)). `grok inspect` shows every loaded server and its origin, which matters because Grok also loads configs from ~/.claude.json, .cursor/mcp.json and project .mcp.json files, merged below config.toml in priority ([Grok Build docs](https://docs.x.ai/build/features/mcp-servers.md)). If you already run [KnowMan in Cursor](https://www.knowman.io/integrations/cursor) or [Claude Code](https://www.knowman.io/integrations/claude-code), inspect shows whether Grok picked it up.

In the TUI, /mcps opens the MCP tab of the extensions modal: toggle a server with Space, and refresh after config edits with r ([Grok Build docs](https://docs.x.ai/build/features/mcp-servers.md)). Then ask Grok to use `kb_search`, which searches saved items by [keyword or meaning](https://www.knowman.io/guides/ai-knowledge-base).

## If the server does not start

First check Node: the server needs Node 22 or newer. Grok notes that cold-start npx servers that download packages on first launch may need a higher startup_timeout_sec ([Grok Build docs](https://docs.x.ai/build/features/mcp-servers.md)). For stdio servers that start but fail to connect, Grok captures stderr to ~/.grok/logs/mcp/<server>.stderr.log, knowman.stderr.log in this case ([Grok Build docs](https://docs.x.ai/build/features/mcp-servers.md)).

Run `grok mcp doctor knowman` to diagnose configuration and connectivity ([Grok Build docs](https://docs.x.ai/build/features/mcp-servers.md)).

## The six tools KnowMan exposes

Once connected, Grok can call six tools. `kb_search` searches [saved items](https://www.knowman.io/guides/how-to-save-articles) 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 the 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.

## Grok Build and Grok Bot are different

This page covers Grok Build, used through the grok command and its TUI. [Grok Bot](https://www.knowman.io/integrations/grok-bot), the chat assistant, is a different product. KnowMan cannot be used in Grok Bot: the bot cannot reach your laptop, so it cannot use a server running on your machine ([Composio guide](https://composio.dev/content/how-to-add-mcp-servers-to-grok-bot)).

KnowMan runs locally with `npx -y @knowman/mcp` and as a hosted server at https://api.knowman.io/mcp with OAuth sign-in or an API key. Use the Grok Build steps on this page for either setup.

## Why connect a knowledge base to Grok

KnowMan [saves articles and links](https://www.knowman.io/guides/personal-knowledge-base), reads and tags them, answers questions with citations, and keeps memories such as claims, decisions and playbooks. Over MCP, Grok can search and question that library instead of asking you to paste text into the chat.

For the broader picture, see [give your AI context](https://www.knowman.io/guides/give-your-ai-context), [a knowledge base for AI agents](https://www.knowman.io/guides/knowledge-base-for-ai-agents), or [connect any AI to your notes](https://www.knowman.io/guides/connect-any-ai-to-your-notes).

## Use the hosted KnowMan server

To use KnowMan with Grok Build, add the hosted server URL https://api.knowman.io/mcp. Choose OAuth sign-in to open the KnowMan consent page and approve access, or send an API key as an `Authorization: Bearer <key>` header.

After connecting, ask Grok to search your KnowMan or save a URL. The hosted server exposes `kb_search`, `kb_ask`, `kb_get_item`, `kb_save`, `kb_recent`, and `kb_memories`.

## Questions

### Does Grok support MCP servers?

Yes. Grok Build adds a local stdio server with `grok mcp add <name> -- <command>`, and remote servers over HTTP with `grok mcp add --transport http <name> <url>` ([Grok Build docs](https://docs.x.ai/build/features/mcp-servers.md)). Servers can also be declared directly in ~/.grok/config.toml ([Grok Build docs](https://docs.x.ai/build/features/mcp-servers.md)).

### Where are Grok MCP servers configured?

User-level servers are declared in ~/.grok/config.toml under [mcp_servers.<name>] ([Grok Build docs](https://docs.x.ai/build/features/mcp-servers.md)). Repo-scoped servers are written to .grok/config.toml when you pass --scope project to grok mcp add ([Grok Build docs](https://docs.x.ai/build/features/mcp-servers.md)). Grok also loads ~/.claude.json, .cursor/mcp.json and project .mcp.json files, merged below config.toml in priority ([Grok Build docs](https://docs.x.ai/build/features/mcp-servers.md)).

### Can I use the KnowMan MCP server in Grok Bot?

The bot cannot reach your laptop, so it cannot use a local server running on your machine ([Composio guide](https://composio.dev/content/how-to-add-mcp-servers-to-grok-bot)). Use Grok Build with the hosted KnowMan server at https://api.knowman.io/mcp, signing in with OAuth or sending an API key as an `Authorization: Bearer <key>` header.

### How do I check the server is connected?

`grok mcp list` shows configured servers, and `grok mcp doctor knowman` diagnoses configuration and connectivity ([Grok Build docs](https://docs.x.ai/build/features/mcp-servers.md)). `grok inspect` shows every loaded server and its origin ([Grok Build docs](https://docs.x.ai/build/features/mcp-servers.md)).

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

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

- [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 Google Antigravity](https://www.knowman.io/integrations/antigravity)
- [Connect Claude to your knowledge base](https://www.knowman.io/integrations/connect-claude-ai-to-your-knowledge-base)
- [Can Grok Bot use your own knowledge base?](https://www.knowman.io/integrations/grok-bot-knowledge-base)

## Give Grok your saved reading

KnowMan saves articles and links, reads and tags them, and answers with citations ([KnowMan MCP guide](/guides/mcp-server-knowledge-base)). Try Pro free for 14 days, 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/grok
