modelcontextprotocol / modelcontextprotocol/servers

MacOS Claude Desktop - 'Server transport closed unexpectedly, this is likely due to the process exiting early' error

Open
#1,748 10 comments 14 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
90.5k
Forks
11.7k
Avg merge
2d 2h
Merged PRs (30d)
5

Description

Describe the bug
MCP Server starts fine
Claude Desktop (the client) connects and sends an "initialize" message
Immediately after, the connection drops
Either Claude Desktop crashes / exits
Or the server crashes right after receiving the message
Server tries to write back → EPIPE error (because client connection is already closed)
Everything shuts down cleanly but prematurely
To Reproduce
Steps to reproduce the behavior:

  1. Install MCP server with npm i @modelcontextprotocol/server-filesystem

Expected behavior
Claude Desktop connects to sever successfully.

Logs
2025-05-12T13:59:25.751Z [info] [filesystem] Initializing server...
2025-05-12T13:59:25.773Z [info] [filesystem] Server started and connected successfully
2025-05-12T13:59:25.783Z [info] [filesystem] Message from client: {"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"claude-ai","version":"0.1.0"}},"jsonrpc":"2.0","id":0}
2025-05-12T13:59:25.784Z [error] [filesystem] write EPIPE
2025-05-12T13:59:25.786Z [info] [filesystem] Server transport closed
2025-05-12T13:59:25.786Z [info] [filesystem] Client transport closed
2025-05-12T13:59:25.787Z [info] [filesystem] Server transport closed unexpectedly, this is likely due to the process exiting early. If you are developing this MCP server you can add output to stderr (i.e. console.error('...') in JavaScript, print('...', file=sys.stderr) in python) and it will appear in this log.
2025-05-12T13:59:25.787Z [error] [filesystem] Server disconnected. For troubleshooting guidance, please visit our debugging documentation
2025-05-12T13:59:25.787Z [info] [filesystem] Client transport closed
2025-05-12T14:01:11.577Z [info] [filesystem] Initializing server...
2025-05-12T14:01:11.591Z [info] [filesystem] Server started and connected successfully
2025-05-12T14:01:11.596Z [info] [filesystem] Server transport closed
2025-05-12T14:01:11.596Z [info] [filesystem] Client transport closed
2025-05-12T14:01:11.596Z [info] [filesystem] Server transport closed unexpectedly, this is likely due to the process exiting early. If you are developing this MCP server you can add output to stderr (i.e. console.error('...') in JavaScript, print('...', file=sys.stderr) in python) and it will appear in this log.
2025-05-12T14:01:11.596Z [error] [filesystem] Server disconnected. For troubleshooting guidance, please visit our debugging documentation
2025-05-12T14:01:11.597Z [info] [filesystem] Client transport closed

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 reproducing the failure with @modelcontextprotocol/server-filesystem from Claude Desktop on macOS, using the initialize-message and EPIPE logs as the baseline. Inspect the server transport and package entry point involved in handling initialization. Done means Claude Desktop remains connected after initialization without the EPIPE or premature transport-closure errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, node.js, typescript
Domain
api, backend, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.