Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions about getting started #37

Open
DePasqualeOrg opened this issue Mar 31, 2025 · 11 comments
Open

Questions about getting started #37

DePasqualeOrg opened this issue Mar 31, 2025 · 11 comments
Labels
question Further information is requested

Comments

@DePasqualeOrg
Copy link

Looking at the code examples provided in the readme, it's not clear to me how the client connects to servers. Is it assumed that the server is running on localhost, and the client automatically discovers the server?

If I understand correctly, remote servers are now (or will soon be) supported with MCP. Could you provide examples of connecting multiple remote servers to the client, if this is possible?

@mattt mattt added the question Further information is requested label Mar 31, 2025
@mattt
Copy link
Contributor

mattt commented Mar 31, 2025

Hi @DePasqualeOrg. Remote MCP servers are a new development. So far, this SDK has prioritized the stdio interface, which connects to a running local process. We're looking to add support for remote servers this week, and will be sure to provide documentation for all of that.

@stallent
Copy link

stallent commented Mar 31, 2025

@DePasqualeOrg its possible currently by writing your own Transport protocol implementations. We did this for both the client and server. Since the spec around networking has just recently been updated I'd wait just a tiny bit and let that settle or let @mattt get the formal support in. Speaking of... @mattt Pretty interested in seeing how you go about the network updates. We are running ours via Hummingbird so the Transport implementation for the server part ended up being pretty simple/small. May be cool to add a Hummingbird/Vapor examples as part of the network updates.

@DePasqualeOrg
Copy link
Author

Great, thanks! I'll keep an eye out for the upcoming changes.

@matthewnaples
Copy link

@mattt , When you built the iMPC app, why did you opt to use a NetworkTransport vs the stdio transport implementation? I'm not exactly sure when to use which. Also I'll put this in a new issue or on that repo if necessary, but figured it falls in line with "questions getting started"

@sebsto
Copy link

sebsto commented Mar 31, 2025

I also would love to see an example involving a Transport on Hummingbird.

@mattt
Copy link
Contributor

mattt commented Mar 31, 2025

@stallent

Pretty interested in seeing how you go about the network updates. We are running ours via Hummingbird so the Transport implementation for the server part ended up being pretty simple/small. May be cool to add a Hummingbird/Vapor examples as part of the network updates.

Yeah, that's probably what I'll end up doing here, too. I'm wary of how many dependencies we'll need to pull in to support HTTP transport, but that seems like the least bad option. (If it does prove onerous, maybe we could conditionalize with package traits).

Hummingbird seems like a reasonable choice, so I'll likely just go with that. For Vapor and other frameworks, we can provide documentation for implementing a custom transport.

/cc @sebsto

@matthewnaples

When you built the iMPC app, why did you opt to use a NetworkTransport vs the stdio transport implementation? I'm not exactly sure when to use which. Also I'll put this in a new issue or on that repo if necessary, but figured it falls in line with "questions getting started"

Yeah, iMCP is an interesting case that's hard to generalize from. Claude Desktop and other MCP clients need a command to run. For iMCP, that's the imcp-server executable that's embedded in the app bundle. imcp-server communicates with Claude Desktop over stdio, but we still need a way to communicate with the iMCP host application. My solution was to proxy stdio reads/writes over a local TCP connection between imcp-server and iMCP.

Once HTTP transport is more widely supported, we could simplify things by having iMCP run its own local MCP server over HTTP and have clients connect directly to that.

@sebsto
Copy link

sebsto commented Mar 31, 2025

I would love to investigate an AWS Lambda transport. Is there interest for that ?

@mattt
Copy link
Contributor

mattt commented Mar 31, 2025

@sebsto It looks like Hummingbird has an extension for Lambda, so that should be straightforward implementation. For this library, we'll probably stick to the official transports.

@stallent
Copy link

@mattt if it would be helpful to see my terrible Hummingbird implementation I'm happy to send it your way. The transport for it is really just an AsyncStream for bridging between the SSE handler i have in Hummingbird and your Server class. Honestly in these sort of environments i'm not really sure the Transport should have any networking responsibility in it at all. Thats so dependent on the deployment details.

@sebsto
Copy link

sebsto commented Apr 1, 2025

@mattt I understand that and I am in close touch with Adam and Joannis that developed that extension. While this extension is great to host unmodified Hummingbird apps on Lambda, it might be more efficient in terms of performance and costs. This extension requires an APIGateway as an HTTPS endpoint and convert all APIGateway HTTP Parameters to their hummingbird equivalent and back.

I'm one of the core maintainer of the Swift Runtime AWS Lambda. I am considering writing a native Lambda Transport to work with this implementation.

@Viva5649
Copy link

Viva5649 commented Apr 2, 2025

@mattt Hi, is it possible to use this SDK for MCP implementation within an iOS App? Assuming an object_1 of class_1 in the App acts as a MCP client, and an object_2 of class_2 acts as a MCP server, an object_3 of class_3 interact with LLM and MCP client.

If possible, I'm having trouble with getting start, like connect a client to a server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

6 participants