Issues configuring MCP server in Codex VS Code extension

Resolved 💬 6 comments Opened Dec 15, 2025 by xunxiing Closed Dec 16, 2025
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What version of the VS Code extension are you using?

1.107.0

What subscription do you have?

personal

Which IDE are you using?

VS Code

What platform is your computer?

Microsoft Windows NT 10.0.26100.0 x64

What issue are you seeing?

I am unable to get an MCP server working in the Codex VS Code extension.

The MCP server does not start or does not expose tools in Codex,
even though the same MCP server works correctly in other environments.

There are no clear or actionable error messages shown in the Codex UI or log.

Result:

  • The MCP server does not function as expected in Codex

(tools are not available and the server does not start).

check

  • i do check my code on curosr,roocode,cline and trae it works well on those platform ,

What steps can reproduce the bug?

[mcp_servers.astrbot-mcp]
command = "uvx"
args = [
"--from",
"astrbotmcp",
"astrbot-mcp.exe"
]
type = "stdio"

[mcp_servers.astrbot-mcp.env]
ASTRBOT_BASE_URL = "http://127.0.0.1:6185"
ASTRBOT_TIMEOUT = "30"
ASTRBOT_USERNAME = "username"
ASTRBOT_PASSWORD = "password"#astrbot running or not won‘t influence the running of mcp so it doesn't matter to install astrbot,this test is availiable.

What is the expected behavior?

Expected:

  • The MCP server should start and expose tools, as it does in:
  • Local terminal
  • GitHub Actions CI
  • show tools to codex

Additional information

https://github.com/xunxiing/astrbotmcp this is the mcp package i am sure that ci do pass and it works on both linux and windows

<img width="2482" height="898" alt="Image" src="https://github.com/user-attachments/assets/33bfc230-96e2-4af6-b3a2-5d9f8dc0991d" />

View original on GitHub ↗

6 Comments

etraut-openai contributor · 8 months ago

Have you tried any other MCP servers? If so, did they work?

xunxiing · 8 months ago

BrowserMCP(浏览器自动化)

functions.mcp__browsermcp__browser_navigate
functions.mcp__browsermcp__browser_snapshot
functions.mcp__browsermcp__browser_click
functions.mcp__browsermcp__browser_type
functions.mcp__browsermcp__browser_select_option
functions.mcp__browsermcp__browser_hover
functions.mcp__browsermcp__browser_press_key
functions.mcp__browsermcp__browser_wait
functions.mcp__browsermcp__browser_go_back
functions.mcp__browsermcp__browser_go_forward
functions.mcp__browsermcp__browser_screenshot
functions.mcp__browsermcp__browser_get_console_logs
Context7(文档检索)

functions.mcp__context7__resolve-library-id
functions.mcp__context7__get-library-docs sorry its my fault ,it does works when i try context7 and brower use ,it both use npx,but i use uvx and sorry again it does pass on other code agent plugin and codex still cant recognize my mcp and without log

xunxiing · 8 months ago
Have you tried any other MCP servers? If so, did they work?

i have found the mistke it was a bug of two or even more reason,its your problem ,your mcp server first doesn't make any adpter to uvx ,which makes log unavailiable seconed
This appears to be a bug in Codex's MCP implementation.
A valid stdio-based MCP server that works in other MCP clients
fails during the handshake in Codex without actionable errors.

Codex seems to rely on undocumented, Codex-specific behavior
during MCP initialization, causing non-official MCP servers
to fail silently. you didnt do any try or log output, so it will still be a bug

etraut-openai contributor · 8 months ago

Can you provide more details about which behaviors you are seeing that you think are non-standard? Our intent is to work with any standards-compliant MCP server.

Are you the author of this MCP server?

xunxiing · 8 months ago
Can you provide more details about which behaviors you are seeing that you think are non-standard? Our intent is to work with any standards-compliant MCP server. Are you the author of this MCP server?

i am the author of this mcp.
During debugging, I initially believed stdout was clean.
However, it turned out that FastMCP still emitted startup output
to stdout during its initialization phase.

After fully disabling FastMCP’s startup logging and banner output,
so that stdout contained only JSON-RPC messages, the MCP handshake
in Codex succeeded.

i also tried to deal with the log issue ,it turns out suceesful,i use npx to start my project(i just use this method for test so it isnt in the latest release of my package.) here is the log:2025-12-15 23:11:41.794 [warning] [CodexMcpConnection] CLI: codex_core::mcp_connection_manager: Failed to notify sandbox state change to MCP server: MCP startup failed: handshaking with MCP server failed: connection closed: initialize response
2025-12-15 23:12:28.863 [error] Error fetching vscode://codex/git-current-branch: TypeError: Cannot destructure property 'gitRoot' of 'undefined' as it is undefined.
2025-12-15 23:12:32.614 [error] Error fetching vscode://codex/git-current-branch: TypeError: Cannot destructure property 'gitRoot' of 'undefined' as it is undefined.
2025-12-15 23:12:53.999 [warning] [warn] is production release true warning false
2025-12-15 23:12:56.719 [error] Error fetching vscode://codex/git-current-branch: TypeError: Cannot destructure property 'gitRoot' of 'undefined' as it is undefined.
2025-12-15 23:13:06.966 [warning] [CodexMcpConnection] CLI: codex_core::mcp_connection_manager: Failed to notify sandbox state change to MCP server: MCP startup failed: handshaking with MCP server failed: connection closed: initialize response
2025-12-15 23:13:11.433 [error] Error fetching vscode://codex/git-current-branch: TypeError: Cannot destructure property 'gitRoot' of 'undefined' as it is undefined.
2025-12-15 23:13:19.410 [warning] [CodexMcpConnection] CLI: codex_core::mcp_connection_manager: Failed to list resources for MCP server 'context7': resources/list failed: Mcp error: -32601: Method not found
2025-12-15 23:13:22.592 [warning] [CodexMcpConnection] CLI: codex_core::mcp_connection_manager: Failed to list resource templates for MCP server 'context7': resources/templates/list failed: Mcp error: -32601: Method not found
2025-12-15 23:14:37.462 [error] Error fetching vscode://codex/git-current-branch: TypeError: Cannot destructure property 'gitRoot' of 'undefined' as it is undefined.
2025-12-15 23:14:38.463 [error] Error fetching vscode://codex/git-current-branch: TypeError: Cannot destructure property 'gitRoot' of 'undefined' as it is undefined.
2025-12-15 23:14:39.291 [warning] [CodexMcpConnection] CLI: codex_core::mcp_connection_manager: Failed to notify sandbox state change to MCP server: MCP startup failed: handshaking with MCP server failed: connection closed: initialize response

etraut-openai contributor · 8 months ago

OK, glad to hear you figured it out.