Expose MCP resource discovery controls to AI clients - #4817
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
initialize.instructionshow to use exact-path resource templates, filteredresources/listdiscovery, cursor continuation, and boundedresources/readcalls.resources/listextension parameters, bounds, generated-file default, and cursor semantics underresult._meta.discovery_contract.Why
resources/listsupports useful non-standard parameters (path,lang,includeGenerated, andmaxBytes), but protocol methods do not expose a tool-style input schema. AI clients therefore had to guess that these controls existed even though the implementation and documentation already supported them.This change makes the current resource-discovery contract discoverable in-band without changing existing request behavior.
Impact
AI clients can now choose exact-path reads or bounded repository browsing directly from the MCP handshake and response metadata. Pagination remains opaque and bound to both the index generation and the canonical filters.
Serializer audit
The separately reported trimmed-release
tools/listfailure involving missingSystem.StringJsonTypeInfometadata was already tracked as #178 and fixed by #1066. That fix is included in thev1.40.1tag, and its existing serializer-fallback regression test passes in both target frameworks. No duplicate serializer change is included here.Validation
dotnet build CodeIndex.sln -c Release -p:UseSharedCompilation=falsetools/listis silently dropped (no JSON-RPC error response) on the trimmed release binary — AI clients hang on the first handshake step #178 serializer fallback: 3 passed on both net8.0 and net9.0initializeand filteredresources/listdotnet run --project tools/CodeIndex.Changelog -- checkcdidx index . --commits HEAD;status --checkreportsindex_matches_workspace: true