Start free
Terminal and CLI agents

Add the KnowMan MCP server to Grok Build

Updated 5 min read

Setup in brief

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). 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). Run grok mcp list to confirm it loaded (Grok Build docs).

~/.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_..." }
On this page10 sections
  1. Add the server with grok mcp add
  2. Or declare it in ~/.grok/config.toml
  3. Create a key, or sign in once with knowman login
  4. Verify the connection
  5. If the server does not start
  6. The six tools KnowMan exposes
  7. Grok Build and Grok Bot are different
  8. Why connect a knowledge base to Grok
  9. Use the hosted KnowMan server
  10. Questions people ask

Add the server with grok mcp add

Grok Build adds a local stdio MCP server with grok mcp add <name> -- <command> (Grok Build docs). 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). A stdio server is declared under [mcp_servers.<name>] with command and args keys, and an env key carries environment variables (Grok Build docs). The entry also supports startup_timeout_sec and tool_timeout_sec keys (Grok Build docs). Grok notes that cold-start npx servers that download packages on first launch may need a higher startup_timeout_sec (Grok Build docs).

Grok expands ${VAR} and ${VAR:-default} in url, command, args, env and headers (Grok Build docs). For a repo-scoped server, pass --scope project to grok mcp add, which writes .grok/config.toml in the current directory (Grok Build docs). 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).

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). 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). If you already run KnowMan in Cursor or 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). Then ask Grok to use kb_search, which searches saved items by keyword or meaning.

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

Run grok mcp doctor knowman to diagnose configuration and connectivity (Grok Build docs).

The six tools KnowMan exposes

Once connected, Grok can call 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 the Knowledge Base with an optional note. kb_recent lists recent items. 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, 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).

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, 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, a knowledge base for AI agents, or 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 people ask

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). Servers can also be declared directly in ~/.grok/config.toml (Grok Build docs).

Where are Grok MCP servers configured?

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

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). 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). grok inspect shows every loaded server and its origin (Grok Build docs).

Give Grok your saved reading

KnowMan saves articles and links, reads and tags them, and answers with citations (KnowMan MCP guide). Try Pro free for 14 days, no credit card. Create your account

Start free

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