Repository navigation
fix(mcp): prefer exact match for containers in inspect_schema before case-insensitive fallback (MCP3) - #2136
Merged
cevheri merged 2 commits intoNov 8, 2026
Conversation
…case-insensitive fallback (MCP3)
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Member
|
I am working on a critical development related to MCP; I will review this PR once the MCP development is complete. If any conflicts arise and provided they involve only non-critical documentation updates I will proceed with the merge. |
Contributor
Author
|
Hey @cevheri is everything good if you want any thing help or any issues solving please feel free to ask i will look into that. |
Member
|
Thanks for your patience, @Maaz2212, merged. As I said I would, I resolved the BACKLOG conflict myself by merging main into your branch. I also dropped the sentence in MCP22 that still pointed at MCP3. |
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.
Description
When calling the MCP tool
inspect_schemawith aschemaargument,chooseContainerpreviously performed a purely case-insensitive match (candidate.name.toLowerCase() === wanted).On engines or brokers supporting case-sensitive container names (such as RabbitMQ virtual hosts like
Billingandbilling), requestingschema: "billing"would pick whichever container was enumerated first by the provider. This change updateschooseContainerto prioritize an exact match first, falling back to case-insensitive matching only when no exact match exists.Closes item MCP3 from
docs/BACKLOG.md.Type of Change
Related Issue
Closes item MCP3 in docs/BACKLOG.md
Changes Made
src/lib/mcp/tools/inspect-schema.ts: UpdatedchooseContainerto checkcandidate.name === schemabefore falling back tocandidate.name.toLowerCase() === wanted.tests/integration/mcp/inspect-schema.test.ts: Added integration testprefers an exact match when two containers differ only by case, and falls back to case-insensitiveverifying:"billing"choosesbillingeven whenBillingis listed first."Billing"choosesBilling."BILLING"selectsBilling.docs/BACKLOG.md: Removed completed itemMCP3and updated the Table of Contents count.Testing
Test Environment
Checklist
bun run test:coverageandbun run coverage:check— 205/205 lines hit oninspect-schema.ts)tsc --noEmitwith 0 errors)oxlint,eslint,only-checkwith 0 errors)knipwith 0 issues)biome format)