Repository navigation
Description
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.
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:
- The same issue happens after restarting my Mac (launch Claude, 60 seconds later this timeout happens)
- 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
mattt commentedon Mar 7, 2025
@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?
apike commentedon Mar 7, 2025
@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.
stephengilroy commentedon Mar 9, 2025
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!
mattt commentedon Mar 10, 2025
@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.
stephengilroy commentedon Mar 10, 2025
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 👍
apike commentedon Mar 10, 2025
Unfortunately that's not the issue for me, mine is running from
/Applications/iMCP.app/Contents/MacOS/imcp-server.apike commentedon Mar 21, 2025
@mattt Is there any location or mode to get more thorough logs from iMCP about why it may be timing out?
mattt commentedon Mar 21, 2025
@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.mluisbrown commentedon Mar 31, 2025
I have the same (or very similar) issue. I can't get it working at all :/
sushantsp commentedon Apr 5, 2025
I am on windows. struggling with the same issue.
hellloWaleed commentedon Apr 8, 2025
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!
mluisbrown commentedon Apr 8, 2025
After re-installing iMCP I had it working briefly, but the next time I launched Claude Desktop, the same connection errors returned 😕
ansemin commentedon Apr 29, 2025
Does anyone know how to debug this error -- I am developiipnng my own server and I got the same error
tjduarte commentedon Apr 29, 2025
Something that worked for me was to launch the Claude Desktop application directly from a terminal instead of the UI.
open ~/../../Applications/Claude.appmattt commentedon May 7, 2025
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!
mluisbrown commentedon May 7, 2025
Hey! Thanks for the update - it now seems to be way more reliable 🚀
stephengilroy commentedon May 8, 2025
Wow! HUGE improvement. It was essentially unusable before and since the update I haven't had a disconnect yet. Nice work!
steve96jones-hue commentedon Apr 7, 2026
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 sessionNetwork handler failed: connectionClosedflooding simultaneously when the connection dropsServiceGroupError: A service has finished unexpectedlyfatal crash on stdin closureWorkaround: 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)
denysgaievskyi commentedon Jun 9, 2026
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:
But Bonjour resolves the service host to IPv6 only, with no A record:
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
::1though, not an interface-scoped one, so it looks separate from the bridge-interface case in #142.pdazero commentedon Aug 18, 2026
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-serverthat disconnects leaks one descriptor permanently. On my machine (1.4.1, macOS 26.5) the app had 247 sockets stuck inCLOSE_WAITwith its highest fd at 255, against alaunchctl limit maxfilessoft limit of 256. Its log saidToo many open files, and from then on every new connection got an RST within 30 ms — which the client reports asNetwork 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 inCLOSE_WAITforever.Two things that make it bite harder in Cowork mode specifically:
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.imcp-serverprocesses (PPID 1) retry forever — I found 7 inSYN_SENT18 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 showsC24→C248opening within 0.7 s, five seconds after launch.So the relaunch workaround holds much longer if you
killthe PPID-1 orphans before restarting the app (leaving the one parented by Claude'sdisclaimer --pgrouphelper alone, since it exits cleanly on its own).Note this is a different bug from #174, which leaks unix sockets from the helper into
mDNSResponderand takes down system-wide DNS.mattt commentedon Sep 17, 2026
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
ServiceGroupErrorcrash 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-sdandlsofoutput so it gets its own thread rather than this one.