You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Is the server spawned from iOS, visible to other MCP clients? #111
I'm integrating the MCP server into one of my open-source libraries, Wormholy. I want to make MCP Tools visible when an app using my library also imports this SDK. This would allow them to chat with the content of requests captured by Wormholy. However, I'm having difficulty testing the MCP with external tools like Goose or Claude Desktop.
Could you advise if my approach to implementing the MCP is correct? Also, do I need to specify how to locate the MCP server? I’ve tried several methods without success, such as:
Hi @pmusolino. I'm not familiar with the process of making inbound requests to an app running on the iOS simulator. A quick search pulled up a few articles, including this one.
If I were implementing this, the first thing I'd try is tunneling through a server on the public Internet, similar to how you might use ngrok to connect clients to a web app running on localhost. In that case, the process you'd be configuring in Claude Desktop or another client would be something closer to mcp-remote, connecting to that public API endpoint.
Yeah, the issue here is somewhat unrelated to MCP. Trying to do any sort of server on iOS is gonna be an uphill battle. If you can figure out how you want the networking to work (in a way you know is supportable and sustainable) cranking out a custom transport for this framework is pretty straight forward. (and happy to help on that aspect if needed)
Thanks to both of you for your suggestions! In the end, I tried an approach using TCP on this branch (https://github.com/pmusolino/Wormholy/tree/mcp-server) by creating a custom Transport. However, it doesn't seem to work well with MCP. While the service listens on that port, MCP clients generally cannot communicate via TCP. Ideally, a connection over HTTP would be better, but accepting inbound communications on iOS appears to be quite challenging in this regard.
I also looked into iMCP (very helpful, thanks), but since it's on Mac, the situation differs from the iOS simulator sandbox. @stallent, you definitely have more experience than me. I would really appreciate your help if you think this is feasible in some way. :D
If you want to use HTTP you will essentially need to host a web server in iOS that is available from outside of iOS. That specific task is (at least at the moment) beyond the scope of this framework imho. But... if you can get that part rolling in a way you are content to use, I can help figure out how to approach the custom transport you will need.
External MCP clients (Claude Desktop, etc.) connect over Streamable HTTP rather than raw TCP, so exposing a server hosted inside an iOS app requires an inbound HTTP listener backed by StatefulHTTPServerTransport or StatelessHTTPServerTransport. On rel/1.0.0 (#372), Examples/http-server provides a complete SwiftNIO HTTP adapter serving both protocol eras (#362) and all targets now build on iOS (#337) — see docs/protocol.md#transports. Closing as answered.
Activity
stallent commentedon May 9, 2025
However, I'm having difficulty testing the MCP with external tools like Goose or Claude Desktop.Just to clarify, are you wanting Claude Desktop to connect to Wormholy running on an iOS device?
pmusolino commentedon May 9, 2025
Correct, but more then an iOS Device, just iOS simulator is enough for now.
mattt commentedon May 9, 2025
Hi @pmusolino. I'm not familiar with the process of making inbound requests to an app running on the iOS simulator. A quick search pulled up a few articles, including this one.
If I were implementing this, the first thing I'd try is tunneling through a server on the public Internet, similar to how you might use ngrok to connect clients to a web app running on
localhost. In that case, the process you'd be configuring in Claude Desktop or another client would be something closer to mcp-remote, connecting to that public API endpoint.stallent commentedon May 9, 2025
Yeah, the issue here is somewhat unrelated to MCP. Trying to do any sort of server on iOS is gonna be an uphill battle. If you can figure out how you want the networking to work (in a way you know is supportable and sustainable) cranking out a custom transport for this framework is pretty straight forward. (and happy to help on that aspect if needed)
mattt commentedon May 9, 2025
^ To that end, the built-in
NetworkTransportmight give you everything you need. Or else, should serve as a good jumping off point.For reference, take a look at how iMCP works: https://github.com/loopwork-ai/iMCP?tab=readme-ov-file#app--cli
pmusolino commentedon May 16, 2025
Thanks to both of you for your suggestions! In the end, I tried an approach using TCP on this branch (https://github.com/pmusolino/Wormholy/tree/mcp-server) by creating a custom Transport. However, it doesn't seem to work well with MCP. While the service listens on that port, MCP clients generally cannot communicate via TCP. Ideally, a connection over HTTP would be better, but accepting inbound communications on iOS appears to be quite challenging in this regard.
I also looked into iMCP (very helpful, thanks), but since it's on Mac, the situation differs from the iOS simulator sandbox. @stallent, you definitely have more experience than me. I would really appreciate your help if you think this is feasible in some way. :D
stallent commentedon May 19, 2025
If you want to use HTTP you will essentially need to host a web server in iOS that is available from outside of iOS. That specific task is (at least at the moment) beyond the scope of this framework imho. But... if you can get that part rolling in a way you are content to use, I can help figure out how to approach the custom transport you will need.
jeanmatthieu commentedon Dec 5, 2026
External MCP clients (Claude Desktop, etc.) connect over Streamable HTTP rather than raw TCP, so exposing a server hosted inside an iOS app requires an inbound HTTP listener backed by
StatefulHTTPServerTransportorStatelessHTTPServerTransport. Onrel/1.0.0(#372),Examples/http-serverprovides a complete SwiftNIO HTTP adapter serving both protocol eras (#362) and all targets now build on iOS (#337) — seedocs/protocol.md#transports. Closing as answered.