Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ env:

jobs:
conformance:
name: Conformance (2026-07-28)
name: Conformance (2026-07-28 and 2025-11-25)
runs-on: ubuntu-latest
steps:
- name: Check out
Expand All @@ -31,7 +31,7 @@ jobs:
version: '7.4.20'
- name: Node.js version
run: node --version && npm --version
- name: Run the conformance suite (server and client legs)
- name: Run the conformance suite (server and client legs of both requirement sets)
shell: pwsh
run: ./build.ps1 -Bootstrap -Task Conformance
- name: Upload conformance results
Expand Down
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,34 @@ support, dependency and breaking-change policy.

### Added

- Milestone M5 (dual era): a server serves the `initialize` handshake of revisions 2025-11-25 and 2025-06-18
(and 2025-03-26 as a version string) next to the stateless 2026-07-28 core on the same process and endpoint.
`New-McpServer -SupportedVersions` now defaults to `2026-07-28, 2025-11-25, 2025-06-18`; the era of every
request is chosen from its `_meta` and its session. A legacy session negotiates version and capabilities
in `initialize`, answers `ping`, `logging/setLevel` (session-wide log notifications),
`resources/subscribe` and `resources/unsubscribe`, sends list changes and resource updates unsolicited,
and its results carry no `resultType`, `ttlMs` or `cacheScope` (unknown resources are `-32002`).
- In a legacy session `Request-McpElicitation`, `Request-McpSampling` and `Request-McpRoot` send
server-initiated requests and wait for the answer, so handlers are era-agnostic.
- Streamable HTTP legacy sessions: `Mcp-Session-Id` from `initialize`, the GET stream of a session, DELETE,
404 for unknown or expired sessions, JSON-RPC errors of a session with status 200, responses to
server-initiated requests accepted with 202; `Start-McpServer -SessionIdleTimeoutSeconds` and
`-MaxSessions` bound the sessions.
- Client: `Connect-McpServer -Era Auto|Modern|Legacy` (default Auto) detects the server's era with the
`server/discover` probe and falls back to `initialize`; the era of an HTTP endpoint is remembered. Legacy
sessions send `Mcp-Session-Id` and the negotiated `MCP-Protocol-Version`, answer the server's elicitation,
sampling, roots and ping requests with the `-OnElicitation`, `-OnSampling` and `-OnRoots` callbacks (on
stdio, response streams and the session's GET stream), map `Register-McpSubscription` to unsolicited
notifications and `resources/subscribe`, start a new session after HTTP 404, resume a response stream that
ends before its response with GET and `Last-Event-ID` after the announced retry time, and send DELETE on
disconnect. `Set-McpLogLevel` sets the log level in both eras (`logging/setLevel` in a legacy session).
- Conformance: the fixture server serves both requirement sets as one dual-era instance (new tools
`test_tool_with_logging`, `test_sampling`, `test_elicitation`, `test_elicitation_sep1034_defaults`,
`test_elicitation_sep1330_enums`, `test_reconnection` and the resource `test://watched-resource`); the
fixture client detects the era and fills forms from schema defaults; the `Conformance` task and workflow
run the 2026-07-28 and 2025-11-25 requirement sets. All 30 scored server scenarios of 2025-11-25 pass; the
client baseline still holds only the authorization scenarios.

- Milestone M4 (multi-round-trip requests and subscriptions): handlers ask for input with
`Request-McpElicitation` (form mode with the flat primitive schema subset, or URL mode),
`Request-McpSampling` and `Request-McpRoot`; the request is answered with an `InputRequiredResult`, and on
Expand Down Expand Up @@ -120,6 +148,13 @@ support, dependency and breaking-change policy.
- Governance: roadmap, dependency and support policy, security policy, contributing guide, code of conduct,
conformance baseline file, documentation skeleton.

### Changed

- A modern-only server answers `initialize` with `-32022` and the versions it supports instead of `-32601`;
`initialize` with the per-request `_meta` of 2026-07-28 is a request for a removed method (404, `-32601`).
- The SSE reader keeps the `id` and `retry` fields of events (for resumption) and passes priming events
with empty data on.

### Fixed

- A request id can be reused as soon as its response was sent; before, a request that arrived while the
Expand Down
5 changes: 3 additions & 2 deletions ModelContextProtocol.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ param(
[string[]] $TestTag,
[string[]] $ExcludeTestTag,
[string] $OutputDirectory = (Join-Path $PSScriptRoot 'output'),
[string[]] $ConformanceRequirements = @('2026-07-28'),
[string[]] $ConformanceRequirements = @('2026-07-28', '2025-11-25'),
[string[]] $ConformanceLeg,
[string] $ConformanceScenario
)
Expand Down Expand Up @@ -371,7 +371,8 @@ function Start-ConformanceServer {
$probe.Stop()
$pwsh = (Get-Process -Id $PID).Path
$script = Join-Path $script:TestsPath 'Conformance' 'everything-server.ps1'
$process = Start-Process -FilePath $pwsh -ArgumentList @('-NoLogo', '-NoProfile', '-NonInteractive', '-File', $script, '-Port', $port) -RedirectStandardError $LogPath -PassThru -NoNewWindow
# The dual-era fixture serves both requirement sets: 2026-07-28 statelessly, 2025-11-25 in legacy sessions.
$process = Start-Process -FilePath $pwsh -ArgumentList @('-NoLogo', '-NoProfile', '-NonInteractive', '-File', $script, '-Era', 'Dual', '-Port', $port) -RedirectStandardError $LogPath -PassThru -NoNewWindow
$deadline = [datetime]::UtcNow.AddSeconds(60)
while ([datetime]::UtcNow -lt $deadline) {
if ($process.HasExited) { throw "The conformance server exited with code $($process.ExitCode); see $LogPath." }
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@ PowerShell SDK for building and consuming [Model Context Protocol](https://model
and clients, targeting specification revision **2026-07-28** with dual-era support for 2025-11-25 and
2025-06-18.

> **Status: milestone M4 (input requests and subscriptions).** Servers expose PowerShell functions, cmdlets,
> **Status: milestone M5 (dual era).** Servers expose PowerShell functions, cmdlets,
> scripts and script blocks as tools, resources (fixed content, files, directories, handlers, RFC 6570
> templates) and prompts, with argument completion and caching hints, over stdio and Streamable HTTP with the
> stateless 2026-07-28 lifecycle (`server/discover`, per-request `_meta`, request metadata headers, progress,
> cancellation, log notifications). Handlers ask the user for input (elicitation) or the client for sampling
> and roots through multi-round-trip requests with a signed `requestState`; clients subscribe to list changes
> and resource updates with `subscriptions/listen`, and tools, resources and prompts can be registered while
> the server runs. The client side consumes all of it over both transports and caches results for the
> `ttlMs` the server sends. The official conformance suite runs in CI: every 2026-07-28 server scenario
> passes, and on the client side everything but authorization, which is listed in
> [conformance-baseline.yml](conformance-baseline.yml) and follows in M6. The milestones are in
> `ttlMs` the server sends. Both sides also speak the `initialize` handshake of 2025-11-25 and 2025-06-18:
> a server serves both eras on the same process and endpoint (legacy sessions with `Mcp-Session-Id`, GET
> stream, DELETE, server-initiated elicitation, sampling and roots requests), a client detects the era of the
> server and falls back to the handshake. The official conformance suite runs in CI for both requirement
> sets: every server scenario of 2026-07-28 and 2025-11-25 passes, and on the client side everything but
> authorization, which is listed in [conformance-baseline.yml](conformance-baseline.yml) and follows in M6.
> The milestones are in
> [ROADMAP.md](ROADMAP.md); the design is in [docs/implementation-plan.md](docs/implementation-plan.md).

## Requirements
Expand Down
4 changes: 2 additions & 2 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ against the requirement sets `2026-07-28` (37 server + 32 client scenarios) and
| **M2 Streamable HTTP (modern)** | HttpListener host, header validation, Origin allowlist, JSON/SSE selection, keep-alive, disconnect → cancel; client HTTP transport with SSE parser; conformance fixtures and workflow | Conformance 2026-07-28: `server-stateless`, `tools-list`, `tools-call-simple-text/-error/-with-progress`, `dns-rebinding-protection`, `http-header-validation`, `http-custom-header-server-validation`; client `tools_call`, `request-metadata`, `http-*`, `json-schema-ref-no-deref`; first `0.1.0-preview` on the PowerShell Gallery | Done (the Gallery preview is published from the release workflow by tagging `v0.1.0-preview1`) |
| **M3 Server primitives** | Resources (static, file, templates, blob), prompts, completion, pagination, caching fields, all content types, `structuredContent`/`outputSchema`, icons, annotations, `notifications/message`; client counterparts with TTL cache | `tools-call-image/-audio/-embedded-resource/-mixed-content`, `json-schema-2020-12`, `resources-*`, `sep-2164-resource-not-found`, `prompts-*`, `completion-complete`, `caching`; client `json-schema-2020-12-preservation` | Done |
| **M4 MRTR and subscriptions** | Input-required machinery with signed `requestState`, capability gating, elicitation validator, sampling and roots as input requests, client retry loop; `subscriptions/listen` on server and client, list-changed and resource-updated fan-out, dynamic registration | All 14 `input-required-result-*`; the `subscriptions/listen` checks of `server-stateless` (acknowledgement, subscription id, filter, tools and prompts list changes); client `sep-2322-client-request-state` | Done |
| **M5 Dual era** | Legacy session (`initialize`, `ping`, `logging/setLevel`, `resources/subscribe`, server-initiated requests, HTTP sessions, GET SSE, DELETE), era-aware serialization, client legacy lifecycle | `--requirements 2025-11-25`: server 30/30, client 18/18; 2026-07-28 still green on the dual-era instance | Planned |
| **M6 Authorization** | Client OAuth provider (discovery, PKCE, resource indicators, `iss`, CIMD/DCR/pre-registered clients, scope step-up, token store); server bearer middleware and protected-resource metadata; `requestState` encrypted (AES-GCM) and bound to the authenticated principal | All client `auth/*` scenarios of the 2026-07-28 requirement set | Planned |
| **M5 Dual era** | Legacy session (`initialize`, `ping`, `logging/setLevel`, `resources/subscribe`, server-initiated requests, HTTP sessions, GET SSE, DELETE), era-aware serialization, client era detection and legacy lifecycle (including SSE resumption with `Last-Event-ID`) | `--requirements 2025-11-25`: server 30/30, client 4/4 outside authorization (`initialize`, `tools_call`, `elicitation-sep1034-client-defaults`, `sse-retry`; the 14 `auth/*` scenarios of the set follow with M6); 2026-07-28 still green on the dual-era instance; compatibility matrix of the versioning page as Pester tests | Done |
| **M6 Authorization** | Client OAuth provider (discovery, PKCE, resource indicators, `iss`, CIMD/DCR/pre-registered clients, scope step-up, token store); server bearer middleware and protected-resource metadata; `requestState` encrypted (AES-GCM) and bound to the authenticated principal | All client `auth/*` scenarios of the 2026-07-28 and 2025-11-25 requirement sets | Planned |
| **M7 Extensions** | Tasks, Skills, Apps (server side), OAuth client credentials, enterprise-managed authorization | `tasks-*` (10), `auth/client-credentials-*`, `auth/enterprise-managed-authorization` | Planned |
| **M8 Developer experience and 1.0** | Discovery styles, launcher and client-configuration helpers, scaffolder, examples, PlatyPS help, concept documentation, performance pass | Empty baseline for both requirement sets; PowerShell Gallery release 1.0.0 | Planned |

Expand Down
5 changes: 3 additions & 2 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
Skip Pester tests with one of these tags.

.PARAMETER ConformanceRequirements
Requirement sets of the Conformance task (default: 2026-07-28). Each set runs the server and the client leg.
Requirement sets of the Conformance task (default: 2026-07-28 and 2025-11-25). Each set runs the server and
the client leg; both server legs run against the same dual-era fixture.

.PARAMETER ConformanceLeg
Restrict the Conformance task to the Server or the Client leg.
Expand Down Expand Up @@ -78,7 +79,7 @@ param(

[string[]] $ExcludeTestTag,

[string[]] $ConformanceRequirements = @('2026-07-28'),
[string[]] $ConformanceRequirements = @('2026-07-28', '2025-11-25'),

[ValidateSet('Server', 'Client')]
[string[]] $ConformanceLeg,
Expand Down
5 changes: 3 additions & 2 deletions conformance-baseline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
# pass + baselined = 1 (stale entry, remove it), pass + not baselined = 0.
#
# This file may only shrink. Version 1.0.0 requires empty lists for both requirement sets
# (2026-07-28 and 2025-11-25). The milestone that removes an entry is noted next to it (see ROADMAP.md);
# the 2025-11-25 requirement set is run from milestone M5 (dual era) on.
# (2026-07-28 and 2025-11-25). The milestone that removes an entry is noted next to it (see ROADMAP.md).
# Both requirement sets are run with this one baseline (from milestone M5 on, the server legs against the same
# dual-era fixture); the authorization scenarios below belong to both sets.
server: []
client:
# M6: authorization
Expand Down
Loading
Loading