Skip to content

Is the server spawned from iOS, visible to other MCP clients? #111

Done

Description

@pmusolino

Hi there, and thank you for working on this SDK!

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:

{
  "mcpServers": {
    "Wormholy": {
      "command": "xcrun simctl launch --console booted YOUR_APP_BUNDLE_IDENTIFIER"
    }
  }
}

I wonder if there is a way to make the MCP server accessible via localhost on a specific port.

Here you can find my current implementation.

Thanks!

Activity

  1. stallent commented on May 9, 2025

    @stallent
    Contributor

    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?

  2. pmusolino commented on May 9, 2025

    @pmusolino
    Author

    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?

    Correct, but more then an iOS Device, just iOS simulator is enough for now.

  3. mattt commented on May 9, 2025

    @mattt
    Contributor

    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.

  4. stallent commented on May 9, 2025

    @stallent
    Contributor

    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)

  5. mattt commented on May 9, 2025

    @mattt
    Contributor

    ^ To that end, the built-in NetworkTransport might 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

  6. added
    question
    on May 9, 2025
  7. pmusolino commented on May 16, 2025

    @pmusolino
    Author

    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

  8. stallent commented on May 19, 2025

    @stallent
    Contributor

    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.

  9. jeanmatthieu commented on Dec 5, 2026

    @jeanmatthieu
    Contributor

    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.

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

    question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions