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
18 changes: 9 additions & 9 deletions pkgs/mcpx/docs/spec/conformance-matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Generated by `internal/conformance` (`MCPX_UPDATE_MATRIX=1 go test ./internal/conformance -run TestMatrix`); do not edit.

Generated from inputs `70ec5ae69355b628` (sha256 of docs/spec/requirements.md, internal/conformance/overrides/*.json, internal/conformance/coverage*.go, internal/conformance/authsplit.json). `TestMatrix` regenerates this file and fails when it differs, so it describes the tree it is committed in.
Generated from inputs `e9412930e5a01e78` (sha256 of docs/spec/requirements.md, internal/conformance/overrides/*.json, internal/conformance/coverage*.go, internal/conformance/authsplit.json). `TestMatrix` regenerates this file and fails when it differs, so it describes the tree it is committed in.

Every normative requirement of every revision (catalogue: `docs/spec/requirements.md`), for mcpx as a server and as a client. A requirement is *tested* when a named test verifies it in that revision, *n/a* when it does not bind mcpx in that role, and a *gap* when it binds mcpx and mcpx does not meet it yet, with the issue that tracks it. Run exactly the covering tests with `go run ./internal/conformance/cmd/covering`.

Expand All @@ -25,7 +25,7 @@ Every normative requirement of every revision (catalogue: `docs/spec/requirement
| 2025-03-26 | server | MUST | 44 | 43 | 1 | 0 | 37 |
| 2025-03-26 | server | MUST NOT | 7 | 7 | 0 | 0 | 8 |
| 2025-03-26 | server | SHOULD | 45 | 44 | 1 | 0 | 58 |
| 2025-03-26 | server | SHOULD NOT | 4 | 3 | 1 | 0 | 1 |
| 2025-03-26 | server | SHOULD NOT | 4 | 4 | 0 | 0 | 1 |
| 2025-03-26 | server | MAY | 16 | 16 | 0 | 0 | 21 |
| 2025-03-26 | server | other | 11 | 11 | 0 | 0 | 1 |
| 2025-03-26 | client | MUST | 35 | 33 | 2 | 0 | 46 |
Expand All @@ -37,7 +37,7 @@ Every normative requirement of every revision (catalogue: `docs/spec/requirement
| 2025-06-18 | server | MUST | 53 | 52 | 1 | 0 | 48 |
| 2025-06-18 | server | MUST NOT | 10 | 10 | 0 | 0 | 8 |
| 2025-06-18 | server | SHOULD | 48 | 47 | 1 | 0 | 67 |
| 2025-06-18 | server | SHOULD NOT | 4 | 3 | 1 | 0 | 1 |
| 2025-06-18 | server | SHOULD NOT | 4 | 4 | 0 | 0 | 1 |
| 2025-06-18 | server | MAY | 15 | 15 | 0 | 0 | 20 |
| 2025-06-18 | server | other | 15 | 15 | 0 | 0 | 3 |
| 2025-06-18 | client | MUST | 42 | 39 | 3 | 0 | 59 |
Expand All @@ -49,7 +49,7 @@ Every normative requirement of every revision (catalogue: `docs/spec/requirement
| 2025-11-25 | server | MUST | 103 | 100 | 3 | 0 | 77 |
| 2025-11-25 | server | MUST NOT | 22 | 22 | 0 | 0 | 13 |
| 2025-11-25 | server | SHOULD | 73 | 70 | 3 | 0 | 86 |
| 2025-11-25 | server | SHOULD NOT | 11 | 10 | 1 | 0 | 3 |
| 2025-11-25 | server | SHOULD NOT | 11 | 11 | 0 | 0 | 3 |
| 2025-11-25 | server | MAY | 25 | 25 | 0 | 0 | 30 |
| 2025-11-25 | server | other | 19 | 19 | 0 | 0 | 2 |
| 2025-11-25 | client | MUST | 65 | 62 | 3 | 0 | 115 |
Expand All @@ -61,7 +61,7 @@ Every normative requirement of every revision (catalogue: `docs/spec/requirement
| 2026-07-28 | server | MUST | 114 | 112 | 2 | 0 | 110 |
| 2026-07-28 | server | MUST NOT | 44 | 44 | 0 | 0 | 20 |
| 2026-07-28 | server | SHOULD | 69 | 66 | 3 | 0 | 91 |
| 2026-07-28 | server | SHOULD NOT | 11 | 10 | 1 | 0 | 9 |
| 2026-07-28 | server | SHOULD NOT | 11 | 11 | 0 | 0 | 9 |
| 2026-07-28 | server | MAY | 29 | 29 | 0 | 0 | 32 |
| 2026-07-28 | server | other | 23 | 23 | 0 | 0 | 4 |
| 2026-07-28 | client | MUST | 73 | 70 | 3 | 0 | 151 |
Expand Down Expand Up @@ -403,7 +403,7 @@ Every normative requirement of every revision (catalogue: `docs/spec/requirement
| [streamable-http-auth-discovery-version-header](https://modelcontextprotocol.io/specification/2025-03-26/basic/authorization#server-metadata-discovery-headers) | SHOULD | client | n/a: addresses the other side | n/a: no OAuth |
| [authz-optional](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization#protocol-requirements) | OPTIONAL | both | n/a: optional feature mcpx does not implement | n/a: optional feature mcpx does not implement |
| [authz-http-should-conform](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization#protocol-requirements) | SHOULD | both | n/a: optional feature mcpx does not implement | n/a: optional feature mcpx does not implement |
| [authz-stdio-use-environment](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization#protocol-requirements) | SHOULD NOT | both | **gap** #1950: the merged #1975 bearer work (PR #2711) gates the HTTP surface only; the `env` auth type retrieves credentials from the environment for stdio children (mcpauth) but no test traces that retrieval into a stdio child end to end, so the server-side stdio row is not yet bound -- repointed from closed #1975 to live #1950 (task 14860) | **gap** not implemented: #1950 |
| [authz-stdio-use-environment](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization#protocol-requirements) | SHOULD NOT | both | tested: `pool.TestStdioChildReceivesEnvCredential@all` | **gap** not implemented: #1950 |
| [authz-alt-transport-best-practice](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization#protocol-requirements) | MUST | both | n/a: catalogue marks it n/a | n/a: catalogue marks it n/a |
| [authz-implement-oauth21](https://modelcontextprotocol.io/specification/2025-03-26/basic/authorization#overview) | MUST | both | n/a: optional feature mcpx does not implement | n/a: optional feature mcpx does not implement |
| [authz-dcr-should](https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization#dynamic-client-registration) | SHOULD | both | n/a: optional feature mcpx does not implement | n/a: optional feature mcpx does not implement |
Expand Down Expand Up @@ -792,7 +792,7 @@ Every normative requirement of every revision (catalogue: `docs/spec/requirement
| [authorization-custom-auth-may](https://modelcontextprotocol.io/specification/2026-07-28/basic/index#auth) | MAY | both | n/a: catalogue marks it n/a | n/a: catalogue marks it n/a |
| [authz-optional](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization#protocol-requirements) | OPTIONAL | both | n/a: optional feature mcpx does not implement | n/a: optional feature mcpx does not implement |
| [authz-http-should-conform](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization#protocol-requirements) | SHOULD | both | n/a: optional feature mcpx does not implement | n/a: optional feature mcpx does not implement |
| [authz-stdio-use-environment](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization#protocol-requirements) | SHOULD NOT | both | **gap** #1950: the merged #1975 bearer work (PR #2711) gates the HTTP surface only; the `env` auth type retrieves credentials from the environment for stdio children (mcpauth) but no test traces that retrieval into a stdio child end to end, so the server-side stdio row is not yet bound -- repointed from closed #1975 to live #1950 (task 14860) | **gap** not implemented: #1950 |
| [authz-stdio-use-environment](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization#protocol-requirements) | SHOULD NOT | both | tested: `pool.TestStdioChildReceivesEnvCredential@all` | **gap** not implemented: #1950 |
| [authz-alt-transport-best-practice](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization#protocol-requirements) | MUST | both | n/a: catalogue marks it n/a | n/a: catalogue marks it n/a |
| [authz-as-implements-oauth21](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization#overview) | MUST | auth-server | n/a: addresses the other side | n/a: addresses the other side |
| [authz-dcr-should](https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization#dynamic-client-registration) | SHOULD | both | n/a: optional feature mcpx does not implement | n/a: optional feature mcpx does not implement |
Expand Down Expand Up @@ -1226,7 +1226,7 @@ Every normative requirement of every revision (catalogue: `docs/spec/requirement
| [authorization-custom-auth-may](https://modelcontextprotocol.io/specification/2026-07-28/basic/index#auth) | MAY | both | n/a: catalogue marks it n/a | n/a: catalogue marks it n/a |
| [authz-optional](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization#protocol-requirements) | OPTIONAL | both | n/a: optional feature mcpx does not implement | n/a: optional feature mcpx does not implement |
| [authz-http-should-conform](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization#protocol-requirements) | SHOULD | both | n/a: optional feature mcpx does not implement | n/a: optional feature mcpx does not implement |
| [authz-stdio-use-environment](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization#protocol-requirements) | SHOULD NOT | both | **gap** #1950: the merged #1975 bearer work (PR #2711) gates the HTTP surface only; the `env` auth type retrieves credentials from the environment for stdio children (mcpauth) but no test traces that retrieval into a stdio child end to end, so the server-side stdio row is not yet bound -- repointed from closed #1975 to live #1950 (task 14860) | **gap** not implemented: #1950 |
| [authz-stdio-use-environment](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization#protocol-requirements) | SHOULD NOT | both | tested: `pool.TestStdioChildReceivesEnvCredential@all` | **gap** not implemented: #1950 |
| [authz-alt-transport-best-practice](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization#protocol-requirements) | MUST | both | n/a: catalogue marks it n/a | n/a: catalogue marks it n/a |
| [authz-as-implements-oauth21](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization#overview) | MUST | auth-server | n/a: addresses the other side | n/a: addresses the other side |
| [authz-dcr-may-deprecated](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization/client-registration#dynamic-client-registration) | MAY | client, auth-server | n/a: addresses the other side | n/a: optional feature mcpx does not implement |
Expand Down Expand Up @@ -1842,7 +1842,7 @@ Every normative requirement of every revision (catalogue: `docs/spec/requirement
| [authorization-custom-auth-may](https://modelcontextprotocol.io/specification/2026-07-28/basic/index#auth) | MAY | both | n/a: catalogue marks it n/a | n/a: catalogue marks it n/a |
| [authz-optional](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization#protocol-requirements) | OPTIONAL | both | n/a: optional feature mcpx does not implement | n/a: optional feature mcpx does not implement |
| [authz-http-should-conform](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization#protocol-requirements) | SHOULD | both | n/a: optional feature mcpx does not implement | n/a: optional feature mcpx does not implement |
| [authz-stdio-use-environment](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization#protocol-requirements) | SHOULD NOT | both | **gap** #1950: the merged #1975 bearer work (PR #2711) gates the HTTP surface only; the `env` auth type retrieves credentials from the environment for stdio children (mcpauth) but no test traces that retrieval into a stdio child end to end, so the server-side stdio row is not yet bound -- repointed from closed #1975 to live #1950 (task 14860) | **gap** not implemented: #1950 |
| [authz-stdio-use-environment](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization#protocol-requirements) | SHOULD NOT | both | tested: `pool.TestStdioChildReceivesEnvCredential@all` | **gap** not implemented: #1950 |
| [authz-alt-transport-best-practice](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization#protocol-requirements) | MUST | both | n/a: catalogue marks it n/a | n/a: catalogue marks it n/a |
| [authz-as-implements-oauth21](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization#overview) | MUST | auth-server | n/a: addresses the other side | n/a: addresses the other side |
| [authz-dcr-may-deprecated](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization/client-registration#dynamic-client-registration) | MAY | client, auth-server | n/a: addresses the other side | n/a: optional feature mcpx does not implement |
Expand Down
27 changes: 12 additions & 15 deletions pkgs/mcpx/internal/conformance/coverage_authz.go
Original file line number Diff line number Diff line change
@@ -1,32 +1,29 @@
package conformance

// Authorization rows judged against the merged #1975 bearer work
// Authorization rows judged against the merged #1975 bearer <redacted>
// (PR #2711) for #1950's remainder (task 14860). The overrides in
// overrides/authorization.json re-judge these server sides to
// "applies" so the bindings and the recorded gap below -- not the
// catalogue's blanket pointer at closed #1975 -- decide the cells.
// "applies" so the bindings below -- not the catalogue's blanket
// pointer at closed #1975 -- decide the cells.
func init() {
register(
// The token the client presented to the daemon is never
// passed through: the upstream gets the configured provider
// key instead.
S("authz-no-token-passthrough",
"daemon.TestProxyKeepsUpstreamKeyWhenBearerSet@all"),
// The daemon accepts only its own configured bearer token,
// The daemon accepts only its own configured bearer <redacted>,
// on the /mcp surface as on every route; anything else is a
// 401 before the MCP handler runs.
S("authz-accept-only-own-tokens",
"daemon.TestMCPRejectsUnauthenticatedWhenBearerSet@all"),
)
registerGaps(
// Judged NOT satisfied by the bearer work: PR #2711 gates
// the HTTP surface and does not touch the stdio credential
// path. mcpauth's `env` auth type retrieves credentials
// from the environment for stdio children, but no test
// traces that retrieval into a stdio child's environment
// end to end, so the server side stays a gap -- repointed
// from closed #1975 to live #1950 with this reason.
Gap{ID: "authz-stdio-use-environment", Side: Server, Issue: "#1950",
Why: "the merged #1975 bearer work (PR #2711) gates the HTTP surface only; the `env` auth type retrieves credentials from the environment for stdio children (mcpauth) but no test traces that retrieval into a stdio child end to end, so the server-side stdio row is not yet bound -- repointed from closed #1975 to live #1950 (task 14860)"},
// A stdio server does not run the OAuth flow: its
// credential is retrieved from the daemon's environment by
// the `env` auth type (mcpauth) and carried into the
// spawned child. The pool test traces that retrieval end
// to end -- the child itself reports the value it
// received, under a name set nowhere but the auth block.
S("authz-stdio-use-environment",
"pool.TestStdioChildReceivesEnvCredential@all"),
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
},
"authz-stdio-use-environment": {
"server": "applies",
"why": "#1950 remainder (task 14860): re-judged so the recorded gap in coverage_authz.go (pointing at live #1950, with the reason) renders instead of the blanket pointer at closed #1975. The client side is untouched and keeps the #1950 blanket gap per the recorded deferral."
"why": "#1950 remainder: re-judged so the binding in coverage_authz.go renders instead of the blanket pointer at closed #1975. Bound by pool.TestStdioChildReceivesEnvCredential: the `env` auth type retrieves the credential from the daemon's environment and the spawned stdio child reports it back end to end. The client side is untouched and keeps the #1950 blanket gap per the recorded deferral."
}
}
51 changes: 51 additions & 0 deletions pkgs/mcpx/internal/pool/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/developing-today/code/pkgs/mcpx/internal/config"
"github.com/developing-today/code/pkgs/mcpx/internal/mcpauth"
"github.com/developing-today/code/pkgs/mcpx/internal/pool"
"github.com/developing-today/code/pkgs/mcpx/internal/testsupport"
)

// #240: a server's `auth` block was parsed and never applied, so a configured
Expand Down Expand Up @@ -84,3 +85,53 @@ func TestAuthReachesTheUpstream(t *testing.T) {
}
})
}

// #1950: for a stdio server the authorization specification says to
// retrieve credentials from the environment rather than follow the
// OAuth flow ("Implementations using an STDIO transport SHOULD NOT
// follow this specification, and instead retrieve credentials from
// the environment"). This traces that path end to end: the credential
// exists only in the daemon's environment, the server's `env` auth
// block retrieves it, and the spawned child itself reports what it
// received. The reported name is set nowhere but the auth block, so
// ordinary environment inheritance cannot produce it.
func TestStdioChildReceivesEnvCredential(t *testing.T) {
bin := testsupport.FakeMCPBinary(t)

t.Run("a ${VAR} reference is expanded from the daemon's environment", func(t *testing.T) {
t.Setenv("MCPX_TEST_STDIO_SOURCE", "retrieved-credential")
r := resolvedWith(t, &config.Server{
Command: bin,
// The fake server answers `echo` with the value of the
// named variable in its own environment.
Env: map[string]string{"MCPX_REPORT_ENV": "MCPX_CHILD_CREDENTIAL"},
Auth: &mcpauth.Auth{Type: "env", Env: map[string]string{
"MCPX_CHILD_CREDENTIAL": "${MCPX_TEST_STDIO_SOURCE}",
}},
})
p := pool.New(r)
t.Cleanup(p.Close)
raw, err := p.Call(ctx20(t), config.ResolvedScope{Key: "global"}, "echo", map[string]any{"message": "x"})
if err != nil {
t.Fatalf("call: %v", err)
}
if got := textOf(t, raw); got != "retrieved-credential" {
t.Fatalf("child reports %q, want %q (the credential held in the daemon's environment)", got, "retrieved-credential")
}
})

t.Run("an unset variable fails before the child spawns", func(t *testing.T) {
r := resolvedWith(t, &config.Server{
Command: bin,
Auth: &mcpauth.Auth{Type: "env", Env: map[string]string{
"MCPX_CHILD_CREDENTIAL": "${MCPX_TEST_STDIO_UNSET}",
}},
})
p := pool.New(r)
t.Cleanup(p.Close)
_, err := p.Call(ctx20(t), config.ResolvedScope{Key: "global"}, "echo", map[string]any{"message": "x"})
if err == nil || !strings.Contains(err.Error(), "MCPX_TEST_STDIO_UNSET") {
t.Fatalf("err = %v, want it to name MCPX_TEST_STDIO_UNSET", err)
}
})
}