Local MCP name=UnknownError Server error #1014

Closed
opened 2026-02-16 17:29:05 -05:00 by yindo · 5 comments
Owner

Originally created by @acsezen on GitHub (Jul 31, 2025).

Originally assigned to: @thdxr on GitHub.

Hello,

I receive these errors if i use mcp servers locally. If i switch to remote everything works fine. When i tested mcp servers on shell with npx, they works as expected.

% grep -i error  ~/.local/share/opencode/log/2025-07-31T094742.log
INFO  2025-07-31T09:47:46 +1ms service=bus type=session.error publishing
INFO  2025-07-31T09:47:46 +1ms service=bus type=session.error publishing
ERROR 2025-07-31T09:47:46 +1ms service=tui message=MCP server context7 failed to start name=UnknownError Server error
DEBUG 2025-07-31T09:47:46 +0ms service=tui from=opencode.EventListResponseEventSessionError timeTakenMs=0 app.Update
ERROR 2025-07-31T09:47:46 +0ms service=tui message=MCP server exa failed to start name=UnknownError Server error
DEBUG 2025-07-31T09:47:46 +1ms service=tui from=opencode.EventListResponseEventSessionError timeTakenMs=0 app.Update


DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=0 messages.renderView
DEBUG 2025-07-31T09:47:46 +1ms service=tui from=chat.renderCompleteMsg timeTakenMs=0 messages.Update
DEBUG 2025-07-31T09:47:46 +0ms service=tui from=chat.renderCompleteMsg timeTakenMs=0 app.Update
DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=0 messages.View
DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=0 chat.View
DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=0 app.View
DEBUG 2025-07-31T09:47:46 +0ms service=tui from=opencode.EventListResponseEventMessageUpdated timeTakenMs=0 messages.Update
DEBUG 2025-07-31T09:47:46 +1ms service=tui from=opencode.EventListResponseEventMessageUpdated timeTakenMs=0 app.Update
DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=0 messages.View
DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=0 chat.View
DEBUG 2025-07-31T09:47:46 +1ms service=tui timeTakenMs=1 app.View
DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=0 messages.renderView
DEBUG 2025-07-31T09:47:46 +0ms service=tui from=chat.renderCompleteMsg timeTakenMs=0 messages.Update
DEBUG 2025-07-31T09:47:46 +0ms service=tui from=chat.renderCompleteMsg timeTakenMs=0 app.Update
DEBUG 2025-07-31T09:47:46 +1ms service=tui timeTakenMs=0 messages.View
DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=0 chat.View
DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=1 app.View
ERROR 2025-07-31T09:47:46 +1ms service=tui message=MCP server context7 failed to start name=UnknownError Server error
DEBUG 2025-07-31T09:47:46 +0ms service=tui from=opencode.EventListResponseEventSessionError timeTakenMs=0 app.Update
DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=0 messages.View
DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=0 chat.View
DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=1 app.View
ERROR 2025-07-31T09:47:46 +0ms service=tui message=MCP server exa failed to start name=UnknownError Server error
DEBUG 2025-07-31T09:47:46 +1ms service=tui from=opencode.EventListResponseEventSessionError timeTakenMs=0 app.Update
DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=0 messages.View
DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=0 chat.View
DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=1 app.View
DEBUG 2025-07-31T09:47:46 +0ms service=tui from=toast.ShowToastMsg timeTakenMs=0 messages.Update
DEBUG 2025-07-31T09:47:46 +0ms service=tui from=toast.ShowToastMsg timeTakenMs=0 app.Update
DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=0 messages.View
DEBUG 2025-07-31T09:47:46 +1ms service=tui timeTakenMs=0 chat.View
DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=1 app.View
DEBUG 2025-07-31T09:47:46 +0ms service=tui from=toast.ShowToastMsg timeTakenMs=0 messages.Update
DEBUG 2025-07-31T09:47:46 +0ms service=tui from=toast.ShowToastMsg timeTakenMs=0 app.Update
DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=0 messages.View
DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=0 chat.View
DEBUG 2025-07-31T09:47:46 +1ms service=tui timeTakenMs=2 app.View

Config;

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "context7": {
      "type": "local",
      "command": ["npx", "-y", "@upstash/context7-mcp"],
      "enabled": true
    },
    "exa": {
      "type": "local",
      "command": ["npx", "-y", "exa-mcp-server"],
      "enabled": true,
      "environment": {
        "EXA_API_KEY": "x-x-x-x-x"
      }
    }
  }
}

Thanks

Originally created by @acsezen on GitHub (Jul 31, 2025). Originally assigned to: @thdxr on GitHub. Hello, I receive these errors if i use mcp servers locally. If i switch to remote everything works fine. When i tested mcp servers on shell with npx, they works as expected. ``` % grep -i error ~/.local/share/opencode/log/2025-07-31T094742.log INFO 2025-07-31T09:47:46 +1ms service=bus type=session.error publishing INFO 2025-07-31T09:47:46 +1ms service=bus type=session.error publishing ERROR 2025-07-31T09:47:46 +1ms service=tui message=MCP server context7 failed to start name=UnknownError Server error DEBUG 2025-07-31T09:47:46 +0ms service=tui from=opencode.EventListResponseEventSessionError timeTakenMs=0 app.Update ERROR 2025-07-31T09:47:46 +0ms service=tui message=MCP server exa failed to start name=UnknownError Server error DEBUG 2025-07-31T09:47:46 +1ms service=tui from=opencode.EventListResponseEventSessionError timeTakenMs=0 app.Update ``` --- ``` DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=0 messages.renderView DEBUG 2025-07-31T09:47:46 +1ms service=tui from=chat.renderCompleteMsg timeTakenMs=0 messages.Update DEBUG 2025-07-31T09:47:46 +0ms service=tui from=chat.renderCompleteMsg timeTakenMs=0 app.Update DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=0 messages.View DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=0 chat.View DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=0 app.View DEBUG 2025-07-31T09:47:46 +0ms service=tui from=opencode.EventListResponseEventMessageUpdated timeTakenMs=0 messages.Update DEBUG 2025-07-31T09:47:46 +1ms service=tui from=opencode.EventListResponseEventMessageUpdated timeTakenMs=0 app.Update DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=0 messages.View DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=0 chat.View DEBUG 2025-07-31T09:47:46 +1ms service=tui timeTakenMs=1 app.View DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=0 messages.renderView DEBUG 2025-07-31T09:47:46 +0ms service=tui from=chat.renderCompleteMsg timeTakenMs=0 messages.Update DEBUG 2025-07-31T09:47:46 +0ms service=tui from=chat.renderCompleteMsg timeTakenMs=0 app.Update DEBUG 2025-07-31T09:47:46 +1ms service=tui timeTakenMs=0 messages.View DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=0 chat.View DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=1 app.View ERROR 2025-07-31T09:47:46 +1ms service=tui message=MCP server context7 failed to start name=UnknownError Server error DEBUG 2025-07-31T09:47:46 +0ms service=tui from=opencode.EventListResponseEventSessionError timeTakenMs=0 app.Update DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=0 messages.View DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=0 chat.View DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=1 app.View ERROR 2025-07-31T09:47:46 +0ms service=tui message=MCP server exa failed to start name=UnknownError Server error DEBUG 2025-07-31T09:47:46 +1ms service=tui from=opencode.EventListResponseEventSessionError timeTakenMs=0 app.Update DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=0 messages.View DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=0 chat.View DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=1 app.View DEBUG 2025-07-31T09:47:46 +0ms service=tui from=toast.ShowToastMsg timeTakenMs=0 messages.Update DEBUG 2025-07-31T09:47:46 +0ms service=tui from=toast.ShowToastMsg timeTakenMs=0 app.Update DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=0 messages.View DEBUG 2025-07-31T09:47:46 +1ms service=tui timeTakenMs=0 chat.View DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=1 app.View DEBUG 2025-07-31T09:47:46 +0ms service=tui from=toast.ShowToastMsg timeTakenMs=0 messages.Update DEBUG 2025-07-31T09:47:46 +0ms service=tui from=toast.ShowToastMsg timeTakenMs=0 app.Update DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=0 messages.View DEBUG 2025-07-31T09:47:46 +0ms service=tui timeTakenMs=0 chat.View DEBUG 2025-07-31T09:47:46 +1ms service=tui timeTakenMs=2 app.View ``` Config; ``` { "$schema": "https://opencode.ai/config.json", "mcp": { "context7": { "type": "local", "command": ["npx", "-y", "@upstash/context7-mcp"], "enabled": true }, "exa": { "type": "local", "command": ["npx", "-y", "exa-mcp-server"], "enabled": true, "environment": { "EXA_API_KEY": "x-x-x-x-x" } } } } ``` Thanks
yindo closed this issue 2026-02-16 17:29:05 -05:00
Author
Owner

@rekram1-node commented on GitHub (Jul 31, 2025):

@acsezen
Is there any chance you don't have npx installed? Or not setup in $PATH correctly? I can only replicate if I break my npx install intentionally

@rekram1-node commented on GitHub (Jul 31, 2025): @acsezen Is there any chance you don't have npx installed? Or not setup in $PATH correctly? I can only replicate if I break my npx install intentionally
Author
Owner

@acsezen commented on GitHub (Jul 31, 2025):

Hello @rekram1-node ,

Thanks for reply, actually i mentioned in my first message i can able to run npx locally. I just checked the path as well and it seems fine. I dont know if it makes any difference but i installed the node via FNM and running it inside a container created with distrobox. I am on Bluefin.

(3) ~/.local/share/opencode/log via daily
% which npx         
/run/user/1000/fnm_multishells/16945_1753954550342/bin/npx

(3) ~/.local/share/opencode/log via daily
% whereis npx            
npx: /var/home/user1/.fnm/node-versions/v22.17.1/installation/bin/npx

(3) ~/.local/share/opencode/log via daily
% echo $PATH    
/run/user/1000/fnm_multishells/16945_1753954550342/bin:/var/home/user1/.fnm:/var/home/user1/.local/share/../bin:/var/home/user1/.local/share/venv/daily/bin:/var/home/user1/.opencode/bin:/var/home/user1/.local/bin:/var/home/user1/.go/bin::/var/home/user1/.local/share/nvim/mason/bin:/var/home/user1/.pulumi/bin:/usr/local/go/bin:/var/home/user1/.krew/bin:/var/home/user1/.cargo/bin:/var/home/user1/.fzf/bin:/home/user1/.local/share/pnpm:/var/home/user1/.yarn/bin:/usr/lib64/ccache:/var/home/user1/.opencode/bin:/var/home/user1/.local/bin:/var/home/user1/.go/bin:/var/home/user1/.local/share/nvim/mason/bin:/var/home/user1/.pulumi/bin:/usr/local/go/bin:/var/home/user1/.krew/bin:/var/home/user1/.cargo/bin:/var/home/user1/.fzf/bin:/home/user1/.local/share/pnpm:/var/home/user1/.yarn/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/bin

(3) ~/.local/share/opencode/log via daily
% npx -y @upstash/context7-mcp   
Context7 Documentation MCP Server running on stdio

When I run with other clients, it works.

@acsezen commented on GitHub (Jul 31, 2025): Hello @rekram1-node , Thanks for reply, actually i mentioned in my first message i can able to run npx locally. I just checked the path as well and it seems fine. I dont know if it makes any difference but i installed the node via FNM and running it inside a container created with distrobox. I am on Bluefin. ``` (3) ~/.local/share/opencode/log via daily % which npx /run/user/1000/fnm_multishells/16945_1753954550342/bin/npx (3) ~/.local/share/opencode/log via daily % whereis npx npx: /var/home/user1/.fnm/node-versions/v22.17.1/installation/bin/npx (3) ~/.local/share/opencode/log via daily % echo $PATH /run/user/1000/fnm_multishells/16945_1753954550342/bin:/var/home/user1/.fnm:/var/home/user1/.local/share/../bin:/var/home/user1/.local/share/venv/daily/bin:/var/home/user1/.opencode/bin:/var/home/user1/.local/bin:/var/home/user1/.go/bin::/var/home/user1/.local/share/nvim/mason/bin:/var/home/user1/.pulumi/bin:/usr/local/go/bin:/var/home/user1/.krew/bin:/var/home/user1/.cargo/bin:/var/home/user1/.fzf/bin:/home/user1/.local/share/pnpm:/var/home/user1/.yarn/bin:/usr/lib64/ccache:/var/home/user1/.opencode/bin:/var/home/user1/.local/bin:/var/home/user1/.go/bin:/var/home/user1/.local/share/nvim/mason/bin:/var/home/user1/.pulumi/bin:/usr/local/go/bin:/var/home/user1/.krew/bin:/var/home/user1/.cargo/bin:/var/home/user1/.fzf/bin:/home/user1/.local/share/pnpm:/var/home/user1/.yarn/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/bin (3) ~/.local/share/opencode/log via daily % npx -y @upstash/context7-mcp Context7 Documentation MCP Server running on stdio ``` When I run with other clients, it works.
Author
Owner

@acsezen commented on GitHub (Aug 1, 2025):

Hello @thdxr,

I guess i find the problem. Its my .env file in my home directory. What interesting is, it only contain AIDER_ variables. When i comment them out, opencode successfully use local mcp servers.

This line lead to this error;
AIDER_READ=${XDG_CONFIG_HOME:-$HOME/.config}/aider/CONVENTIONS.md

If i use it like this, it works!
AIDER_READ=${XDG_CONFIG_HOME}:-$HOME/.config/aider/CONVENTIONS.md

Same applies to all config lines that use {} like this.

Thanks!

@acsezen commented on GitHub (Aug 1, 2025): Hello @thdxr, I guess i find the problem. Its my .env file in my home directory. What interesting is, it only contain AIDER_ variables. When i comment them out, opencode successfully use local mcp servers. This line lead to this error; AIDER_READ=${XDG_CONFIG_HOME:-$HOME/.config}/aider/CONVENTIONS.md If i use it like this, it works! AIDER_READ=${XDG_CONFIG_HOME}:-$HOME/.config/aider/CONVENTIONS.md Same applies to all config lines that use {} like this. Thanks!
Author
Owner

@rekram1-node commented on GitHub (Aug 11, 2025):

@acsezen is this resolved then? Can we close?

@rekram1-node commented on GitHub (Aug 11, 2025): @acsezen is this resolved then? Can we close?
Author
Owner

@acsezen commented on GitHub (Aug 15, 2025):

Hello,

I think opencode supposed to not have this problem as it is by design. But feel free to change to resolved.

@acsezen commented on GitHub (Aug 15, 2025): Hello, I think opencode supposed to not have this problem as it is by design. But feel free to change to resolved.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1014