modelcontextprotocol / modelcontextprotocol/php-sdk

[Schema] SEP-2106: Support JSON Schema 2020-12 vocabulary in SchemaGenerator (oneOf/anyOf/allOf/if-then-else/$ref)

Open
#356 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

2026-07-28 enhancement improves spec compliance needs design Schema
Dominant language
PHP
Stars
1.6k
Forks
173
Avg merge
2d 49m
Merged PRs (30d)
23

Description

Implements the vocabulary portion of SEP-2106 for the MCP Spec 2026-07-28 release.

Tracked by umbrella #337.

Spec summary

inputSchema keeps type: "object" required but accepts any JSON Schema 2020-12 vocabulary (oneOf/anyOf/allOf/not, if/then/else, $ref/$defs/$anchor).

PHP SDK changes

  • src/Capability/Discovery/SchemaGenerator.php and SchemaValidator.php need to emit/validate full JSON Schema 2020-12 composition, conditionals, $ref (same-document only by default).
  • #[Schema] attribute should accept composition keywords.
  • Reflection/DocBlock paths today produce simple {type, properties} only — extend to surface union types as oneOf/anyOf.

Related

  • Umbrella #337
  • Companion sub-issues: non-object outputSchema, $ref hardening

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with umbrella issue #337 and SEP-2106, then inspect src/Capability/Discovery/SchemaGenerator.php and SchemaValidator.php along with the #[Schema] attribute and reflection/DocBlock paths mentioned here. Map the existing simple schema flow before assessing how composition, conditionals, references, and union types should be surfaced and validated. Done means the listed JSON Schema 2020-12 vocabulary is supported across these paths without weakening same-document $ref defaults.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.