modelcontextprotocol / modelcontextprotocol/typescript-sdk

Expected manner to capture error details during startup

Open
#153 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement needs decision P3
Dominant language
TypeScript
Stars
13.4k
Forks
2.2k
Avg merge
3d 15h
Merged PRs (30d)
4

Description

When starting a new MCP server, there are times in which the command/args are simply incorrect. However, when awaiting on the connect call, the error that is thrown provides only the following:

McpError: MCP error -32000: Connection closed

Is there any way to relay the stdin/stderr from the spawned process (in the case of the StdioClientTransport)? That can give hints to incorrect file paths, invalid command args, etc. For SSEClientTransport, connection errors can be relayed.

If there's a way to do this, I'd love to help update docs to make it clearer.

Thanks!

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.

Research direction

Start by tracing the startup and connection error paths for StdioClientTransport and SSEClientTransport. Check how spawned-process stdin/stderr and SSE connection errors are currently handled, then document or expose the relevant error details so invalid commands, arguments, and paths are diagnosable.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.