Schema Validator

The extension provides integration with the Vert.x JSON Schema library. When present, all client requests and notifications are validated against the relevant MCP JSON schema. Validation errors are transformed into protocol error messages with the JSON-RPC error code -32600 (INVALID_REQUEST). The error message includes the name of the schema type that failed validation, e.g. Schema validation failed - CallToolRequest: …​.

If you want to use the Schema Validator in your application you’ll need to add the io.quarkiverse.mcp:quarkus-mcp-server-schema-validator extension to your build file first. For instance, with Maven, add the following dependency to your POM file:

<dependency>
    <groupId>io.quarkiverse.mcp</groupId>
    <artifactId>quarkus-mcp-server-schema-validator</artifactId>
    <version>${quarkus-mcp.version}</version>
</dependency>

No further configuration is needed. Validations are performed automatically.

The extension includes MCP JSON schemas for the following protocol versions: 2024-11-05, 2025-03-26, 2025-06-18, and 2025-11-25. The appropriate schema is selected based on the protocol version negotiated during the client initialization.

Tool output validation

The MCP specification requires that a tool with an outputSchema returns a structuredContent that conforms to it. The extension also validates the result of every successful tools/call against the tool’s outputSchema before it is sent to the client, as the official TypeScript, Python, and Java SDKs do. If the structuredContent does not conform, or is missing although the tool declares an output schema, the result is replaced with a tool error (isError: true) whose text describes the violations, for example Output validation error: Invalid structured content for tool price: [/amount: …​], and a warning is logged. Results that are already tool errors are not validated, and neither are the results of tools without an output schema. Each tool’s output schema is compiled once, on first use. If an output schema cannot be compiled or applied, for example because of an unresolvable reference, a warning is logged and that tool’s results are not validated. The check is a global output guardrail with the lowest priority, so it runs after all other output guardrails and validates the result that is actually sent.

The behavior can be configured with quarkus.mcp.server.schema-validator.tools.output. See the configuration reference.

Tool input validation

The MCP specification requires servers to validate all tool inputs. The extension validates the arguments of every tools/call against the tool’s inputSchema before the tool is called, as the official TypeScript, Python, and Java SDKs do. Without this check, an argument that does not match the schema can still reach the tool after a lossy conversion, for example 2.7 for an integer parameter arrives as 2. If the arguments do not conform, the tool is not called. Instead, a tool error (isError: true) whose text describes the violations is returned, for example Input validation error: Invalid arguments for tool discount: [/percent: …​], so that the model can correct the arguments and retry, and a warning is logged. Each tool’s input schema is compiled once, on first use. If an input schema cannot be compiled or applied, for example because of an unresolvable reference, a warning is logged and that tool’s arguments are not validated. The check is a global input guardrail with the highest priority, so it runs before all other input guardrails and validates the arguments sent by the client.

The behavior can be configured with quarkus.mcp.server.schema-validator.tools.input. See the configuration reference.

The MCP server performs some basic validation of messages by default. However, this extension ensures that message instances are valid, as defined by the JSON Schema specification.