Windows MCP local server fails with Bun but works with NPX (Error -32000) #4262

Open
opened 2026-02-16 17:43:12 -05:00 by yindo · 2 comments
Owner

Originally created by @bagleytravis68 on GitHub (Jan 5, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

When configuring a local MCP server using bun x or bun run on Windows, OpenCode fails with MCP error -32000: Connection closed.

"mcp": {
"exa_search": {
"type": "local",
"enabled": true,
"command": [
"bun",
"x",
"-y",
"exa-mcp-server"
],
"env": {
"EXA_API_KEY": "####"
}
}
}

This is what is output in debug logs:
ERROR 2026-01-05T19:30:57 +75ms service=mcp key=exa_search command=["bun","x","-y","exa-mcp-server"] cwd=C:\Users####\OpenCode error=MCP error -32000: Connection closed local mcp startup failed

Note: bun will install when run outside of OpenCode .

Installing Node.js and using ["npx", "-y", "exa-mcp-server"] resolves the issue because Node does not pollute the stdout pipe with startup logs.

Plugins

No response

OpenCode version

1.1.3

Steps to reproduce

  1. Install exa-mcp-server via Bun.
  2. Configure opencode.jsonc using ["bun", "x", "exa-mcp-server"]
  3. Run opencode run --print-logs --log-level=DEBUG "hi"
  4. Observe the -32000 error in debug logs.

Screenshot and/or share link

Image

Operating System

Windows 11

Terminal

Windows Terminal

Originally created by @bagleytravis68 on GitHub (Jan 5, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description When configuring a local MCP server using bun x or bun run on Windows, OpenCode fails with MCP error -32000: Connection closed. "mcp": { "exa_search": { "type": "local", "enabled": true, "command": [ "bun", "x", "-y", "exa-mcp-server" ], "env": { "EXA_API_KEY": "####" } } } This is what is output in debug logs: ERROR 2026-01-05T19:30:57 +75ms service=mcp key=exa_search command=["bun","x","-y","exa-mcp-server"] cwd=C:\Users\####\OpenCode error=MCP error -32000: Connection closed local mcp startup failed Note: bun will install when run outside of OpenCode . Installing Node.js and using ["npx", "-y", "exa-mcp-server"] resolves the issue because Node does not pollute the stdout pipe with startup logs. ### Plugins _No response_ ### OpenCode version 1.1.3 ### Steps to reproduce 1. Install exa-mcp-server via Bun. 3. Configure opencode.jsonc using ["bun", "x", "exa-mcp-server"] 4. Run opencode run --print-logs --log-level=DEBUG "hi" 5. Observe the -32000 error in debug logs. ### Screenshot and/or share link <img width="1092" height="227" alt="Image" src="https://github.com/user-attachments/assets/24498c32-4666-49a0-b67d-0a7160a5b711" /> ### Operating System Windows 11 ### Terminal Windows Terminal
yindo added the windowsbug labels 2026-02-16 17:43:12 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 5, 2026):

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

  • #6909: RE: MCP Servers - Potential issue? (Windows MCP server initialization failures)

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

@github-actions[bot] commented on GitHub (Jan 5, 2026): This issue might be a duplicate of existing issues. Please check: - #6909: RE: MCP Servers - Potential issue? (Windows MCP server initialization failures) Feel free to ignore if none of these address your specific case.
Author
Owner

@bagleytravis68 commented on GitHub (Jan 5, 2026):

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

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

Looks different. Nothing here mentions running bun.

@bagleytravis68 commented on GitHub (Jan 5, 2026): > This issue might be a duplicate of existing issues. Please check: > > * [RE: MCP Servers - Potential issue? #6909](https://github.com/anomalyco/opencode/issues/6909): RE: MCP Servers - Potential issue? (Windows MCP server initialization failures) > > Feel free to ignore if none of these address your specific case. Looks different. Nothing here mentions running bun.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4262