alnzng opened a new issue, #246:
URL: https://github.com/apache/flink-agents/issues/246

   ### Search before asking
   
   - [x] I searched in the 
[issues](https://github.com/apache/flink-agents/issues) and found nothing 
similar.
   
   ### Description
   
   The `MCPServer` hasn't implemented the `close` function, however the 
`agent_plan` call the `close` function in `_add_mcp_server` method.
   
   ```
   2025-10-03 10:23:15,749 - INFO - HTTP Request: DELETE 
http://127.0.0.1:8000/mcp "HTTP/1.1 200 OK"
   Traceback (most recent call last):
     File 
"/Users/alazhang/Workspaces/Java/flink-agents/python/flink_agents/e2e_tests/mcp/mcp_example.py",
 line 142, in <module>
       output_list = env.from_list(input_list).apply(agent).to_list()
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/Users/alazhang/Workspaces/Java/flink-agents/python/flink_agents/runtime/local_execution_environment.py",
 line 67, in apply
       self.__runner = LocalRunner(agent, self.__config)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/Users/alazhang/Workspaces/Java/flink-agents/python/flink_agents/runtime/local_runner.py",
 line 202, in __init__
       self.__agent_plan = AgentPlan.from_agent(agent, config)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/Users/alazhang/Workspaces/Java/flink-agents/python/flink_agents/plan/agent_plan.py",
 line 136, in from_agent
       for provider in _get_resource_providers(agent):
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/Users/alazhang/Workspaces/Java/flink-agents/python/flink_agents/plan/agent_plan.py",
 line 317, in _get_resource_providers
       _add_mcp_server(name, resource_providers, mcp_server)
     File 
"/Users/alazhang/Workspaces/Java/flink-agents/python/flink_agents/plan/agent_plan.py",
 line 375, in _add_mcp_server
       mcp_server.close()
       ^^^^^^^^^^^^^^^^
     File 
"/Users/alazhang/Workspaces/Java/flink-agents/python/.venv/lib/python3.11/site-packages/pydantic/main.py",
 line 989, in __getattr__
       raise AttributeError(f'{type(self).__name__!r} object has no attribute 
{item!r}')
   AttributeError: 'MCPServer' object has no attribute 'close'
   ```
   
   ### How to reproduce
   
   Run an end-to-end MCP example
   
   ### Version and environment
   
   `0.1.0`
   
   ### Are you willing to submit a PR?
   
   - [x] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to