MCP server connection failures are logged without a reason

Open Beginner friendly
#49,726 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
backend

Research direction

Start by locating connectLocal and the runtime logger that emits the “server unavailable” message. Trace how status.error is captured and compare it with the fields currently logged. Done means local MCP spawn or connection failures include their reason in the log while retaining the server key and status.

Written by the indexing model from the issue text.

Description

When a local MCP server fails to spawn or connect (bad binary path, server exits on startup), the runtime log only shows:

WARN  server unavailable { key: "my-server", type: "local", status: "failed" }

with no reason attached. The failure message is already captured in status.error by connectLocal (opencode mcp list does print it), but the log line drops it. With several MCP servers configured, it's undiagnosable which one broke and why.

Happy to send a PR adding the reason to that log line.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
Avg merge
7h 20m
Merged PRs (30d)
358

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from anomalyco/opencode

All issues in anomalyco/opencode

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.