Matteo
12/05/2025, 1:24 PMoutputSchema.additionalProperties Must Be Boolean
Description:
I'm encountering a validation error when connecting to an MCP server via Streamable HTTP transport. The connection succeeds and ping works, but the listTools() call fails with a schema validation error.
Error Message:
Failed to connect to MCP server web-search: [
{
"code": "invalid_type",
"expected": "boolean",
"received": "object",
"path": [
"tools",
0,
"outputSchema",
"additionalProperties"
],
"message": "Expected boolean, received object"
}
]Matteo
12/05/2025, 1:24 PMhttp://ipaddress:80/mcp is returning tool definitions where outputSchema.additionalProperties is an object (e.g., { type: "string" }), but according to JSON Schema specification and the MCP SDK's validation, additionalProperties must be a boolean value (true or false).
Relevant Code:
The error occurs in the client connection flow:
- File: src/providers/mcp/client.ts (or .js in dist)
- Method: MCPClient.connectToServer()
- Line: Around line 203 (based on stack trace)
- Specific operation: After await client.connect(transport, requestOptions) succeeds and during await client.listTools(undefined, requestOptions)
The validation happens within the MCP SDK's listTools() method before the response is returned to the client code.
Question:
Is this a server-side issue that needs to be fixed in the MCP server implementation, or should the client SDK be more lenient and automatically coerce object-type additionalProperties to boolean true?
According to JSON Schema spec, additionalProperties as an object is valid (it defines a schema for additional properties), but the MCP SDK appears to only accept boolean values.
Configuration:
yaml
mcp:
enabled: true
debug: true
verbose: true
pingOnConnect: true
timeout: 120000
servers:
- name: web-search
type: "streamable-http"
url: "http://ipaddress:80/mcp"
Expected Behavior:
Either:
1. The MCP server should return additionalProperties: true (or false) instead of an object, OR
2. The MCP SDK should accept object-type additionalProperties and handle it appropriately
Workaround Needed:
Is there a way to intercept and sanitize the tool schemas before SDK validation, or does this need to be fixed at the server level?[Promptfoo] Faizan
12/05/2025, 6:35 PM