Stdio handshake timeout with npx local MCPs (env expansion suspect) #8569

Open
opened 2026-02-16 18:10:17 -05:00 by yindo · 1 comment
Owner

Originally created by @LERMF on GitHub (Feb 4, 2026).

Originally assigned to: @rekram1-node on GitHub.

Summary

Local MCP servers using npx hang/time out in OpenCode. opencode mcp list shows 60s timeouts for local stdio MCPs, while running the same npx commands manually works. Suspect stdio handshake or env expansion issue ("${TOKEN}" passed literally).

Environment

  • OS: Linux
  • OpenCode: 1.1.51
  • Transport: local stdio (npx)

Repro

  1. Configure local MCP servers with command: [\"npx\", \"-y\", \"@modelcontextprotocol/server-filesystem\", \"/home/user\"]
  2. Run opencode mcp list
  3. Observe timeouts for local servers

Observed

filesystem: Operation timed out after 60000ms
memory: Operation timed out after 60000ms
sequential-thinking: Operation timed out after 60000ms
everything: Operation timed out after 60000ms
github: Operation timed out after 10000ms
brave-search: Operation timed out after 10000ms

Remote MCPs (context7) and local python server (neogsd_triad) connect fine.

Expected

Local MCPs should connect and register tools, as they do when run directly with npx.

Notes

  • npx -y @modelcontextprotocol/server-filesystem /home/user runs fine manually.
  • Previously, bunx produced Connection closed; npx now times out.
  • Config includes env var placeholders like ${GITHUB_TOKEN}, possible expansion issue.

Config snippet (sanitized)

"filesystem": {"type":"local","command":["npx","-y","@modelcontextprotocol/server-filesystem","/home/user"],"enabled":true,"timeout":60000}
Originally created by @LERMF on GitHub (Feb 4, 2026). Originally assigned to: @rekram1-node on GitHub. ## Summary Local MCP servers using `npx` hang/time out in OpenCode. `opencode mcp list` shows 60s timeouts for local stdio MCPs, while running the same `npx` commands manually works. Suspect stdio handshake or env expansion issue (\"${TOKEN}\" passed literally). ## Environment - OS: Linux - OpenCode: 1.1.51 - Transport: local stdio (npx) ## Repro 1. Configure local MCP servers with `command: [\"npx\", \"-y\", \"@modelcontextprotocol/server-filesystem\", \"/home/user\"]` 2. Run `opencode mcp list` 3. Observe timeouts for local servers ## Observed ``` filesystem: Operation timed out after 60000ms memory: Operation timed out after 60000ms sequential-thinking: Operation timed out after 60000ms everything: Operation timed out after 60000ms github: Operation timed out after 10000ms brave-search: Operation timed out after 10000ms ``` Remote MCPs (context7) and local python server (neogsd_triad) connect fine. ## Expected Local MCPs should connect and register tools, as they do when run directly with `npx`. ## Notes - `npx -y @modelcontextprotocol/server-filesystem /home/user` runs fine manually. - Previously, bunx produced `Connection closed`; npx now times out. - Config includes env var placeholders like `${GITHUB_TOKEN}`, possible expansion issue. ## Config snippet (sanitized) ```json "filesystem": {"type":"local","command":["npx","-y","@modelcontextprotocol/server-filesystem","/home/user"],"enabled":true,"timeout":60000} ```
Author
Owner

@github-actions[bot] commented on GitHub (Feb 4, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #8171: MCP Docker servers fail to connect after upgrade from v1.1.6 to v1.1.7+ (similar connection issues with local stdio MCPs)
  • #6994: Windows MCP local server fails with Bun but works with NPX (directly addresses bunx vs npx issue mentioned in your notes)
  • #8478: McpError: MCP error -32001: Request timed out (similar timeout symptoms)
  • #3273: MCP client failing makes opencode hang (related timeout/hang behavior)

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Feb 4, 2026): This issue might be a duplicate of existing issues. Please check: - #8171: MCP Docker servers fail to connect after upgrade from v1.1.6 to v1.1.7+ (similar connection issues with local stdio MCPs) - #6994: Windows MCP local server fails with Bun but works with NPX (directly addresses bunx vs npx issue mentioned in your notes) - #8478: McpError: MCP error -32001: Request timed out (similar timeout symptoms) - #3273: MCP client failing makes opencode hang (related timeout/hang behavior) Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8569