wzhero1 commented on issue #762:
URL: https://github.com/apache/flink-agents/issues/762#issuecomment-4627779459
### Verification finding: Java MCP `timeout` parameter key mismatch
**Severity**: Bug (silent misconfiguration)
**Location**:
- Doc: `docs/content/docs/development/mcp.md` lines 56, 102, 163
- Test: `plan/src/test/java/.../AgentPlanDeclareMCPServerTest.java` line 79
- Implementation: `integrations/mcp/src/main/java/.../MCPServer.java` line
183
**Description**:
The documentation and test both use `addInitialArgument("timeout", 30)`, but
the Java `MCPServer` implementation reads the argument with key
`"timeoutSeconds"`:
```java
// MCPServer.java:183
Object timeoutArg = descriptor.getArgument(FIELD_TIMEOUT_SECONDS); //
"timeoutSeconds"
this.timeoutSeconds = timeoutArg instanceof Number
? ((Number) timeoutArg).longValue()
: DEFAULT_TIMEOUT_VALUE; // 30
```
When a user writes `addInitialArgument("timeout", 60)`, the value is
silently ignored and the default (30s) is used instead. The existing test
passes only because it sets the same value as the default.
**Note**: Python side is unaffected — `MCPServer.timeout` field name matches
directly.
**Suggested fix**: Either rename the Java field key to `"timeout"` for
consistency with Python and the doc, or update the doc and test to use
`"timeoutSeconds"`.
--
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]