René's URL Explorer Experiment


Title: SEP: Prefix Filtering for Listing Resource / Templates · Issue #1269 · modelcontextprotocol/modelcontextprotocol · GitHub

Open Graph Title: SEP: Prefix Filtering for Listing Resource / Templates · Issue #1269 · modelcontextprotocol/modelcontextprotocol

X Title: SEP: Prefix Filtering for Listing Resource / Templates · Issue #1269 · modelcontextprotocol/modelcontextprotocol

Description: Preamble Title: Prefix Filtering for Listing Resource / Templates Status: Proposal Author: Tapan Chugh (@chughtapan) Type: Standards Track Created: 2025-07-31 Abstract This SEP proposes adding an optional prefix parameter to the resource...

Open Graph Description: Preamble Title: Prefix Filtering for Listing Resource / Templates Status: Proposal Author: Tapan Chugh (@chughtapan) Type: Standards Track Created: 2025-07-31 Abstract This SEP proposes adding an o...

X Description: Preamble Title: Prefix Filtering for Listing Resource / Templates Status: Proposal Author: Tapan Chugh (@chughtapan) Type: Standards Track Created: 2025-07-31 Abstract This SEP proposes adding an o...

Opengraph URL: https://github.com/modelcontextprotocol/modelcontextprotocol/issues/1269

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"SEP: Prefix Filtering for Listing Resource / Templates","articleBody":"## Preamble\n\n**Title:** Prefix Filtering for Listing Resource / Templates\n**Status:** Proposal\n**Author:** Tapan Chugh (@chughtapan)\n**Type:** Standards Track\n**Created:** 2025-07-31\n\n## Abstract\n\nThis SEP proposes adding an optional `prefix` parameter to the `resources/list` and `resources/templates/list` requests to enable servers to efficiently filter resources and resource templates by URI prefix, to improve discoverability of resources for clients when servers expose thousands of resources (or more).\n\n## Motivation\n\nResources are a powerful abstraction in MCP to define the scope of information available to LLMs. While the protocol already supports pagination for handling large resource lists, this alone is insufficient when servers expose thousands of resources. Clients must retrieve multiple pages and implement local filtering to find specific resources, which becomes complex when combined with pagination as they must track filtered results across page boundaries. This leads to inefficiency as the same filtering logic is reimplemented in every client, with redundant data transfer for resources that will be discarded. Since resources already use URI format, prefix-based filtering is a natural solution that offloads this common operation to the server. \n\n## Specification\n\n### Schema Changes\n\nUpdate `ListResourcesRequest` and `ListResourceTemplatesRequest` interfaces to include an optional `prefix` parameter:\n\n```typescript\nexport interface ListResourcesRequest extends PaginatedRequest {\n  method: \"resources/list\";\n  params?: {\n    /**\n     * Optional URI prefix to filter resources.\n     * Only resources whose URI starts with this prefix will be returned.\n     */\n    prefix?: string;\n  } \u0026 PaginatedRequest[\"params\"];\n}\n\nexport interface ListResourceTemplatesRequest extends PaginatedRequest {\n  method: \"resources/templates/list\";\n  params?: {\n    /**\n     * Optional URI prefix to filter resource templates.\n     * Only templates whose URI template starts with this prefix will be returned.\n     */\n    prefix?: string;\n  } \u0026 PaginatedRequest[\"params\"];\n}\n```\n\n### Behavior\n\n1. **Prefix matching**: The server returns only resources whose URI (or URI template) starts with the prefix\n2. **Pagination compatibility**: Prefix filtering works with pagination - the cursor represents position within the filtered results\n\n### Examples\n\nRequest with prefix filter:\n\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"resources/list\",\n  \"params\": {\n    \"prefix\": \"file:///project/src/\"\n  }\n}\n```\n\nResponse:\n\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"result\": {\n    \"resources\": [\n      {\n        \"uri\": \"file:///project/src/main.py\",\n        \"name\": \"main.py\"\n      },\n      {\n        \"uri\": \"file:///project/src/config.json\",\n        \"name\": \"config.json\"\n      }\n    ]\n  }\n}\n```\n\nCombining with pagination:\n\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 2,\n  \"method\": \"resources/list\",\n  \"params\": {\n    \"prefix\": \"https://api.example.com/users/\",\n    \"cursor\": \"cursor-123\"\n  }\n}\n```\n\nResource templates with prefix filter:\n\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 3,\n  \"method\": \"resources/templates/list\",\n  \"params\": {\n    \"prefix\": \"https://api.example.com/\"\n  }\n}\n```\n\nResponse:\n\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 3,\n  \"result\": {\n    \"resourceTemplates\": [\n      {\n        \"uriTemplate\": \"https://api.example.com/users/{id}\",\n        \"name\": \"User Details\"\n      },\n      {\n        \"uriTemplate\": \"https://api.example.com/posts/{postId}\",\n        \"name\": \"Blog Post\"\n      }\n    ]\n  }\n}\n```\n\n## Rationale\n\nResources are a powerful abstraction in MCP to define the scope of information available to LLMs. Efficient discoverability of these resources is crucial for effective context management. As the number of resources exposed by servers increases into thousands or millions, naively returning all resources becomes inefficient and convoluted for clients to handle. Given the hierarchical structure inherent in URIs, prefix-based filtering provides the simplest approach to improve resource discoverability.\n\n### Alternatives Considered\n\n1. **Glob patterns**: Although more flexible than simple prefixes, the value from the additional implementation complexity does not seem clear given the hierarchical nature of URIs.\n\n2. **Namespaces**: (#993) I believe this was already rejected in #1061. The hierarchical nature of URIs lends itself to simple path based name-spacing automatically.\n\n3. **New search method**: (#322, #204) Creating a new search method only for resources seems like an overkill. Creating a unified search method across components / tools might not work since the search requirements are likely different.\n\n## Backward Compatibility\n\nWhile the `prefix` parameter is optional in the schema, this feature requires updates to SDKs to expose the prefix parameter. Existing clients continue to work as it is since the parameter is optional.\n\n## Reference Implementation\nSpecification Updates PR: #1279 \nPython SDK Implementation: https://github.com/modelcontextprotocol/python-sdk/pull/1225\n\n\n## Security Implications\n\nPrefix filtering doesn't grant access to resources that wouldn't already be accessible through pagination. It only provides a more efficient way to retrieve subsets of already-accessible resources.\n\n## Open Questions\n\n1. Should we consider path-based prefix matching versus string-based prefix matching? For example, should the prefix `uri://a` match `uri://abc/def` or not? Assuming the prefix to be path prefix seems like the easiest to implement especially with templates in mix.\n\n2. For resource templates with embedded variables (e.g., `https://api.example.com/users/{id}/operations/{action}`), should we resolve partial parameters and try to match them against templates? This seems a little tricky to get right: While resolving template parameters makes sense from an improving discoverability perspective, it's unclear if returning something like: `https://api.example.com/users/123/operations/{action}` is in line with semantics that we want list_templates to offer.\n","author":{"url":"https://github.com/chughtapan","@type":"Person","name":"chughtapan"},"datePublished":"2025-07-31T07:11:37.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/1269/modelcontextprotocol/issues/1269"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:b5d5a447-47b7-57f9-eac0-01c354f22773
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB5A6:DC32E:12A2944:188F32A:6A5BD3E1
html-safe-nonce8af131d46aea0b00b81ac3aef1e42b236584dc7456855e98e03c89e1385f7293
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNUE2OkRDMzJFOjEyQTI5NDQ6MTg4RjMyQTo2QTVCRDNFMSIsInZpc2l0b3JfaWQiOiI0ODcyNTIyMzI2MTUwNDY4NTc3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac0b5177dc5ffaa7f49e76e5aea8af61ebd5ba0f2a0570a32f7381de5cff53138c
hovercard-subject-tagissue:3279378461
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/modelcontextprotocol/modelcontextprotocol/1269/issue_layout
twitter:imagehttps://opengraph.githubassets.com/e87cc4efdba04be2eddfa4b8814c23eb544e534b69e7409763da814013806d04/modelcontextprotocol/modelcontextprotocol/issues/1269
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/e87cc4efdba04be2eddfa4b8814c23eb544e534b69e7409763da814013806d04/modelcontextprotocol/modelcontextprotocol/issues/1269
og:image:altPreamble Title: Prefix Filtering for Listing Resource / Templates Status: Proposal Author: Tapan Chugh (@chughtapan) Type: Standards Track Created: 2025-07-31 Abstract This SEP proposes adding an o...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamechughtapan
hostnamegithub.com
expected-hostnamegithub.com
None5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b
turbo-cache-controlno-preview
go-importgithub.com/modelcontextprotocol/modelcontextprotocol git https://github.com/modelcontextprotocol/modelcontextprotocol.git
octolytics-dimension-user_id182288589
octolytics-dimension-user_loginmodelcontextprotocol
octolytics-dimension-repository_id862570523
octolytics-dimension-repository_nwomodelcontextprotocol/modelcontextprotocol
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id862570523
octolytics-dimension-repository_network_root_nwomodelcontextprotocol/modelcontextprotocol
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release9c975978430e9ad293956f2bbdaf153b1bd84a99
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/modelcontextprotocol/modelcontextprotocol/issues/1269#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fmodelcontextprotocol%2Fissues%2F1269
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fmodelcontextprotocol%2Fissues%2F1269
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=modelcontextprotocol%2Fmodelcontextprotocol
Reloadhttps://github.com/modelcontextprotocol/modelcontextprotocol/issues/1269
Reloadhttps://github.com/modelcontextprotocol/modelcontextprotocol/issues/1269
Reloadhttps://github.com/modelcontextprotocol/modelcontextprotocol/issues/1269
Please reload this pagehttps://github.com/modelcontextprotocol/modelcontextprotocol/issues/1269
modelcontextprotocol https://github.com/modelcontextprotocol
modelcontextprotocolhttps://github.com/modelcontextprotocol/modelcontextprotocol
Notifications https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fmodelcontextprotocol
Fork 1.7k https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fmodelcontextprotocol
Star 8.6k https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fmodelcontextprotocol
Code https://github.com/modelcontextprotocol/modelcontextprotocol
Issues 113 https://github.com/modelcontextprotocol/modelcontextprotocol/issues
Pull requests 80 https://github.com/modelcontextprotocol/modelcontextprotocol/pulls
Discussions https://github.com/modelcontextprotocol/modelcontextprotocol/discussions
Actions https://github.com/modelcontextprotocol/modelcontextprotocol/actions
Projects https://github.com/modelcontextprotocol/modelcontextprotocol/projects
Models https://github.com/modelcontextprotocol/modelcontextprotocol/models
Security and quality 0 https://github.com/modelcontextprotocol/modelcontextprotocol/security
Insights https://github.com/modelcontextprotocol/modelcontextprotocol/pulse
Code https://github.com/modelcontextprotocol/modelcontextprotocol
Issues https://github.com/modelcontextprotocol/modelcontextprotocol/issues
Pull requests https://github.com/modelcontextprotocol/modelcontextprotocol/pulls
Discussions https://github.com/modelcontextprotocol/modelcontextprotocol/discussions
Actions https://github.com/modelcontextprotocol/modelcontextprotocol/actions
Projects https://github.com/modelcontextprotocol/modelcontextprotocol/projects
Models https://github.com/modelcontextprotocol/modelcontextprotocol/models
Security and quality https://github.com/modelcontextprotocol/modelcontextprotocol/security
Insights https://github.com/modelcontextprotocol/modelcontextprotocol/pulse
SEP: Prefix Filtering for Listing Resource / Templateshttps://github.com/modelcontextprotocol/modelcontextprotocol/issues/1269#top
enhancementNew feature or requesthttps://github.com/modelcontextprotocol/modelcontextprotocol/issues?q=state%3Aopen%20label%3A%22enhancement%22
proposalSEP proposal without a sponsor.https://github.com/modelcontextprotocol/modelcontextprotocol/issues?q=state%3Aopen%20label%3A%22proposal%22
https://github.com/chughtapan
chughtapanhttps://github.com/chughtapan
on Jul 31, 2025https://github.com/modelcontextprotocol/modelcontextprotocol/issues/1269#issue-3279378461
@chughtapanhttps://github.com/chughtapan
SEP-993: Namespaces #993https://github.com/modelcontextprotocol/modelcontextprotocol/issues/993
[notes] Core Maintainer Meeting, July 23rd #1061https://github.com/modelcontextprotocol/modelcontextprotocol/issues/1061
[RFC] Search #322https://github.com/modelcontextprotocol/modelcontextprotocol/pull/322
Open to tools/search and resources/search #204https://github.com/modelcontextprotocol/modelcontextprotocol/issues/204
#1279https://github.com/modelcontextprotocol/modelcontextprotocol/pull/1279
modelcontextprotocol/python-sdk#1225https://github.com/modelcontextprotocol/python-sdk/pull/1225
enhancementNew feature or requesthttps://github.com/modelcontextprotocol/modelcontextprotocol/issues?q=state%3Aopen%20label%3A%22enhancement%22
proposalSEP proposal without a sponsor.https://github.com/modelcontextprotocol/modelcontextprotocol/issues?q=state%3Aopen%20label%3A%22proposal%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.