# KnowMan MCP server for Codex

Client: Codex

Add KnowMan to Codex as a [local stdio MCP server](https://www.knowman.io/guides/what-is-an-mcp-server) named `knowman`, with `npx -y @knowman/mcp` as its command. You can configure it in `config.toml`, [sign in](https://www.knowman.io/guides/personal-knowledge-base) once with `knowman login`, then confirm it appears in Codex.

## Codex config.toml

```toml
[mcp_servers.knowman]
command = "npx"
args = ["-y", "@knowman/mcp"]
env = { KNOWMAN_API_KEY = "km_..." }
```

## Add KnowMan to Codex config.toml

Codex stores MCP configuration in `config.toml`, normally `~/.codex/config.toml`. Trusted projects can use a project-scoped `.codex/config.toml`. Add the `knowman` table shown in the configuration on this page. Codex requires `command` for stdio servers and allows `args` and `env`. See [Codex MCP documentation](https://learn.chatgpt.com/docs/extend/mcp?surface=cli).

## Use the Codex CLI command

You can add the same local server from the [command line](https://www.knowman.io/integrations): `codex mcp add knowman --env KNOWMAN_API_KEY=km_... -- npx -y @knowman/mcp`. The command places the server name and [environment variable](https://www.knowman.io/guides/mcp-server-knowledge-base) before `--`, followed by the stdio server command. See [Codex MCP documentation](https://learn.chatgpt.com/docs/extend/mcp?surface=cli).

## Sign in once with knowman login

Run `npx -p @knowman/mcp knowman login`, then approve access in the browser. The CLI and MCP server share the saved credential, so you can remove the `env` block from `config.toml` after signing in. For a server without a browser, use `KNOWMAN_API_KEY=km_...` instead. See the [KnowMan MCP guide](https://www.knowman.io/guides/mcp-server-knowledge-base).

## Verify the installation

Run `codex mcp list` to confirm that Codex lists the configured server. In the Codex TUI, run `/mcp` to view active MCP servers. The ChatGPT desktop app, Codex CLI, and IDE extension share the same MCP configuration. See [Codex MCP documentation](https://learn.chatgpt.com/docs/extend/mcp?surface=cli).

## Use KnowMan in the desktop app or IDE extension

In the ChatGPT desktop app, open Settings and select MCP servers to manage servers. In the Codex IDE extension, open the gear menu and select MCP servers. Save the server, then select Restart in the desktop app or Restart extension in the IDE extension. See [Codex MCP documentation](https://learn.chatgpt.com/docs/extend/mcp?surface=cli).

## Search and answer with KnowMan tools

`kb_search` searches [saved items](https://www.knowman.io/guides/how-to-save-articles) by [keyword or meaning](https://www.knowman.io/guides/ai-knowledge-base) and returns titles, URLs, and metadata. `kb_ask` [answers questions with citations](https://www.knowman.io/guides/knowledge-base-for-ai-agents). `kb_get_item` returns readable content and metadata for one item. See the [KnowMan MCP guide](https://www.knowman.io/guides/mcp-server-knowledge-base).

## Save and retrieve more with KnowMan

`kb_save` saves a URL to the Inbox or Knowledge Base, with an optional note. `kb_recent` lists recently saved items. `kb_memories` lists [saved claims, decisions, and playbooks](https://www.knowman.io/guides/ai-agent-memory). KnowMan also provides answers with citations for questions about saved material. See the [KnowMan MCP guide](https://www.knowman.io/guides/mcp-server-knowledge-base).

## Set the key and run your first search

Put your KnowMan API key in the `KNOWMAN_KEY` environment variable. In `~/.codex/config.toml`, add `[mcp_servers.knowman]` with `url = "https://api.knowman.io/mcp"` and `bearer_token_env_var = "KNOWMAN_KEY"`.

Start with: “Use the knowman kb_recent tool and list the titles it returns”, then “Use the knowman kb_search tool with the query bookmark and list the top results”.

Each prompt returns saved-item titles from your KnowMan library. KnowMan provides six tools: `kb_search`, `kb_ask`, `kb_get_item`, `kb_save`, `kb_recent`, and `kb_memories`, at https://api.knowman.io/mcp.

## Questions

### Can Codex run the KnowMan MCP server?

Yes. Codex supports stdio servers that run as local processes, and KnowMan is a local stdio MCP server. It cannot be used with a client that accepts only remote MCP servers. See [Codex MCP documentation](https://learn.chatgpt.com/docs/extend/mcp?surface=cli) and the [KnowMan MCP guide](https://www.knowman.io/guides/mcp-server-knowledge-base).

### Do I need to sign in again for every Codex session?

No. Run `knowman login` once, then the CLI and MCP server share the saved credential. You can omit `KNOWMAN_API_KEY` from the Codex configuration after sign-in. See the [KnowMan MCP guide](https://www.knowman.io/guides/mcp-server-knowledge-base).

### How do I check that Codex sees the server?

Run `codex mcp list` to see configured servers. In the Codex TUI, use `/mcp` to view active servers. See [Codex MCP documentation](https://learn.chatgpt.com/docs/extend/mcp?surface=cli).

### Does ChatGPT on the web use this Codex configuration?

No. ChatGPT web does not read local Codex configuration files. The documented shared configuration applies to the ChatGPT desktop app, Codex CLI, and IDE extension. See [Codex MCP documentation](https://learn.chatgpt.com/docs/extend/mcp?surface=cli).

## Related pages

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

- [Give Claude Code a knowledge base built from your reading](https://www.knowman.io/guides/claude-code-knowledge-base)

- [What Is a Knowledge Base for AI Agents?](https://www.knowman.io/guides/knowledge-base-for-ai-agents)

- [Persistent Memory for AI Agents](https://www.knowman.io/guides/persistent-memory-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 Hermes Agent](https://www.knowman.io/integrations/hermes)
- [Connect KnowMan to Gemini CLI](https://www.knowman.io/integrations/gemini-cli)
- [KnowMan MCP server for Goose](https://www.knowman.io/integrations/goose)

## More for Codex

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

## Bring your saved knowledge into Codex

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