GitHub user wenjin272 added a comment to the discussion: [Feature] Dynamic 
Runtime Loading and Refresh of MCP Tools and Prompts

Hi, @yanand0909 , thanks for preparing this document. The overall design looks 
good to me, including runtime discovering and dynamic refreshing. 

I have some comments about the details.

>  A new `ResourceProvider` that stores only MCP server configuration at 
> compile time and defers instantiation and discovery to runtime.

I think maybe we don't need to introduce a new type 
`MCPServerResourceProvider`.  Because `JavaResourceProvider` or 
`PythonResourceProvider` stores the same content with 
`MCPServerResourceProvider`.

The difference between `JavaResourceProvider` and `MCPServerResourceProvider` 
is `MCPServerResourceProvider` provide a extra method `discoverResources`. I 
think we can convert this method to a util static method.

The benefit is we don't need to modify the SerDe for resource provider.

> Add MCP resource discovery during open() and cleanup during close():

Currently the `MCPTool` and `MCPPrompt` are both `SerializableResource`. If we 
discovery and construct them during open, they don't need to be json 
serializable any more, which means `MCPServer` don't need to be json 
serializable any more. This allows we remove the JsonCreator of `MCPServer` and 
remove some unnecessary fields.

> 1.4 AgentPlan Cache Helper

In https://github.com/apache/flink-agents/pull/548, we have extracted 
`ResourceCache`. So this code may need move to `ResourceCache`.

> Part 2: Dynamic Refresh

Currently, user must register all the names of tools including mcp tools when 
declaring a chat model setup, which results in the inability to support 
scenarios where MCP tools are dynamically added or removed at runtime. After we 
support dynamic refresh of  mcp server, we may also support register a mcp 
server to chat model setup, rather than only support being precise down to each 
tool's name.

GitHub link: 
https://github.com/apache/flink-agents/discussions/543#discussioncomment-15970674

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to