Add the server
Gemini CLI reads MCP server definitions from the mcpServers object in settings.json. Gemini CLI MCP documentation describes user settings at ~/.gemini/settings.json and project settings at .gemini/settings.json; project scope is the default.
The snippet uses KnowMan's npx -y @knowman/mcp command and KNOWMAN_API_KEY environment variable. KnowMan's MCP server requires Node 22 or newer and accepts a Bearer key beginning with km_.
Sign in once with knowman login
Instead of placing an API key in the config, run npx -p @knowman/mcp knowman login and approve the browser sign-in. KnowMan's CLI and MCP server share the saved credential, so you can then remove the env block. KnowMan MCP setup
Choose user or project settings
Use gemini mcp add to add a local server. The -s or --scope option selects user or project, and defaults to project. Gemini CLI MCP documentation
For example, gemini mcp add -e KNOWMAN_API_KEY=km_... knowman npx -y @knowman/mcp adds environment variables and command arguments using the documented local stdio form. Gemini CLI MCP documentation
Verify the connection
Start Gemini CLI and use /mcp to view configured servers and their connection status. MCP discovery runs when Gemini CLI starts. Gemini CLI MCP documentation
Gemini CLI displays stdio servers as connected only when the current folder is trusted. Gemini CLI MCP documentation
Use the six KnowMan tools
kb_search searches saved items by keyword or meaning. kb_ask answers questions with citations. kb_get_item retrieves one item's readable content. KnowMan MCP server
kb_save saves a URL with an optional note. kb_recent lists recent items. kb_memories lists saved claims, decisions, and playbooks. KnowMan MCP server
Questions people ask
Where does Gemini CLI store the MCP configuration?
User scope uses ~/.gemini/settings.json, while project scope uses .gemini/settings.json. The scope option defaults to project. Gemini CLI MCP documentation
Do I need to keep the API key in settings.json?
No. Run npx -p @knowman/mcp knowman login and approve the browser sign-in. The MCP server shares the saved credential, so the environment block can be removed. KnowMan MCP setup
Why does Gemini CLI not show the server as connected?
Gemini CLI displays stdio servers as connected only when the current folder is trusted. Its /mcp command shows server connection status. Gemini CLI MCP documentation
What does the KnowMan MCP server provide?
It provides six tools: kb_search, kb_ask, kb_get_item, kb_save, kb_recent, and kb_memories. KnowMan MCP server