docs: add filter URL parameter to /clients page to pre-filter clients with specific capabilities#2665
Open
jancurn wants to merge 3 commits into
Open
docs: add filter URL parameter to /clients page to pre-filter clients with specific capabilities#2665jancurn wants to merge 3 commits into
filter URL parameter to /clients page to pre-filter clients with specific capabilities#2665jancurn wants to merge 3 commits into
Conversation
Auto-select feature filters on the clients page from a `?filter=` query parameter, and update the URL in place when filters change. Filter values are validated against the known FEATURES whitelist, so unknown or malicious values are ignored.
…QhE73 Add URL query parameter support for client filter persistence
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.
This PR improves the https://modelcontextprotocol.io/clients page by adding the
filterURL parameter, which automatically selects only the matching filters.For example: https://modelcontextprotocol.io/clients?filter=Tools,Resources
Motivation and Context
This small change enables sharing/linking to a pre-filtered client list (e.g. from blog posts or docs) that highlights only the clients matching specific MCP features, and thus helps promote MCO clients that support the newer capabilities.
Here are the changes made:
filterquery parameter, split by comma, and intersect with the knownFEATURESwhitelist before populatingselectedFeatures. Unknown values are dropped, which is what makes this safe against HTML/script injection — combined with React's auto-escaping, no attacker-controlled string can reach the DOM.useEffectmirrorsselectedFeaturesback into the URL viahistory.replaceState, so toggling a filter updates the address bar in place (no new history entries, back button still works). Each feature name isencodeURIComponent-encoded individually; the,separator is left literal (it's a valid sub-delim per RFC 3986) so the URL reads as?filter=Prompts,Tools,Discoveryinstead of?filter=Prompts%2CTools%2CDiscovery.typeof window !== "undefined"guard).How Has This Been Tested?
I've tested it locally in these scenarios:
npm run serve:docs, open/clients?filter=Discovery,Resources— both filters auto-selected, list narrowed/clients?filter=Resources,BogusValue— onlyResourcesselected (whitelist drops the unknown)/clients?filter=<script>alert(1)</script>— nothing selected, no script executionBreaking Changes
No
Types of changes
Checklist
Additional context