Replies: 1 comment
|
its one json-rpc session request ids are unique pendingResponses is ConcurrentHashMap so parallel callTool is intended sampling rides the same session keep your sampling handler thread-safe the client itself is fine if the server keeps cwd or open files concurrent mutating tools can still collide thats the server for chapter summarize one client is enough dont new a client per chapter thats just extra initialize |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Pre-submission Checklist
Question Category
Your Question
I am a bit unsure on how the MCP Client should be used in an application that runs an agent concurrently. (E.g. Summarizing a book by summarizing each chapter concurrently). Following the example: Is the idea that each Chapter summarizing call should have its own McpAsyncClient? It feels a bit weird to have multiple instances of an McpAsyncClient for the same agent. On the other Hand I was unsure if stateful MCP features like sampling would be thread safe.
Is there an official guideline? I couldn't find information about this.
All reactions