Skip to content

[Server] Allow configuring the schema validator - #509

Merged
chr-hertel merged 2 commits into
modelcontextprotocol:mainfrom
steffans:main
Oct 5, 2026
Merged

chr-hertel merged 2 commits into
modelcontextprotocol:mainfrom
steffans:main

Conversation

@steffans

Copy link
Copy Markdown
Contributor

Adds Builder::setSchemaValidator() to configure the validator used for tools/call input-schema validation. The
configured validator is passed to CallToolHandler; without configuration, the existing default validator behavior
remains unchanged.

Motivation and Context

Custom schema resolver configuration, such as:

$resolver->registerPrefix('http://example.com/', '/path/to/dir');

allows schemas to resolve from local directories.

How Has This Been Tested?

Added a unit test that configures a custom SchemaValidator, performs a tool call, and verifies that the supplied
validator is invoked.

Breaking Changes

None

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

@chr-hertel chr-hertel added the Server Issues & PRs related to the Server component label Sep 14, 2026
@chr-hertel chr-hertel added the enhancement Request for a new feature that's not currently supported label Oct 5, 2026
@chr-hertel

Copy link
Copy Markdown
Member

Thanks @steffans!

@chr-hertel
chr-hertel merged commit 6f2f137 into modelcontextprotocol:main Oct 5, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Request for a new feature that's not currently supported Server Issues & PRs related to the Server component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants