Repository navigation
Commit 660de90
feat: add extensions to ClientCapabilities
Add the optional `extensions` field to `ClientCapabilities`, mirroring the
MCP extensions framework (SEP-2133) as declared in the draft schema and
already shipped by the TypeScript, Python, C#, Go, Rust, and Kotlin SDKs.
Keys are extension identifiers (e.g.
"io.modelcontextprotocol/oauth-client-credentials") and values are
per-extension settings objects; an empty object indicates support with no
settings. The field is optional, defaults to null, and is omitted from the
wire when unset, so it is backward compatible with existing peers.
Follows CONTRIBUTING.md "Evolving wire-serialized records" Case A: the new
component is appended, annotated with @JsonProperty, boxed/nullable, and the
prior 4-arg constructor is retained as a source-compatible overload. Adds a
builder `extensions(Map)` setter plus an `extension(id, settings)` helper
that normalizes null settings to an empty object. Includes the required
absent/omit/unknown-field tests plus a round-trip test in SchemaEvolutionTests.
Refs modelcontextprotocol#785
Co-Authored-By: Claude Opus 4.8 <[email protected]>1 parent fd00498 commit 660de90
2 files changed
Lines changed: 77 additions & 2 deletions
File tree
- mcp-core/src/main/java/io/modelcontextprotocol/spec
- mcp-test/src/test/java/io/modelcontextprotocol/spec
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
577 | 577 | | |
578 | 578 | | |
579 | 579 | | |
| 580 | + | |
| 581 | + | |
580 | 582 | | |
581 | 583 | | |
582 | 584 | | |
583 | 585 | | |
584 | 586 | | |
585 | 587 | | |
586 | 588 | | |
587 | | - | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
588 | 597 | | |
589 | 598 | | |
590 | 599 | | |
| |||
723 | 732 | | |
724 | 733 | | |
725 | 734 | | |
| 735 | + | |
| 736 | + | |
726 | 737 | | |
727 | 738 | | |
728 | 739 | | |
| |||
765 | 776 | | |
766 | 777 | | |
767 | 778 | | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
768 | 800 | | |
769 | | - | |
| 801 | + | |
770 | 802 | | |
771 | 803 | | |
772 | 804 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
146 | 189 | | |
147 | 190 | | |
148 | 191 | | |
| |||
0 commit comments