Skip to content

"Could not attach to MCP server iMCP" timeout #24

Closed

Description

@apike

Hi @mattt and team – really interesting project!

Unfortunately I haven't been able to get it to run on my Mac, so I wanted to make a bug report.

Via the readme instructions I was able to get most of the way through installation and setup (download, activate services, configure to work to claude) but when when I launch Claude, instead of getting the "Client connection request" dialog shown, I get the errors "Could not attach to MCP server iMCP" and "MCP iMCP: Server disconnected" after a 60 second timeout.

Image

Image

I've attached the logs below, but it seems like a kind of generic timeout. Is there any more info or logs I could provide to help track this down?

Further details:

  1. The same issue happens after restarting my Mac (launch Claude, 60 seconds later this timeout happens)
  2. I'm on macOS 15.3.1 and Claude Dekstop 0.8.0.

mcp-server-iMCP.log

2025-03-07T20:41:29.253Z [iMCP] [info] Initializing server...
2025-03-07T20:41:29.308Z [iMCP] [info] Server started and connected successfully
2025-03-07T20:41:29.311Z [iMCP] [info] 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-03-07T12:41:29-0800 info com.loopwork.iMCP.server : [imcp_server] Created Bonjour browser for service type: _mcp._tcp
2025-03-07T12:41:29-0800 info com.loopwork.iMCP.server : [imcp_server] Starting Bonjour service discovery...
2025-03-07T12:41:29-0800 debug com.loopwork.iMCP.server : [imcp_server] Starting Bonjour browser...
2025-03-07T12:41:29-0800 debug com.loopwork.iMCP.server : [imcp_server] Browser state changed: ready
2025-03-07T20:41:29.923Z [iMCP] [info] Initializing server...
2025-03-07T20:41:29.926Z [iMCP] [info] Server started and connected successfully
2025-03-07T12:41:29-0800 info com.loopwork.iMCP.server : [imcp_server] Created Bonjour browser for service type: _mcp._tcp
2025-03-07T12:41:29-0800 info com.loopwork.iMCP.server : [imcp_server] Starting Bonjour service discovery...
2025-03-07T12:41:29-0800 debug com.loopwork.iMCP.server : [imcp_server] Starting Bonjour browser...
2025-03-07T12:41:29-0800 debug com.loopwork.iMCP.server : [imcp_server] Browser state changed: ready
2025-03-07T20:41:29.946Z [iMCP] [info] 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-03-07T20:42:29.310Z [iMCP] [info] Message from client: {"jsonrpc":"2.0","method":"notifications/cancelled","params":{"requestId":0,"reason":"Error: MCP error -32001: Request timed out"}}
2025-03-07T20:42:29.310Z [iMCP] [info] Client transport closed
2025-03-07T20:42:29.311Z [iMCP] [info] Server transport closed
2025-03-07T20:42:29.311Z [iMCP] [info] Client transport closed
2025-03-07T20:42:29.311Z [iMCP] [info] 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-03-07T20:42:29.311Z [iMCP] [error] Server disconnected. For troubleshooting guidance, please visit our debugging documentation {"context":"connection"}
2025-03-07T20:42:29.311Z [iMCP] [info] Server transport closed
2025-03-07T20:42:29.311Z [iMCP] [info] Client transport closed
2025-03-07T20:42:29.947Z [iMCP] [info] Message from client: {"jsonrpc":"2.0","method":"notifications/cancelled","params":{"requestId":0,"reason":"Error: MCP error -32001: Request timed out"}}
2025-03-07T20:42:29.948Z [iMCP] [info] Client transport closed
2025-03-07T20:42:29.948Z [iMCP] [info] Server transport closed
2025-03-07T20:42:29.948Z [iMCP] [info] Client transport closed
2025-03-07T20:42:29.948Z [iMCP] [info] 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-03-07T20:42:29.948Z [iMCP] [error] Server disconnected. For troubleshooting guidance, please visit our debugging documentation {"context":"connection"}
2025-03-07T20:42:29.949Z [iMCP] [info] Server transport closed
2025-03-07T20:42:29.949Z [iMCP] [info] Client transport closed

mcp.log

2025-03-07T20:41:29.254Z [info] [iMCP] Initializing server...
2025-03-07T20:41:29.308Z [info] [iMCP] Server started and connected successfully
2025-03-07T20:41:29.311Z [info] [iMCP] 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-03-07T20:41:29.923Z [info] [iMCP] Initializing server...
2025-03-07T20:41:29.926Z [info] [iMCP] Server started and connected successfully
2025-03-07T20:41:29.946Z [info] [iMCP] 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-03-07T20:42:29.310Z [info] [iMCP] Message from client: {"jsonrpc":"2.0","method":"notifications/cancelled","params":{"requestId":0,"reason":"Error: MCP error -32001: Request timed out"}}
2025-03-07T20:42:29.310Z [info] [iMCP] Client transport closed
2025-03-07T20:42:29.311Z [info] [iMCP] Server transport closed
2025-03-07T20:42:29.311Z [info] [iMCP] Client transport closed
2025-03-07T20:42:29.311Z [info] [iMCP] 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-03-07T20:42:29.311Z [error] [iMCP] Server disconnected. For troubleshooting guidance, please visit our debugging documentation
2025-03-07T20:42:29.311Z [info] [iMCP] Server transport closed
2025-03-07T20:42:29.311Z [info] [iMCP] Client transport closed
2025-03-07T20:42:29.947Z [info] [iMCP] Message from client: {"jsonrpc":"2.0","method":"notifications/cancelled","params":{"requestId":0,"reason":"Error: MCP error -32001: Request timed out"}}
2025-03-07T20:42:29.948Z [info] [iMCP] Client transport closed
2025-03-07T20:42:29.948Z [info] [iMCP] Server transport closed
2025-03-07T20:42:29.948Z [info] [iMCP] Client transport closed
2025-03-07T20:42:29.948Z [info] [iMCP] 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-03-07T20:42:29.948Z [error] [iMCP] Server disconnected. For troubleshooting guidance, please visit our debugging documentation
2025-03-07T20:42:29.949Z [info] [iMCP] Server transport closed
2025-03-07T20:42:29.949Z [info] [iMCP] Client transport closed

Activity

  1. mattt commented on Mar 7, 2025

    @mattt
    Owner

    @apike Allen! Good to see you. Thanks for trying this out and sharing these details. That's really helpful. Sorry it's not working for you out of the box.

    I wonder if the issue is that iMCP can't establish a connection on the local network. What do you see if you open System Settings > Privacy & Security > Local Network?

  2. apike commented on Mar 7, 2025

    @apike
    Author

    @mattt Happy to help!

    Local network permissions is an interesting idea. In the Local Network security Settings pane I see 21 apps, but iMCP isn't listed. I don't believe I saw a prompt about allowing iMCP to communicate with devices on the local network, so it would make sense it doesn't appear here.

  3. stephengilroy commented on Mar 9, 2025

    @stephengilroy

    Hey! I had the same issue. Not sure if this was the actual fix (I was trying a few things all at once) but I realized I was running the application from my Downloads folder 🤦 . When I moved it into Applications and relaunched it asked for permission to access my local network. After that it worked great!

  4. mattt commented on Mar 10, 2025

    @mattt
    Owner

    @stephengilroy Ooh, nice catch! It sounds like this might have to do with App Translocation (thank goodness for Quinn). I reckon we'll need to detect whether the app is being run from the Applications directory and prompt the user to move it and relaunch.

  5. stephengilroy commented on Mar 10, 2025

    @stephengilroy

    Wow. The more you know! I had never heard of App Translocation. That is definitely the issue. I saw that path in the claude logs which is why I moved it in the first place 👍

  6. apike commented on Mar 10, 2025

    @apike
    Author

    Unfortunately that's not the issue for me, mine is running from /Applications/iMCP.app/Contents/MacOS/imcp-server.

  7. added
    bug
    on Mar 14, 2025
  8. apike commented on Mar 21, 2025

    @apike
    Author

    @mattt Is there any location or mode to get more thorough logs from iMCP about why it may be timing out?

  9. mattt commented on Mar 21, 2025

    @mattt
    Owner

    @apike Best we have are the logs at ~/Library/Logs/Claude/mcp-server-imcp.log. I've been seeing these timeouts and disconnects, too, and I'm looking into them.

  10. mluisbrown commented on Mar 31, 2025

    @mluisbrown
    Contributor

    I have the same (or very similar) issue. I can't get it working at all :/

    2025-03-31T08:05:27.332Z [iMCP] [info] Initializing server...
    2025-03-31T08:05:27.391Z [iMCP] [info] Server started and connected successfully
    2025-03-31T08:05:27.392Z [iMCP] [info] Message from client: {"method":"initialize","params":{"protocolVersion":"2024-11-05","ca
    pabilities":{},"clientInfo":{"name":"claude-ai","version":"0.1.0"}},"jsonrpc":"2.0","id":0}
    2025-03-31T09:05:27+0100 info com.loopwork.iMCP.server : [imcp_server] Created Bonjour browser for service type: _mcp._tcp
    2025-03-31T09:05:27+0100 info com.loopwork.iMCP.server : [imcp_server] Starting Bonjour service discovery...
    2025-03-31T09:05:27+0100 debug com.loopwork.iMCP.server : [imcp_server] Starting Bonjour browser...
    2025-03-31T09:05:27+0100 debug com.loopwork.iMCP.server : [imcp_server] Browser state changed: ready
    2025-03-31T08:05:28.270Z [iMCP] [info] Initializing server...
    2025-03-31T08:05:28.289Z [iMCP] [info] Server started and connected successfully
    2025-03-31T08:05:28.291Z [iMCP] [info] Message from client: {"method":"initialize","params":{"protocolVersion":"2024-11-05","ca
    pabilities":{},"clientInfo":{"name":"claude-ai","version":"0.1.0"}},"jsonrpc":"2.0","id":0}
    2025-03-31T09:05:28+0100 info com.loopwork.iMCP.server : [imcp_server] Created Bonjour browser for service type: _mcp._tcp
    2025-03-31T09:05:28+0100 info com.loopwork.iMCP.server : [imcp_server] Starting Bonjour service discovery...
    2025-03-31T09:05:28+0100 debug com.loopwork.iMCP.server : [imcp_server] Starting Bonjour browser...
    2025-03-31T09:05:28+0100 debug com.loopwork.iMCP.server : [imcp_server] Browser state changed: ready
    2025-03-31T08:06:27.394Z [iMCP] [info] Message from client: {"jsonrpc":"2.0","method":"notifications/cancelled","params":{"requ
    estId":0,"reason":"Error: MCP error -32001: Request timed out"}}
    2025-03-31T08:06:27.396Z [iMCP] [info] Client transport closed
    2025-03-31T08:06:27.397Z [iMCP] [info] Server transport closed
    2025-03-31T08:06:27.397Z [iMCP] [info] Client transport closed
    2025-03-31T08:06:27.397Z [iMCP] [info] Server transport closed unexpectedly, this is likely due to the process exiting early. I
    f you are developing this MCP server you can add output to stderr (i.e. `console.error('...')` in JavaScript, `print('...', fil
    e=sys.stderr)` in python) and it will appear in this log.
    2025-03-31T08:06:27.398Z [iMCP] [error] Server disconnected. For troubleshooting guidance, please visit our [debugging document
    ation](https://modelcontextprotocol.io/docs/tools/debugging) {"context":"connection"}
    2025-03-31T08:06:27.402Z [iMCP] [info] Server transport closed
    2025-03-31T08:06:27.402Z [iMCP] [info] Client transport closed
    2025-03-31T08:06:28.293Z [iMCP] [info] Message from client: {"jsonrpc":"2.0","method":"notifications/cancelled","params":{"requ
    estId":0,"reason":"Error: MCP error -32001: Request timed out"}}
    2025-03-31T08:06:28.294Z [iMCP] [info] Client transport closed
    2025-03-31T08:06:28.295Z [iMCP] [info] Server transport closed
    2025-03-31T08:06:28.295Z [iMCP] [info] Client transport closed
    2025-03-31T08:06:28.295Z [iMCP] [info] Server transport closed unexpectedly, this is likely due to the process exiting early. I
    f you are developing this MCP server you can add output to stderr (i.e. `console.error('...')` in JavaScript, `print('...', fil
    e=sys.stderr)` in python) and it will appear in this log.
    2025-03-31T08:06:28.295Z [iMCP] [error] Server disconnected. For troubleshooting guidance, please visit our [debugging document
    ation](https://modelcontextprotocol.io/docs/tools/debugging) {"context":"connection"}
    2025-03-31T08:06:28.298Z [iMCP] [info] Server transport closed
    2025-03-31T08:06:28.298Z [iMCP] [info] Client transport closed
    
  11. sushantsp commented on Apr 5, 2025

    @sushantsp

    I am on windows. struggling with the same issue.

    2025-04-05T05:27:49.992Z [info] [count-r] Initializing server...
    2025-04-05T05:27:50.163Z [info] [count-r] Server started and connected successfully
    2025-04-05T05:27:50.181Z [info] [count-r] 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-04-05T05:27:51.864Z [info] [count-r] Server transport closed
    2025-04-05T05:27:51.865Z [info] [count-r] Client transport closed
    2025-04-05T05:27:51.866Z [info] [count-r] 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-04-05T05:27:51.867Z [error] [count-r] Server disconnected. For troubleshooting guidance, please visit our [debugging documentation](https://modelcontextprotocol.io/docs/tools/debugging)
    2025-04-05T05:27:51.868Z [info] [count-r] Client transport closed
    2025-04-05T05:31:33.814Z [info] [count-r] Initializing server...
    2025-04-05T05:31:33.930Z [info] [count-r] Server started and connected successfully
    2025-04-05T05:31:33.935Z [info] [count-r] 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-04-05T05:31:35.076Z [info] [count-r] Server transport closed
    2025-04-05T05:31:35.077Z [info] [count-r] Client transport closed
    2025-04-05T05:31:35.078Z [info] [count-r] 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-04-05T05:31:35.079Z [error] [count-r] Server disconnected. For troubleshooting guidance, please visit our [debugging documentation](https://modelcontextprotocol.io/docs/tools/debugging)
    2025-04-05T05:31:35.080Z [info] [count-r] Client transport closed
    2025-04-05T05:32:22.708Z [info] [count-r] Initializing server...
    2025-04-05T05:32:22.990Z [info] [count-r] Server started and connected successfully
    2025-04-05T05:32:22.993Z [info] [count-r] 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-04-05T05:32:23.866Z [info] [count-r] Server transport closed
    2025-04-05T05:32:23.866Z [info] [count-r] Client transport closed
    2025-04-05T05:32:23.868Z [info] [count-r] 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-04-05T05:32:23.869Z [error] [count-r] Server disconnected. For troubleshooting guidance, please visit our [debugging documentation](https://modelcontextprotocol.io/docs/tools/debugging)
    2025-04-05T05:32:23.869Z [info] [count-r] Client transport closed
    2025-04-05T12:08:57.634Z [info] [count-r] Initializing server...
    2025-04-05T12:08:57.925Z [info] [count-r] Server started and connected successfully
    2025-04-05T12:08:57.928Z [info] [count-r] 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-04-05T12:08:59.648Z [info] [count-r] Server transport closed
    2025-04-05T12:08:59.648Z [info] [count-r] Client transport closed
    2025-04-05T12:08:59.649Z [info] [count-r] 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-04-05T12:08:59.650Z [error] [count-r] Server disconnected. For troubleshooting guidance, please visit our [debugging documentation](https://modelcontextprotocol.io/docs/tools/debugging)
    2025-04-05T12:08:59.651Z [info] [count-r] Client transport closed
    2025-04-05T12:21:11.236Z [info] [count-r] Initializing server...
    2025-04-05T12:21:11.324Z [info] [count-r] Server started and connected successfully
    2025-04-05T12:21:11.333Z [info] [count-r] 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-04-05T12:21:11.771Z [info] [count-r] Server transport closed
    2025-04-05T12:21:11.772Z [info] [count-r] Client transport closed
    2025-04-05T12:21:11.773Z [info] [count-r] 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-04-05T12:21:11.774Z [error] [count-r] Server disconnected. For troubleshooting guidance, please visit our [debugging documentation](https://modelcontextprotocol.io/docs/tools/debugging)
    2025-04-05T12:21:11.774Z [info] [count-r] Client transport closed
    2025-04-05T12:22:55.312Z [info] [count-r] Initializing server...
    2025-04-05T12:22:55.754Z [info] [count-r] Server started and connected successfully
    2025-04-05T12:22:55.766Z [info] [count-r] 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-04-05T12:22:56.909Z [info] [count-r] Server transport closed
    2025-04-05T12:22:56.910Z [info] [count-r] Client transport closed
    2025-04-05T12:22:56.911Z [info] [count-r] 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-04-05T12:22:56.912Z [error] [count-r] Server disconnected. For troubleshooting guidance, please visit our [debugging documentation](https://modelcontextprotocol.io/docs/tools/debugging)
    2025-04-05T12:22:56.913Z [info] [count-r] Client transport closed```
    
  12. hellloWaleed commented on Apr 8, 2025

    @hellloWaleed

    Did anyone find out the solution to this one? I am getting the exact same error on MacOS.
    Trying to run the sample weather example from the docs, not working out of the box. Would love to know if someone made a progress.
    Cheers!

  13. mluisbrown commented on Apr 8, 2025

    @mluisbrown
    Contributor

    After re-installing iMCP I had it working briefly, but the next time I launched Claude Desktop, the same connection errors returned 😕

  14. ansemin commented on Apr 29, 2025

    @ansemin

    Does anyone know how to debug this error -- I am developiipnng my own server and I got the same error

    2025-04-29T10:24:20.275Z [info] [mcp-datasaur] Initializing server...
    2025-04-29T10:24:20.323Z [info] [filesystem] Server started and connected successfully
    2025-04-29T10:24:20.330Z [info] [mcp-datasaur] Server started and connected successfully
    2025-04-29T10:24:20.347Z [info] [jetbrains] Server started and connected successfully
    2025-04-29T10:24:20.437Z [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-04-29T10:24:20.439Z [info] [mcp-datasaur] 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-04-29T10:24:20.439Z [info] [jetbrains] 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-04-29T10:24:20.476Z [info] [mcp-datasaur] Server transport closed
    2025-04-29T10:24:20.476Z [info] [mcp-datasaur] Client transport closed
    2025-04-29T10:24:20.476Z [info] [mcp-datasaur] 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-04-29T10:24:20.476Z [error] [mcp-datasaur] Server disconnected. For troubleshooting guidance, please visit our debugging documentation
    2025-04-29T10:24:20.477Z [info] [mcp-datasaur] Client transport closed

  15. tjduarte commented on Apr 29, 2025

    @tjduarte

    Something that worked for me was to launch the Claude Desktop application directly from a terminal instead of the UI.

    open ~/../../Applications/Claude.app

  16. mattt commented on May 7, 2025

    @mattt
    Owner

    Hey again 👋 I just merged #62, which should significantly improve reliability connecting to MCP clients. Please give the latest version (1.1.1) a try and let me know if that's working any better for you. Thanks!

  17. mluisbrown commented on May 7, 2025

    @mluisbrown
    Contributor

    Hey! Thanks for the update - it now seems to be way more reliable 🚀

  18. stephengilroy commented on May 8, 2025

    @stephengilroy

    Wow! HUGE improvement. It was essentially unusable before and since the update I haven't had a disconnect yet. Nice work!

  19. steve96jones-hue commented on Apr 7, 2026

    @steve96jones-hue

    Still happening on v1.4.0 (macOS 26, April 2026)

    Experiencing recurring Bonjour service discovery timeouts — identical symptoms to the original report. Happens every few days unpredictably.

    Logs show:

    • Bonjour: Service discovery timed out after 30 seconds — multiple instances per session
    • Hundreds of Network handler failed: connectionClosed flooding simultaneously when the connection drops
    • ServiceGroupError: A service has finished unexpectedly fatal crash on stdin closure

    Workaround: Quit iMCP → wait 5s → relaunch. Works every time, but the bug returns within hours/days.

    Environment: macOS 26, iMCP v1.4.0, Claude Desktop (Cowork mode via MCP)

  20. denysgaievskyi commented on Jun 9, 2026

    @denysgaievskyi

    Same timeout here on macOS 26.5.1, iMCP 1.4.1 (build 11). It comes down to a dual-stack mismatch: the app advertises over IPv6 but only binds IPv4.

    The listener is IPv4 loopback only, and it's serving fine there:

    $ lsof -nP -p $(pgrep -x iMCP) | grep LISTEN
    iMCP ... TCP *:54091 (LISTEN)        # tcp4 only
    $ curl -i http://127.0.0.1:54091/
    curl: (1) Received HTTP/0.9 when not allowed   # app is up on IPv4
    

    But Bonjour resolves the service host to IPv6 only, with no A record:

    $ dns-sd -G v4v6 mymac.local
    ... ::1
    ... fe80::1%lo0
    ... fe80::...%en0
    $ curl http://[::1]:54091/
    curl: (7) Couldn't connect to server
    

    So imcp-server discovers the service, gets an IPv6 address, dials [::1]:port, and gets refused because the listener is IPv4-only. The client never sees an initialize response, so Claude times out after 60s with "Server disconnected".

    imcp-server has no endpoint override (Bonjour is the only discovery path), so there's no client-side workaround short of forcing an IPv4 A record into resolution. The fix is app-side: bind dual-stack (or IPv6 too), or publish an IPv4 A record for the advertised host.

    For context, this is a Jamf-managed Mac, so the service registers under the machine hostname rather than "iMCP" (see #143), and there are a few utun interfaces present. The resolved address is loopback ::1 though, not an interface-scoped one, so it looks separate from the bridge-interface case in #142.

  21. pdazero commented on Aug 18, 2026

    @pdazero

    For the Cowork-mode report above ("Quit iMCP → wait 5s → relaunch. Works every time, but the bug returns within hours/days") — that pattern is a resource leak, and I think I found it. Posted the full diagnosis in #178; short version here.

    iMCP.app runs out of file descriptors. It never closes its side of a client socket, so every imcp-server that disconnects leaks one descriptor permanently. On my machine (1.4.1, macOS 26.5) the app had 247 sockets stuck in CLOSE_WAIT with its highest fd at 255, against a launchctl limit maxfiles soft limit of 256. Its log said Too many open files, and from then on every new connection got an RST within 30 ms — which the client reports as Network handler failed: connectionClosed → Connection closed, terminating....

    That's why quitting and relaunching always works (it frees the descriptors) and why it always comes back (they leak again). The app tolerates ~248 connections over its whole lifetime, so the failure tracks connection count since launch rather than any specific action.

    To reproduce the leak without an MCP client: lsof -nP -p $(pgrep -x iMCP) -a -i, open a TCP connection to the app's listening port, close it from the client side, and look again — the app's descriptor for it sits in CLOSE_WAIT forever.

    Two things that make it bite harder in Cowork mode specifically:

    • Claude Desktop starts a separate copy of the server for its Cowork and Code sessions, which multiplies connections. The failure is asymmetric — the chat session keeps working because its connection predates exhaustion, while the others report Couldn't start this server for Cowork and Code sessions (they run their own copy of it), so they can't use its tools: Connection closed.
    • Orphaned imcp-server processes (PPID 1) retry forever — I found 7 in SYN_SENT 18 hours after the client had closed them (the inverted exit paths from Fix CLI dropping connection instead of reconnecting mid-session grlee/iMCP#1). When the app relaunches, they burn all ~248 descriptors in under a second: my log shows C24→C248 opening within 0.7 s, five seconds after launch.

    So the relaunch workaround holds much longer if you kill the PPID-1 orphans before restarting the app (leaving the one parented by Claude's disclaimer --pgroup helper alone, since it exits cleanly on its own).

    Note this is a different bug from #174, which leaks unix sockets from the helper into mDNSResponder and takes down system-wide DNS.

  22. mattt commented on Sep 17, 2026

    @mattt
    Owner

    Closing this one out. It has collected several different problems over the past year and a half, and 1.5.0 addresses the ones reported here since spring: the reconnect loop and the socket pile-up that @pdazero traced (#178, fixed by #208 and #225), the approval dialog racing the setup timeout (#193, fixed by #200), the DNS-SD handle leak that broke DNS machine-wide (#192, fixed by #199), and the ServiceGroupError crash on stdin closure (#208).

    The IPv6/IPv4 mismatch @denysgaievskyi described isn't something I've reproduced yet. If it still happens on 1.5.0, please open a new issue with the dns-sd and lsof output so it gets its own thread rather than this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions