Uh oh!
There was an error while loading. Please reload this page.
Implement configuration function to customize MCP server - #3796
Conversation
camdecoster
left a comment
There was a problem hiding this comment.
I left a couple of suggestions, but nothing huge. Could you add a changelog entry for this update? Specifically describing the way the user facing API changed.
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.
| self._callback_list: list = [] | ||
| self.callback_api_paths: dict = {} | ||
| self.mcp_decorated_functions: dict = {} | ||
| self.mcp_callback_map: Any = None |
There was a problem hiding this comment.
| self.mcp_callback_map: Any=None | |
| self.mcp_callback_map: Optional["CallbackAdapterCollection"]=None |
There was a problem hiding this comment.
This is actually needs to be Any for now because of Python < 3.10.CallbackAdapterCollection imports from the mcp module which cannot be installed on 3.8. Therefore, if we import it here for typing, it will break on older python versions.
There was a problem hiding this comment.
Stupid backward compatibility!
Uh oh!
There was an error while loading. Please reload this page.
ee9afe7 to
c5c4829CompareUh oh!
There was an error while loading. Please reload this page.



This PR adds a function to configure the MCP server behaviour:
Rather than add a growing list of constructor args around the MCP server, this PR implements a single
configure_mcp_server()function that allows users to toggle various parts of the server with arguments:The existing
mcp_expose_docstringsconstructor arg has been removed and replaced by this function.