Codex does not use MCP servers defined in config.toml.

Resolved 💬 5 comments Opened Sep 10, 2025 by scottaw66 Closed Sep 11, 2025

What version of Codex is running?

codex-cli 0.31.0

Which model were you using?

gpt-5 medium

What platform is your computer?

Darwin 25.0.0 arm64 arm (macOS 26)

What steps can reproduce the bug?

My config.toml has the following:

[mcp.servers."mcp-obsidian"]
command = "/Users/scott/Scripts/mcp/mcp-obsidian/.venv/bin/mcp-obsidian"
args = []
env.OBSIDIAN_API_KEY = "${OBSIDIAN_API_KEY}"
env.OBSIDIAN_HOST = "127.0.0.1"
env.OBSIDIAN_PORT = "27124"
env.OBSIDIAN_PROTOCOL = "https"

mcp server never connects, never shows in list of tools, codex is unaware of its existence.

▌I want you to tell me if or if not you can see the MCP-obsidian is connected. Is it available as a tool for you?

Short answer: No.

In this session, I don’t see MCP‑Obsidian exposed as a tool. The only tools available to me here are shell/update_plan/view_image. If you enable
MCP tools for this run, I’ll use mcp‑obsidian immediately.

What is the expected behavior?

I really need to be able to run MCP servers with either ChatGPT, which would be preferable, and I do mean local ones, not hosted remote ones, or with codex.

What do you see instead?

extreme frustration when Codex keeps telling me it will connect and it can't and it doesn't know how and I have had it tell me that it is now properly configured to connect time and time and time again and yet it is never able to connect to the MCP server.

Additional information

_No response_

View original on GitHub ↗

5 Comments

caidish · 11 months ago

For me, mcp.servers -> mcp_servers fixed it immediately.

As in mcp doc of codex, the format is:

# IMPORTANT: the top-level key is `mcp_servers` rather than `mcpServers`.
[mcp_servers.server-name]
command = "npx"
args = ["-y", "mcp-server"]
env = { "API_KEY" = "value" }
# Optional: override the default 10s startup timeout
startup_timeout_ms = 20_000
adsqx · 11 months ago

Try typing /mcp and check whether:

The tool is visible,

The tools list is missing, or

The tool is completely absent.

mizuikki · 11 months ago
Try typing /mcp and check whether: The tool is visible, The tools list is missing, or The tool is completely absent.

This is a Codex issue, not an MCP tool issue.

scottaw66 · 11 months ago

@caidish

For me, mcp.servers -> mcp_servers fixed it immediately. As in mcp doc of codex, the format is: `` # IMPORTANT: the top-level key is mcp_servers rather than mcpServers. [mcp_servers.server-name] command = "npx" args = ["-y", "mcp-server"] env = { "API_KEY" = "value" } # Optional: override the default 10s startup timeout startup_timeout_ms = 20_000 ``

You're absolutely right. It does try to init now. Now I'm on to THIS bug - https://github.com/openai/codex/issues/3426

The reason is I used homebrew to install codex and it's still on 0.33.0, and apparently the fix for the above is in 0.34.0. But once I get 0.34.0, your correction of mcp.servers to mcp_servers should mean it will work.

Thank you!

saltnpixels · 4 months ago

I decided totr y codex... i can't get it laoding mcp servers in the root of repo either.... :/ I've spent an hour trying. ridiculous.
i found you need to add your repo as a trusted repo to the global ~/.codex/config.toml. then suddenly the repo mcp's work