modelcontextprotocol / modelcontextprotocol/typescript-sdk
Expected manner to capture error details during startup
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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