Skip to content

feat: add PseudoTransport for in-process MCP client-server communication #372

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pluveto
Copy link

@pluveto pluveto commented Apr 20, 2025

Add PseudoTransport class for in-process MCP client-server communication.

Motivation and Context

This change introduces a PseudoTransport implementation that allows an MCP client to communicate directly with an McpServer instance within the same process, bypassing network or stdio layers.

How Has This Been Tested?

  • Used in local unit and integration tests to verify client-server interactions without network dependencies.
  • Tested scenarios include message exchange, error propagation, connection lifecycle (start, send, close), and handler registration.
  • Confirmed compatibility with existing MCP client and server APIs.

Breaking Changes

No breaking changes.
This is a new feature and does not affect existing APIs or configurations.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

  • The PseudoTransport class implements the Transport interface and can be used as a drop-in replacement for network transports in test or embedded environments.
  • Server lifecycle management remains external to the transport, allowing flexible ownership patterns.
  • All message delivery is asynchronous to simulate realistic client-server behavior.
  • No external dependencies added.

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.

1 participant