-
Notifications
You must be signed in to change notification settings - Fork 552
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
I am trying to make multiple parallel calls to an MCP server over stdio transport. But that seems to throw an error sometimes. Should I instantiate a new client (and therefore server) for each request?
This is the error when reusing the same client object returned by McpClientFactory.CreateAsync() for multiple calls:
System.InvalidOperationException
The stream is currently in use by a previous operation on the stream.
at System.IO.StreamWriter.ThrowAsyncIOInProgress()
at System.IO.StreamWriter.WriteLineAsync(ReadOnlyMemory`1 buffer, CancellationToken cancellationToken)
at ModelContextProtocol.Protocol.Transport.StdioClientTransport.SendMessageAsync(IJsonRpcMessage message, CancellationToken cancellationToken)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working