all: minor cleanup (#545)

Also fix a flaky test case in TestStreamableServerTransport.
This commit is contained in:
Robert Findley 2025-09-30 15:53:00 -04:00 • committed by GitHub
commit 6dbf6c6450
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -104,8 +104,12 @@ func (t *InMemoryTransport) Connect(context.Context) (Connection, error) {
return newIOConn(t.rwc), nil
}
// NewInMemoryTransports returns two [InMemoryTransports] that connect to each
// other.
// NewInMemoryTransports returns two [InMemoryTransport] objects that connect
// to each other.
//
// The resulting transports are symmetrical: use either to connect to a server,
// and then the other to connect to a client. Servers must be connected before
// clients, as the client initializes the MCP session during connection.
func NewInMemoryTransports() (*InMemoryTransport, *InMemoryTransport) {
c1, c2 := net.Pipe()
return &InMemoryTransport{c1}, &InMemoryTransport{c2}