Skip to content

Upgrade MCP C# SDK to v2 - #2426

Merged
ejsmith merged 11 commits into
mainfrom
issue/mcp-sdk-v2
Jul 31, 2026
Merged

Upgrade MCP C# SDK to v2#2426
ejsmith merged 11 commits into
mainfrom
issue/mcp-sdk-v2

Conversation

@niemyjski

@niemyjski niemyjski commented Jul 30, 2026

Copy link
Copy Markdown
Member

What changed

  • Upgrade ModelContextProtocol.AspNetCore from 1.4.1 to 2.0.0.
  • Use the SDK v2 native stateless HTTP transport and protocol 2026-07-28.
  • Preserve SDK-supported down-level protocol negotiation for 2025-06-18 and 2025-11-25 clients.
  • Remove the legacy stateful session migration handler and all OAuth-grant-scoped mutable project context.
  • Define the initial MCP tool contract around stateless, unambiguous scope inference: organization and project ids may be omitted when the current OAuth grant exposes exactly one matching resource; otherwise tools return structured context_required guidance.
  • Simplify discovery to list_organizations, list_projects, and resolve_project; remove get_context and the state-implying switch_organization and switch_project tools.
  • Add server instructions explaining that calls are stateless, omitted ids are inferred only when unambiguous, and previous calls never change later scope.
  • Add the required v2 Mcp-Method and Mcp-Name authorization metadata headers to the HTTP samples.

Compatibility and risk

This MCP tool surface has not been released, so optional identifiers with unambiguous inference and structured selection errors are the initial supported tool contract rather than a change to an existing public contract. Explicit ids remain supported and are required whenever the OAuth grant exposes multiple matching resources. Older clients dynamically discover that schema.

Wire-protocol compatibility remains preserved for current down-level MCP clients. The server negotiates 2025-06-18, 2025-11-25, and native 2026-07-28; the Exceptionless REST API is unchanged.

Version 2.0.0 was released on July 28, 2026, so it is less than two weeks old and carries elevated dependency-upgrade risk. No known NuGet vulnerabilities were reported for the solution's resolved packages.

Release audit:

Verification

  • dotnet build tests/Exceptionless.Tests/Exceptionless.Tests.csproj --no-restore --nologo — passed, 0 warnings/errors.
  • git diff --check — passed.
  • Added tool-schema coverage proving organization and project ids are optional.
  • Added behavior coverage for a single organization, a single project, a single project across multiple organizations, ambiguous project grants, and both query and resource lookup paths.
  • Added tool-list coverage for the simplified stateless discovery surface and server instructions.
  • Added official SDK integration coverage for native 2026-07-28 and down-level 2025-06-18 and 2025-11-25 negotiation.
  • Focused local integration execution was blocked before tests ran because the shared Elasticsearch 8.19 container found data written by a newer Lucene/Elasticsearch version (indexCreatedVersionMajor is in the future: 10) and exited during fixture startup; GitHub Actions runs the clean integration suite for the pushed commit.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 31304bea9f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/Exceptionless.Tests/Api/Endpoints/OAuthEndpointTests.cs Outdated
@niemyjski

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 7fe332781b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ejsmith
ejsmith force-pushed the issue/mcp-sdk-v2 branch from 7fe3327 to a90ffcc Compare July 30, 2026 17:06
@niemyjski niemyjski self-assigned this Jul 30, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 303e606d45

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Exceptionless.Web/Mcp/ExceptionlessMcpTools.cs Outdated
@ejsmith

ejsmith commented Jul 31, 2026

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: b7443100b3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ejsmith
ejsmith merged commit 7aa75c1 into main Jul 31, 2026
7 checks passed
@ejsmith
ejsmith deleted the issue/mcp-sdk-v2 branch July 31, 2026 04:58
@github-actions

Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Complexity Health
Exceptionless.Core 74% 66% 9634
Exceptionless.AppHost 38% 40% 139
Exceptionless.Insulation 37% 35% 286
Exceptionless.Web 85% 68% 6887
Summary 77% (22902 / 29705) 66% (10571 / 16030) 16946

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.

2 participants