Uh oh!
There was an error while loading. Please reload this page.
MCP Server Part 2: Represent callback-related data with a CallbackAdapter - #3711
Conversation
Thank you for your contribution to Dash! 🎉 This PR is exempt from requiring a linked issue due to its labels. |
42aa12d to
0334a96Comparec6cbe97 to
cd073cfComparecd073cf to
74cd477CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| return None | ||
| def _coerce_value(value: Any) -> Any: |
There was a problem hiding this comment.
Could add a generic here [TInput, TOutput]
There was a problem hiding this comment.
Even better: this function wasn't really needed anymore as most usages had been refactored away. I just refactored its last remaining user and this function is now removed.
| class CallbackExecutionError(MCPError): | ||
| """Callback raised an exception during execution.""" | ||
| code = -32603 |
There was a problem hiding this comment.
What are these code? This one has the same code as the base MCPError
There was a problem hiding this comment.
These are standard JSON-RPC error codes, as per the MCP spec on error handling.
I removed the redundant one.
Uh oh!
There was an error while loading. Please reload this page.
Summary
CallbackAdapter: wraps a Dash callback and exposes MCP-related metadata (computed lazily)CallbackAdapterCollectionfor working with collections of adaptersmcp_enabledparameter to@app.callback()for opting callbacks out of MCPmcp>=1.0.0to dependenciesManual testing
CallbackAdapterexposesrun_callback(which is what MCP will do)