Skip to content

Conversation

nick-merrill
Copy link
Contributor

@nick-merrill nick-merrill commented Nov 4, 2024

Goal

Support running an MCP server in the same process as the client, while preserving MCP abstractions.

Details

  1. (core change) Adds a new memory transport module that enables in-process client-server communication.
    This includes:

    • create_client_server_memory_streams() to create bidirectional memory streams
    • create_connected_server_and_client_session() to establish an in-process client-server connection
  2. (minor) Enhances error handling and timeout support:

    • Adds configurable read timeouts to sessions via read_timeout_seconds parameter
    • Improves exception handling in the server with a new raise_exceptions flag to control whether errors are returned to clients or raised directly
    • Ensures proper cleanup of request context tokens in error cases
  3. (minor) Makes server improvements:

    • Adds built-in ping handler support

@nick-merrill nick-merrill marked this pull request as ready for review November 5, 2024 15:17
Copy link
Member

@jspahrsummers jspahrsummers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

successkid

self,
read_stream: MemoryObjectReceiveStream[JSONRPCMessage | Exception],
write_stream: MemoryObjectSendStream[JSONRPCMessage],
read_timeout_seconds: int | float | None = None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIOLI: Should this be a timedelta to avoid unit errors entirely?

@k6l3
Copy link
Contributor

k6l3 commented Nov 5, 2024

sweeeet

@nick-merrill nick-merrill force-pushed the merrill/mcp-memory-transport branch from 3849a4d to 5dd79b2 Compare November 5, 2024 19:59
@nick-merrill nick-merrill merged commit 60e9c7a into main Nov 5, 2024
5 checks passed
@nick-merrill nick-merrill deleted the merrill/mcp-memory-transport branch November 5, 2024 23:42
gspencergoog pushed a commit to gspencergoog/mcp-python-sdk that referenced this pull request Jul 29, 2025
…davidsp/more-docs

docs: Initial frame for the guide documentation
gspencergoog pushed a commit to gspencergoog/mcp-python-sdk that referenced this pull request Jul 29, 2025
…justin/update-servers-instructions

Remove `npm install -g` instruction
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