Open
Conversation
744546b to
ffee57a
Compare
This reverts commit ee979ee43131b9475f948253a279964f81300063.
bb1d039 to
9588bf5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Approach
Following are changes introduced for gRPC Transport.
lowlevel/server. All the server changes are atfastmcp/serverlevelClientSessionAPIs and newGRPCTransportSessionAPIs are exactly same.GRPCTransportSessionfor client.Changes
Client
TransportSession-> which is a abstract class with common methods betweenJSONRPC TransportandGRPC TransportClientSessioninsideclient/session.pyinherits fromTransportSessionGRPCTransportSessioninherits and implements methods inTransportSessionabstract class.Server
grpcinside FastMCP(fastmcp/server.py) so that with one line change we are able to start a mcp server with gRPC Transport. (see example/grpc/server.py)GRPCSessionintroduced which helps support the existing APIs called using ctx[RequestContext] in tool definition.call_toolfunction in FastMCP changed take optionalrequest_contextsince RequestContext is created insidelowlevel/server, and this change allows to use the new request_context if passed, else uses the old flow.grpc.pyis introduced which is server side implementation of a gRPC AIO python serverOther
session_common.py- Common file is created to keep some common logic.ClientSessiontoTransportSessionpyproject.toml- add optional dependency forgrpcRun