Skip to content

Releases: diwb/dotnet-mcp-examples

v1.1.0 - MCP Security and Release Hardening

Choose a tag to compare

@diwb diwb released this 27 Jul 13:38

v1.1.0 - MCP Security and Release Hardening

This release adds the final Project 4 hardening layer after the official MCP SDK refactor.

Highlights

  • Added McpExamples.AuthorizationServer, a local OpenIddict OAuth/OIDC issuer.
  • Implemented Authorization Code Flow with required PKCE S256.
  • Added OIDC discovery, JWKS and OAuth protected resource metadata.
  • Protected the Streamable HTTP MCP server with issuer, audience/resource, expiration and scope validation.
  • Added 401 + WWW-Authenticate for invalid/missing bearer tokens and 403 for insufficient scope.
  • Updated the console client with a PKCE loopback auth helper and bearer-token HTTP calls.
  • Pinned the official MCP Inspector as @modelcontextprotocol/inspector@1.0.0 under tools/inspector.
  • Added HTTPS Docker Compose for the authorization server and remote MCP server.
  • Added GitHub Actions Docker validation covering build, startup, health, OAuth discovery, token issuance, authenticated MCP call and shutdown.

Authentication

Default local issuer:

https://localhost:7001/

Public client:

mcp-examples-public

Loopback callback:

http://127.0.0.1:37645/callback

Scopes:

  • catalog.read
  • orders.read
  • orders.write

Authenticate and call HTTP MCP:

dotnet run --project src/McpExamples.AuthorizationServer --configuration Release -- --urls https://localhost:7001
dotnet run --project src/McpExamples.Server.Remote --configuration Release -- --urls https://localhost:8081
dotnet run --project src/McpExamples.Client.Console --configuration Release -- auth-code https://localhost:7001 "catalog.read orders.read orders.write"
$env:MCP_EXAMPLES_ACCESS_TOKEN = "<access_token>"
dotnet run --project src/McpExamples.Client.Console --configuration Release -- http https://localhost:8081/mcp tools

MCP Hosts

STDIO host configuration examples remain under examples/host-configs. For HTTP hosts, configure the MCP endpoint as:

https://localhost:8081/mcp

and provide an OAuth bearer token issued by the local authorization server.

Validation

Final local validation:

  • dotnet build DotNetMcpExamples.slnx -c Release --no-restore
  • dotnet test DotNetMcpExamples.slnx -c Release --no-build --collect:"XPlat Code Coverage" --results-directory TestResults
  • 76 tests passed, 0 failed.
  • McpExamples.Shared: 98.27% line coverage in the unit-test Cobertura report.
  • McpExamples.AuthorizationServer: 94.87% line coverage in the security-test Cobertura report.
  • NuGet vulnerability scan reported no vulnerable packages.
  • Inspector CLI validated STDIO tools, resources, prompts, successful tool call and controlled error.
  • CI final run passed: build/test and Docker/OAuth/MCP job.
  • CodeQL final run passed.

Notes

Artifacts are framework-dependent net10.0 builds for win-x64 and linux-x64. Install the .NET 10 runtime appropriate for the target machine. Checksums are attached as checksums.sha256.

v1.0.1

Choose a tag to compare

@diwb diwb released this 26 Jul 22:40

Structural correction: replace manual MCP protocol handling with the official Model Context Protocol C# SDK.

Highlights:

  • Targets MCP protocol 2025-11-25 with stable SDK 1.4.1.
  • STDIO servers use WithStdioServerTransport.
  • HTTP server uses WithHttpTransport and app.MapMcp(/mcp).
  • Client uses McpClient.CreateAsync, StdioClientTransport and HttpClientTransport with StreamableHttp.
  • Manual JSON-RPC/capability handling and fixed demo bearer tokens were removed.
  • Tests expanded to 48 passing tests.
  • CI run 30223472039 passed.
  • CodeQL run 30223472047 passed.

Limitations:

  • Docker build could not be validated because Docker Desktop Linux engine was unavailable locally.
  • MCP Inspector via npx timed out locally; no Inspector evidence is claimed.
  • Full OAuth/OIDC Authorization Code + PKCE environment is documented but not completed in this pass.

v1.0.0

Choose a tag to compare

@diwb diwb released this 26 Jul 21:19

Initial production-oriented .NET MCP examples reference.

Validated:

  • .NET 10 restore/build/test in GitHub Actions
  • CI run 30220745417 passed
  • CodeQL run 30220745421 passed
  • Local STDIO initialize round trip passed

Known limitations:

  • Docker build could not be validated locally because Docker Desktop Linux engine was unavailable.
  • No binary artifacts are attached to this release.
  • OAuth/OIDC is represented by local demo bearer scopes, not a full authorization server.