Skip to content

Stop advertising static MCP resource list changes - #242

Merged
Mike Krüger (mkrueger) merged 1 commit into
mainfrom
dev/mkrueger/fix-static-mcp-resource-capabilities
Oct 8, 2026
Merged

Mike Krüger (mkrueger) merged 1 commit into
mainfrom
dev/mkrueger/fix-static-mcp-resource-capabilities

Conversation

@mkrueger

Copy link
Copy Markdown
Collaborator

Summary

The resource list is static, but the MCP SDK advertises resources.listChanged whenever a resource collection is registered. This contradicts the custom subscription handler, which intentionally rejects list-change filters.

  • Replace dynamic resource collection registration with static list/read handlers, preserving attributed metadata and SDK content serialization.
  • Disable resources.listChanged while retaining current-location content subscriptions.
  • Test legacy initialize and modern discovery capabilities, resource content, unsupported list-change subscriptions, and version-specific missing-resource errors.
  • Update README and MCP documentation.

Independent fix based on main; does not include or modify the stdio work in #239.

Validation

  • Application build passed.
  • Test project build passed with no warnings or errors.
  • All 8 McpLocationSubscriptionTests passed.

Register static resource handlers while preserving location subscriptions and resource metadata.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The implementation, documentation, and focused tests consistently enforce the intended static resource-list contract.

0 open findings

What changed in this PR

Replaces dynamic MCP resource registration with static handlers so the server no longer advertises resource-list changes while preserving resource reads and content subscriptions.

Changes:

  • Adds static resource list/read handlers with protocol-specific errors.
  • Disables resources.listChanged and expands subscription tests.
  • Documents the static resource-list behavior.
File Description
README.md Clarifies static resource capabilities.
docs/​mcp.md Documents supported subscription behavior.
ResourceOperations.cs Implements static resource handlers.
McpServer.cs Registers handlers and disables list-change capability.
McpLocationSubscriptionTests.cs Covers capabilities, resources, errors, and filters.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

@github-code-quality

Copy link
Copy Markdown

Code Coverage Overview

Languages: C#

C# / code-coverage/dotnet

The overall line coverage in commit 6555c8a in the dev/mkrueger/fix-sta... branch remains at 66%, unchanged from commit 3a8eb87 in the main branch.

@mkrueger
Mike Krüger (mkrueger) merged commit 3222809 into main Oct 8, 2026
13 of 14 checks passed
@mkrueger
Mike Krüger (mkrueger) deleted the dev/mkrueger/fix-static-mcp-resource-capabilities branch October 8, 2026 09:59
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.

3 participants