Skip to content

Conversation

@krickert
Copy link

This pull request updates the documentation and example code to consistently use the new ServerTransportSession and ClientTransportSession types instead of the previous ServerSession and ClientSession types. It also introduces a new experimental documentation file explaining advanced gRPC streaming and multiplexing patterns, and updates the main documentation index to reference these new resources. These changes improve clarity around transport session usage and highlight advanced features available with gRPC.

Session Type Migration (Most Important):

  • All server-side examples and documentation now use ServerTransportSession in place of ServerSession for type annotations in tool functions and context usage. (README.md, examples/snippets/servers/elicitation.py, examples/snippets/servers/lifespan_example.py, examples/snippets/servers/notifications.py) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]
  • All client-side examples and documentation now use ClientTransportSession in place of ClientSession for type annotations, function parameters, and session instantiation. (README.md, examples/clients/simple-auth-client/mcp_simple_auth_client/main.py, examples/clients/simple-chatbot/mcp_simple_chatbot/main.py, examples/snippets/clients/display_utilities.py, examples/snippets/clients/stdio_client.py) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14]

Documentation and Reference Updates:

  • Added a new experimental documentation file docs/experimental/grpc-streaming.md that explains advanced gRPC streaming, multiplexing, binary transfer, push notifications, and best practices for high-performance MCP usage.
  • Updated the main documentation index (docs/index.md) to reference the new gRPC transport and streaming documentation, and reordered the navigation for clarity.

These changes ensure that all examples and documentation are aligned with the latest transport session abstractions and highlight advanced usage patterns for developers adopting gRPC in MCP.

asheshvidyut and others added 27 commits November 12, 2025 14:18
- Proto definition (proto/mcp/v1/mcp.proto) with native streaming RPCs
- Python GrpcClientTransport implementing ClientTransportSession
- Streaming support for progress, parallel tools, chunked resources, watches
- Bidirectional Session RPC for complex agent interactions
- Implement Session stream for multiplexed requests/responses
- Add chunked resource reading via ReadResourceChunked RPC
- Add background resource watchers for push notifications
- Add proper gRPC error mapping to Python exceptions
- Generate proto stubs to src/mcp/v1/
- Add grpc optional dependency to pyproject.toml
- Add advanced streaming patterns documentation
- Update docs navigation with gRPC transport links
- Replace paginated List RPCs with streaming equivalents
- Simplify request/response structures by removing cursor fields
- Align with gRPC streaming best practices on branch `streaming-updates`
- Add `Open Questions` section in proto/README.md for stream vs pagination discussion
- Detail current implementation limits and considerations for true streaming
- Propose potential enhancements like client-requested limits and async generators in Server implementation
- Refine gRPC transport documentation on branch `streaming-updates`
- Implement `GrpcServerSession` for handling gRPC request contexts
- Add `McpGrpcServicer` for mapping MCP server methods to gRPC services
- Support unary and streaming RPCs for tools, resources, and prompts
- Provide bidirectional communication with `Session` stream
- Include helper methods for protobuf type conversions
- Add `start_grpc_server` to initialize gRPC server with optional TLS support
- Enhance logging and error handling for incomplete gRPC features
…s, prompts, and templates on branch `streaming-updates`

- Replace cursor-based pagination with streaming iterations
- Adjust return types to collect results from async streams
- Add warnings for unsupported cursor usage
- Enhance readability and maintain consistency across list methods
- Implement tests for gRPC server and client interactions
- Verify tool calls, resource management, progress tracking, and prompts consistency
- Ensure handling of errors and maintaining session health
…ests for gRPC module on branch `streaming-updates`
…tions in `proto/README.md` on branch `streaming-updates`

- Introduce a memory-efficient streaming alternative to existing `ClientTransportSession` methods
- Ensure backward compatibility with existing implementations
- Pose open design questions about streaming abstraction
@maxisbey
Copy link
Contributor

Hey! I appreciate the work you've put into this but unfortunately I'm going to close this PR for a few reasons:

  • As per the CONTRIBUTING.md file, all PRs require an issue, and must get maintainer approval before a PR a should be made. Especially for large changes like this PR brings
  • This is a brand new transport which is not part of the MCP Specification, so we can't really add it to the repo. Ideally you implement this in a separate package if you're wanting to use it
  • Huge changes like this add maintenance burden and would generally require a lot of buy-in when it's not something laid out in the spec

@maxisbey maxisbey closed this Jan 23, 2026
@Kludex Kludex mentioned this pull request Jan 23, 2026
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants