You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "eemario (via GitHub)" <gi...@apache.org> on 2026/10/20 11:28:56 UTC

[I] [Bug][docs][api][java][python] MCP server example from YAML API is not runnable [flink-agents]

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

   ### Search before asking
   
   - [x] I searched in the [issues](https://github.com/apache/flink-agents/issues) and found nothing similar.
   
   ### Description
   
   The `mcp_servers` example in the YAML API docs declares `clazz: mcp`, but no `mcp` alias has ever been registered in either loader, so the example is not runnable as written (found during the #1283 walkthrough). Python fails with `ValueError: Expected a Python module.ClassName`; the Java loader additionally rejects `mcp_servers` for `type: python`, so the example cannot work in a Java job under any `clazz` value.
   
   Two possible fixes:
   
   1. **Introduce an `mcp` alias** in both loaders — minimal change.
   2. **Make `clazz` optional for `mcp_servers`**, defaulting to the built-in `flink_agents.integrations.mcp.mcp.MCPServer` — the runtime and the `@MCPServer` annotation path already hardcode this class, so the field is redundant for this resource type.
   
   I'd lean toward option 2; option 1 remains the minimal fallback. Either fix also needs the Java `type: python` whitelist to admit `MCP_SERVER` — the runtime side is already ready, and decision models were admitted the same way. Until then, a docs hotfix can switch the example to the fully-qualified Python class name.
   
   ### How to reproduce
   
   1. Copy the `mcp_servers` example from the YAML API page as-is.
   2. Load it with the Python loader → `ValueError: Expected a Python module.ClassName`.
   3. Load it with the Java loader → `IllegalArgumentException: type='python' is not supported for mcp_server`.
   
   ### Version and environment
   
   main @ 742faf60. Python loader verified with the repo venv (Python 3.11); Java loader verified with JDK 17.
   
   ### 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: issues-unsubscribe@flink.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][docs][api][java][python] MCP server example from YAML API is not runnable [flink-agents]

Posted by "wenjin272 (via GitHub)" <gi...@apache.org>.
wenjin272 closed issue #1296: [Bug][docs][api][java][python] MCP server example from YAML API is not runnable
URL: https://github.com/apache/flink-agents/issues/1296


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org