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
43 changes: 43 additions & 0 deletions .github/workflows/conformance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Conformance

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: conformance-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
POWERSHELL_TELEMETRY_OPTOUT: '1'
DOTNET_CLI_TELEMETRY_OPTOUT: '1'
DOTNET_NOLOGO: '1'

jobs:
conformance:
name: Conformance (2026-07-28)
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install PowerShell 7.4
uses: ./.github/actions/install-pwsh
with:
version: '7.4.20'
- name: Node.js version
run: node --version && npm --version
- name: Run the conformance suite (server and client legs)
shell: pwsh
run: ./build.ps1 -Bootstrap -Task Conformance
- name: Upload conformance results
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: conformance-results
path: output/conformance/
if-no-files-found: warn
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,41 @@ support, dependency and breaking-change policy.

### Added

- Milestone M2 (Streamable HTTP): `Start-McpServer -Transport Http -Url ...` serves the MCP endpoint on
`System.Net.HttpListener`: one JSON-RPC request or notification per POST, responses as a single JSON
object or as a request-scoped SSE stream (progress and log notifications, keep-alive comments, a closed
stream cancels the handler), validation of `MCP-Protocol-Version`, `Mcp-Method`, `Mcp-Name` and
`Mcp-Param-*` against the body including the `=?base64?...?=` sentinel (`-32020`, HTTP 400), `Host` (404)
and `Origin` validation (403, `-AllowedOrigins`), 405 for GET and DELETE, 404 for unknown and removed methods, 202 for
notifications, body limits (`-MaxBodyBytes`) and `-KeepAliveSeconds`.
- `Connect-McpServer -Url` (with `-Headers` and `-NoProxy`): the Streamable HTTP client on `HttpClient` with
the request metadata headers, an SSE reader, timeouts that close the response stream, and `x-mcp-header`
support: `Get-McpTool` excludes tools with invalid annotations (with a warning), `Invoke-McpTool` mirrors
annotated arguments into `Mcp-Param-*` headers and retries once after a header mismatch.
- `Register-McpTool -Header @{ Parameter = 'HeaderName' }` annotates the input schema with `x-mcp-header`;
annotations are validated on registration (field-name tokens, primitive types, uniqueness, reachability).
- Sessions carry `Endpoint`; error responses without a determinable request id omit the `id` member, as the
specification schema requires; `tools.listChanged` is advertised as false until `subscriptions/listen` lands.
- Conformance: `tests/Conformance/everything-server.ps1` and `everything-client.ps1`, the `Conformance` build
task (server and client legs of the pinned `@modelcontextprotocol/conformance` alpha against
`conformance-baseline.yml`), the `Conformance` workflow, and `examples/http-server.ps1`.
- Milestone M1 (protocol core, stdio, tools): the stateless 2026-07-28 lifecycle with `server/discover`,
per-request `_meta` validation (`-32602`, `-32022` with the supported versions), `tools/list` with cursor
pagination and caching hints, `tools/call` with JSON Schema validation of the arguments, typed parameter
binding, result shaping (text, JSON, `structuredContent`, `isError`), `outputSchema` checks,
`notifications/progress`, `notifications/message` on request and `notifications/cancelled`; handlers run in
a hostless runspace pool with per-request cancellation tokens and an optional server-side timeout.
- Server commands `New-McpServer`, `Register-McpTool` (functions, cmdlets, script files and script blocks;
schemas from parameters, validation attributes, comment-based help and defaults), `Start-McpServer`,
`Stop-McpServer`, `Invoke-McpToolHandler`; handler commands `New-McpContent`, `New-McpToolResult`,
`Write-McpProgress`, `Write-McpLog`, `Test-McpClientCapability`.
- Client commands `Connect-McpServer` (stdio server processes with captured stderr, or a server object over an
in-memory transport), `Disconnect-McpServer`, `Get-McpServerInfo`, `Get-McpTool`, `Invoke-McpTool` with
progress callbacks, log notifications, timeouts and cancellation; format views for the result objects.
- A System.Text.Json codec that keeps wire shapes (ordered, case-sensitive objects, arrays never unrolled,
request id types preserved), JSON Schema 2020-12 validation through the bundled JsonSchema.Net with a
PowerShell fallback validator, `McpProtocolException` as a type accelerator, `examples/echo-server.ps1`,
and a `Format` build task (Invoke-Formatter).
- Milestone M0 (foundation): the `ModelContextProtocol` module skeleton (PowerShell 7.4+, Core edition only,
no runtime dependencies), assembled from `src/` with ModuleBuilder; engine enums `McpEra` and
`McpLoggingLevel` exported through type accelerators.
Expand All @@ -28,3 +63,10 @@ support, dependency and breaking-change policy.
dry run and gated PowerShell Gallery publish; label sync; issue and pull request templates; Dependabot.
- Governance: roadmap, dependency and support policy, security policy, contributing guide, code of conduct,
conformance baseline file, documentation skeleton.

### Fixed

- The `Analyze` build task no longer fails or hangs on PSScriptAnalyzer's sporadic rule failures: every path is
analysed in a fresh process with a timeout, and files on which a rule failed are re-analysed in further fresh
processes.

7 changes: 4 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ follow. The design is described in [docs/implementation-plan.md](docs/implementa
## Prerequisites

- PowerShell 7.4 or later (7.4, 7.5 and 7.6 are tested in CI). Windows PowerShell 5.1 is not supported.
- Node.js 20 or later with `npx` for the conformance suite and the MCP Inspector (from milestone M2).
- Node.js 20 or later with `npx` for the conformance suite and the MCP Inspector.
- Build and test dependencies are installed by `./build.ps1 -Bootstrap` (see `requirements.psd1`). In
environments without access to the PowerShell Gallery, drop the `.nupkg` files into `tools/packages/` and
run `./build.ps1 -Bootstrap -DependencySource Offline` (see `tools/README.md`).
Expand All @@ -17,7 +17,7 @@ follow. The design is described in [docs/implementation-plan.md](docs/implementa
| Path | Content |
|---|---|
| `src/` | Module sources: `Enums/`, `Classes/` (numbered for deterministic order), `Private/`, `Public/` (one function per file, file name = function name), `Types/`, `Formats/`, `en-US/`, `Suffix.ps1`, `build.psd1` (ModuleBuilder settings) |
| `tests/` | Pester tests: `Unit/`, `Integration/`, `Spec/` (vendored schemas), `Compat/`, `Conformance/` (from M2), `Support/` |
| `tests/` | Pester tests: `Unit/`, `Integration/`, `Spec/` (vendored schemas), `Compat/`, `Conformance/` (fixtures of the conformance suite), `Support/` |
| `tools/` | Custom PSScriptAnalyzer rules, maintenance scripts, offline package drop folder |
| `docs/` | Concept documentation, generated command help, the implementation plan and research material |
| `output/` | Build output (ignored by git) |
Expand All @@ -27,6 +27,7 @@ follow. The design is described in [docs/implementation-plan.md](docs/implementa
```powershell
./build.ps1 -Bootstrap # install build dependencies (once)
./build.ps1 # Build: assemble output/ModelContextProtocol/<version>/
./build.ps1 -Task Format # Invoke-Formatter over the sources, in place
./build.ps1 -Task Analyze # PSScriptAnalyzer with the repository settings and custom rules
./build.ps1 -Task Test # Build + Pester (unit, integration, spec, compat)
./build.ps1 -Task Test -CodeCoverage # same, with JaCoCo coverage under output/coverage/
Expand Down Expand Up @@ -62,7 +63,7 @@ Tests import the built module, never `src/` directly. Set `MCP_MODULE_MANIFEST`
- Integration tests spawn real `pwsh` processes and use loopback HTTP; files go to `$TestDrive`.
- Specification tests derive expectations from the vendored `schema.json`; every schema definition receives a
constructor and a parser test as the type model grows (`tests/Spec/definitions-checklist.txt`).
- Conformance runs (from milestone M2) use the pinned `@modelcontextprotocol/conformance` version and
- Conformance runs (`./build.ps1 -Task Conformance`) use the pinned `@modelcontextprotocol/conformance` version and
`conformance-baseline.yml`; the baseline may only shrink.

## Pull requests
Expand Down
Loading
Loading