-
Notifications
You must be signed in to change notification settings - Fork 316
feat: implementing support for callbacks #328
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
Conversation
e193db7 to
d5971fb
Compare
christian-bromann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment, otherwise LGTM
| def __init__(self, connections: dict[str, Connection] | None = None) -> None: | ||
| def __init__( | ||
| self, | ||
| connections: dict[str, Connection] | None = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is called mcpServers in JS, do we want to align here? Happy to move to connections and deprecated mcpServer (but keep functionality alive)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
going to leave as is for now based on offline disc
Introduces a callback system for monitoring MCP server events during tool execution.
Callbacks contain context with server name and tool name and are applied to all servers for a given client.
New API:
Callbackshas the potential to be extended quite broadly to support a variety of notification hooks. We simply match signatures frommcp+ add a finalcontextarg which is easily extensible as well.What's Added:
CallbackContext- provides server/tool context to callbacksCallbacks- main configuration classLoggingMessageCallback&ProgressCallback- callback protocols w/ contextcallbacksparameter onMultiServerMCPClient