Skip to content

D5-S15 — Mcp: the transport, the connection principal and invocation - #221

Merged
The-Running-Dev merged 1 commit into
mainfrom
slice/S15
Sep 11, 2026
Merged

The-Running-Dev merged 1 commit into
mainfrom
slice/S15

Conversation

@The-Running-Dev

@The-Running-Dev The-Running-Dev commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adopts ModelContextProtocol.Core/ModelContextProtocol.AspNetCore for the MCP transport, session and filter pipeline, projected at the boundary per design/90-decisions.md (2026-08-29) — no SDK type appears in Platform's public surface.
  • Implements the fixed invocation order: catalogue lookup → tenant resolution → argument parse → authorize (resource-scoped when the schema names one) → entitlement (when the tool declares a feature) → invoke inside its own operation scope → audit.
  • Adds McpError (UnknownTool, InvalidArguments, ConnectionUnauthenticated) and installs Platform's own list/call filters ahead of the SDK's default authorization filter, so unregistered and registered-but-unexposed tools answer identically and never disclose existence.
  • Binds the connection to a single principal for its lifetime; a session request carrying a different principal ends the exchange.
  • Every invocation writes exactly one audit record with the tool name as the action, class Required, and no argument payload.
  • Grants SubZeroDev.Platform.Mcp access to Core's AuthenticationChain via InternalsVisibleTo on SubZeroDev.Platform.Core.csproj, mirroring Hosting's existing access, to reuse the same authentication seam the HTTP path uses.

Test plan

  • dotnet build — succeeds, 0 warnings, 0 errors.
  • Full dotnet test suite — last full run did not finish inside this session; needs a clean confirming run before merge (McpInvocationTests, McpTests, PackageGraphTests at minimum).

Closes #183.

🤖 Generated with Claude Code

Adopts the official MCP C# SDK for transport, session and filter pipeline,
projected at the boundary per the SDK-adoption decision. Adds the fixed
invocation order (catalogue lookup, tenant resolution, argument parse,
authorize, entitlement, invoke in its own operation scope, audit),
McpError (UnknownTool, InvalidArguments, ConnectionUnauthenticated),
connection-level principal binding, and per-invocation audit with no
argument payload. Grants Mcp InternalsVisibleTo from Core for the
authentication chain reuse.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@The-Running-Dev
The-Running-Dev enabled auto-merge (squash) September 11, 2026 04:50
@The-Running-Dev
The-Running-Dev merged commit 94eabac into main Sep 11, 2026
3 of 5 checks passed
@The-Running-Dev
The-Running-Dev deleted the slice/S15 branch September 11, 2026 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

D5-S15 — Mcp: the transport, the connection principal and invocation

1 participant