René's URL Explorer Experiment


Title: feat: support dynamic MCP primitive repositories by ultramancode · Pull Request #953 · modelcontextprotocol/java-sdk · GitHub

Open Graph Title: feat: support dynamic MCP primitive repositories by ultramancode · Pull Request #953 · modelcontextprotocol/java-sdk

X Title: feat: support dynamic MCP primitive repositories by ultramancode · Pull Request #953 · modelcontextprotocol/java-sdk

Description: Adds request-aware, pluggable repository APIs for dynamic MCP server primitives: tools, resources, prompts, and completions. This allows server implementations to resolve visible primitives from request/session context, while preserving the existing static in-memory registration behavior by default. Fixes #578 Motivation and Context Some MCP servers need to expose different tools, resources, prompts, or completion handlers depending on the authenticated user, tenant, token, or request context. This change makes primitive discovery and resolution request-aware: */list responses can be scoped per request context follow-up operations such as tools/call, resources/read, prompts/get, and completion/complete resolve through the same request-aware repositories custom implementations can choose their own pagination and cursor handling existing static registration methods continue to work through default in-memory repositories How Has This Been Tested? Added unit and in-process server tests for the new repository path, including request-context based tool/resource/prompt visibility, completion capability wiring, cursor forwarding, runtime add/remove behavior, repository/static registration conflict validation, and stateful list-changed notifications for supported runtime mutations. I tested the change locally end-to-end with a small servlet server and a Postman collection. The test server returns different tools, resources, prompts, and completions based on the X-User request header, so I could verify that listing and resolution both go through the repository layer. I also checked runtime add/remove behavior and stateful list-changed notifications. Files used for the local test: DynamicRepositoryDemoServlet.java dynamic-repository-demo.postman_collection.json I attached the servlet and Postman collection so the same checks can be reproduced locally. Breaking Changes None intended. Existing static registrations continue to work. When no custom repository is provided, registrations are loaded into default in-memory repositories. Types of changes Bug fix (non-breaking change which fixes an issue) New feature (non-breaking change which adds functionality) Breaking change (fix or feature that would cause existing functionality to change) Documentation update Checklist I have read the MCP Documentation My code follows the repository's style guidelines New and existing tests pass locally I have added appropriate error handling I have added or updated documentation as needed Additional context Design notes: Static registrations and custom repositories cannot be mixed for the same primitive family. This avoids implicit SDK-level merge semantics. Repository list methods receive McpSchema.PaginatedRequest, so custom implementations can choose whether and how to apply pagination and cursor handling.

Open Graph Description: Adds request-aware, pluggable repository APIs for dynamic MCP server primitives: tools, resources, prompts, and completions. This allows server implementations to resolve visible primitives from re...

X Description: Adds request-aware, pluggable repository APIs for dynamic MCP server primitives: tools, resources, prompts, and completions. This allows server implementations to resolve visible primitives from re...

Opengraph URL: https://github.com/modelcontextprotocol/java-sdk/pull/953

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:9ab5bb06-371b-3a36-4018-89408d8b885e
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD346:1247D9:244DBFB:3426A11:6A58F09C
html-safe-nonce2e3456c57f122a87b21cb87ef7809c2f64fc2ee9c59b1764d508e90ed18e3c74
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMzQ2OjEyNDdEOToyNDREQkZCOjM0MjZBMTE6NkE1OEYwOUMiLCJ2aXNpdG9yX2lkIjoiNTEyOTE4NDA0ODQzMTI5NjY2OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac932d8ee4ecf2a43a493e5790d8d2f0455eb9c9dbdcb7a688aff64ff8641ee08a
hovercard-subject-tagpull_request:3663224597
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/modelcontextprotocol/java-sdk/pull/953/files
twitter:imagehttps://avatars.githubusercontent.com/u/116135174?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/116135174?s=400&v=4
og:image:altAdds request-aware, pluggable repository APIs for dynamic MCP server primitives: tools, resources, prompts, and completions. This allows server implementations to resolve visible primitives from re...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None5f2a0c7865178af3d91dd9f13b0cdfc3c73a2529c873d2780bb4c01271a57ec6
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/modelcontextprotocol/java-sdk git https://github.com/modelcontextprotocol/java-sdk.git
octolytics-dimension-user_id182288589
octolytics-dimension-user_loginmodelcontextprotocol
octolytics-dimension-repository_id919609219
octolytics-dimension-repository_nwomodelcontextprotocol/java-sdk
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id919609219
octolytics-dimension-repository_network_root_nwomodelcontextprotocol/java-sdk
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8aae7b8d6caacacf5c66eaeb2702d8dc88d85b4a
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/modelcontextprotocol/java-sdk/pull/953/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fjava-sdk%2Fpull%2F953%2Ffiles
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%2Fjava-sdk%2Fpull%2F953%2Ffiles
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%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=modelcontextprotocol%2Fjava-sdk
Reloadhttps://github.com/modelcontextprotocol/java-sdk/pull/953/files
Reloadhttps://github.com/modelcontextprotocol/java-sdk/pull/953/files
Reloadhttps://github.com/modelcontextprotocol/java-sdk/pull/953/files
Please reload this pagehttps://github.com/modelcontextprotocol/java-sdk/pull/953/files
modelcontextprotocol https://github.com/modelcontextprotocol
java-sdkhttps://github.com/modelcontextprotocol/java-sdk
Notifications https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fjava-sdk
Fork 1.1k https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fjava-sdk
Star 3.6k https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fjava-sdk
Code https://github.com/modelcontextprotocol/java-sdk
Issues 131 https://github.com/modelcontextprotocol/java-sdk/issues
Pull requests 146 https://github.com/modelcontextprotocol/java-sdk/pulls
Discussions https://github.com/modelcontextprotocol/java-sdk/discussions
Actions https://github.com/modelcontextprotocol/java-sdk/actions
Projects https://github.com/modelcontextprotocol/java-sdk/projects
Models https://github.com/modelcontextprotocol/java-sdk/models
Security and quality 2 https://github.com/modelcontextprotocol/java-sdk/security
Insights https://github.com/modelcontextprotocol/java-sdk/pulse
Code https://github.com/modelcontextprotocol/java-sdk
Issues https://github.com/modelcontextprotocol/java-sdk/issues
Pull requests https://github.com/modelcontextprotocol/java-sdk/pulls
Discussions https://github.com/modelcontextprotocol/java-sdk/discussions
Actions https://github.com/modelcontextprotocol/java-sdk/actions
Projects https://github.com/modelcontextprotocol/java-sdk/projects
Models https://github.com/modelcontextprotocol/java-sdk/models
Security and quality https://github.com/modelcontextprotocol/java-sdk/security
Insights https://github.com/modelcontextprotocol/java-sdk/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fmodelcontextprotocol%2Fjava-sdk%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fmodelcontextprotocol%2Fjava-sdk%2Fissues%2Fnew%2Fchoose
ultramancodehttps://github.com/ultramancode
modelcontextprotocol:mainhttps://github.com/modelcontextprotocol/java-sdk/tree/main
ultramancode:feat/dynamic-mcp-primitiveshttps://github.com/ultramancode/java-sdk/tree/feat/dynamic-mcp-primitives
Conversation 7 https://github.com/modelcontextprotocol/java-sdk/pull/953
Commits 3 https://github.com/modelcontextprotocol/java-sdk/pull/953/commits
Checks 0 https://github.com/modelcontextprotocol/java-sdk/pull/953/checks
Files changed https://github.com/modelcontextprotocol/java-sdk/pull/953/files
Please reload this pagehttps://github.com/modelcontextprotocol/java-sdk/pull/953/files
feat: support dynamic MCP primitive repositories https://github.com/modelcontextprotocol/java-sdk/pull/953/files#top
Show all changes 3 commits https://github.com/modelcontextprotocol/java-sdk/pull/953/files
c021fbc feat(server): support dynamic MCP primitive repositories ultramancode May 11, 2026 https://github.com/modelcontextprotocol/java-sdk/pull/953/commits/c021fbc0038f5a3f8d04d7ac226dc70b9438d70d
443c220 Merge remote-tracking branch 'upstream/main' into feat/dynamic-mcp-pr… ultramancode May 13, 2026 https://github.com/modelcontextprotocol/java-sdk/pull/953/commits/443c220f544ba16303b6e14037a6700faf2713cb
a138128 Merge remote-tracking branch 'upstream/main' into feat/dynamic-mcp-pr… ultramancode Jun 3, 2026 https://github.com/modelcontextprotocol/java-sdk/pull/953/commits/a1381285b34a7820923a36b797f6b1c1761fe51b
Clear filters https://github.com/modelcontextprotocol/java-sdk/pull/953/files
Please reload this pagehttps://github.com/modelcontextprotocol/java-sdk/pull/953/files
Please reload this pagehttps://github.com/modelcontextprotocol/java-sdk/pull/953/files
CompletionsRepository.java https://github.com/modelcontextprotocol/java-sdk/pull/953/files#diff-94c7989e274ccf9134ff0ddca8ddef521955a049c8a1d4f4773930bdf94afd99
InMemoryCompletionsRepository.java https://github.com/modelcontextprotocol/java-sdk/pull/953/files#diff-c1cd20a5ddb41da6db0e757b487d492af9f447d272877886dbd089ed5166d628
InMemoryPromptsRepository.java https://github.com/modelcontextprotocol/java-sdk/pull/953/files#diff-edb4fba7d9deedd6f212a0a9f88a384804abf616491d01ce1d704952f003d529
InMemoryResourcesRepository.java https://github.com/modelcontextprotocol/java-sdk/pull/953/files#diff-4c8735f9d827b5723c0351100c4dd987b9052fdd8eac849879761f8f8dec2d30
InMemoryStatelessCompletionsRepository.java https://github.com/modelcontextprotocol/java-sdk/pull/953/files#diff-d022fb70694d788d552c974e26a1b9249e5c8eb5e38f3d108dc5454c508b4ea3
InMemoryStatelessPromptsRepository.java https://github.com/modelcontextprotocol/java-sdk/pull/953/files#diff-7fc0b0a6d1572cc2095f11d3d7ecf89e5b79371929c21372adb7ce04cd61467c
InMemoryStatelessResourcesRepository.java https://github.com/modelcontextprotocol/java-sdk/pull/953/files#diff-c0682ef1f8bc7d64ae87de93ddc12324318e2678eeac38a2ad21d912aa0a12fb
InMemoryStatelessToolsRepository.java https://github.com/modelcontextprotocol/java-sdk/pull/953/files#diff-8acd20bf9f520be1f6519cd7310086c030e90d382172c91bd2a223f782d6b86d
InMemoryToolsRepository.java https://github.com/modelcontextprotocol/java-sdk/pull/953/files#diff-ea769b3d0b6c715b5d41beabb74e132379abffed5e803706928bcff1c20f8c5f
McpAsyncServer.java https://github.com/modelcontextprotocol/java-sdk/pull/953/files#diff-43308c9508778eb339f4e3310a6d5ea62b6865e878b60367a810437623efc08f
McpServer.java https://github.com/modelcontextprotocol/java-sdk/pull/953/files#diff-197e53631067b9ceace45556d6b017b617a8185e73d3d0cda4b5183eb0854f22
McpServerFeatures.java https://github.com/modelcontextprotocol/java-sdk/pull/953/files#diff-effde46208dd9e3559462a27dc322c17c5c564232099bb441d20cfa37a3d872d
McpStatelessAsyncServer.java https://github.com/modelcontextprotocol/java-sdk/pull/953/files#diff-619ec8d6e2ba9cdf32ae43946adc3c6cee9209a4742afb8308ed3f8579d28689
McpStatelessServerFeatures.java https://github.com/modelcontextprotocol/java-sdk/pull/953/files#diff-8136b2e62811c0d9e694be501ebb7487c5e7e52012d449082a44892fd2bb46d9
McpStatelessSyncServer.java https://github.com/modelcontextprotocol/java-sdk/pull/953/files#diff-3ded4bd928422f4b89d82dbf583dfd0cd84569dea800f030bec0b098478e735d
McpSyncServer.java https://github.com/modelcontextprotocol/java-sdk/pull/953/files#diff-9a97c5273c2d210279bc6bfee3a4865fe993e9fe31dff202bfbf5f7d05dfdf13
PromptsRepository.java https://github.com/modelcontextprotocol/java-sdk/pull/953/files#diff-2b6f975c4b9d6bed7952fc0f972d7133e3b63841c9c9f3f6dc8d05befedaa6ec
ResourcesRepository.java https://github.com/modelcontextprotocol/java-sdk/pull/953/files#diff-87fdf33c2fb69210e5652f7c45f0abd70f7a42da7b3963be4a6085458905b208
StatelessCompletionsRepository.java https://github.com/modelcontextprotocol/java-sdk/pull/953/files#diff-0ba42d86999a3081d7aa9a0aae482c0c9f3f04b7ce70a7fa711c8a3d624a5f06
StatelessPromptsRepository.java https://github.com/modelcontextprotocol/java-sdk/pull/953/files#diff-2a9700f817ba3f738aeb8aee103d15311baf9f8748fddd1a87cf5a4e564bcac7
StatelessResourcesRepository.java https://github.com/modelcontextprotocol/java-sdk/pull/953/files#diff-0b0e840d4864254f5c40dfa858450d18526c479fd6fe83351fef6855fd59c24c
StatelessToolsRepository.java https://github.com/modelcontextprotocol/java-sdk/pull/953/files#diff-9d394050ad70b107adc32d73da804190d92fca2b3ff29f2111b375cfea4e925d
ToolsRepository.java https://github.com/modelcontextprotocol/java-sdk/pull/953/files#diff-332e5dbd751a66ec8f51611bfcf54c05d0477b223528da32b724d283cec55677
PrimitiveRepositoryTests.java https://github.com/modelcontextprotocol/java-sdk/pull/953/files#diff-425a9ab19b14736842aaa04a3c0b5345a232c8924f5cc4cdbac677b343c35f72
mcp-core/src/main/java/io/modelcontextprotocol/server/CompletionsRepository.javahttps://github.com/modelcontextprotocol/java-sdk/pull/953/files#diff-94c7989e274ccf9134ff0ddca8ddef521955a049c8a1d4f4773930bdf94afd99
View file https://github.com/modelcontextprotocol/java-sdk/blob/a1381285b34a7820923a36b797f6b1c1761fe51b/mcp-core/src/main/java/io/modelcontextprotocol/server/CompletionsRepository.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/java-sdk/pull/953/{{ revealButtonHref }}
mcp-core/src/main/java/io/modelcontextprotocol/server/InMemoryCompletionsRepository.javahttps://github.com/modelcontextprotocol/java-sdk/pull/953/files#diff-c1cd20a5ddb41da6db0e757b487d492af9f447d272877886dbd089ed5166d628
View file https://github.com/modelcontextprotocol/java-sdk/blob/a1381285b34a7820923a36b797f6b1c1761fe51b/mcp-core/src/main/java/io/modelcontextprotocol/server/InMemoryCompletionsRepository.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/java-sdk/pull/953/{{ revealButtonHref }}
mcp-core/src/main/java/io/modelcontextprotocol/server/InMemoryPromptsRepository.javahttps://github.com/modelcontextprotocol/java-sdk/pull/953/files#diff-edb4fba7d9deedd6f212a0a9f88a384804abf616491d01ce1d704952f003d529
View file https://github.com/modelcontextprotocol/java-sdk/blob/a1381285b34a7820923a36b797f6b1c1761fe51b/mcp-core/src/main/java/io/modelcontextprotocol/server/InMemoryPromptsRepository.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/java-sdk/pull/953/{{ revealButtonHref }}
mcp-core/src/main/java/io/modelcontextprotocol/server/InMemoryResourcesRepository.javahttps://github.com/modelcontextprotocol/java-sdk/pull/953/files#diff-4c8735f9d827b5723c0351100c4dd987b9052fdd8eac849879761f8f8dec2d30
View file https://github.com/modelcontextprotocol/java-sdk/blob/a1381285b34a7820923a36b797f6b1c1761fe51b/mcp-core/src/main/java/io/modelcontextprotocol/server/InMemoryResourcesRepository.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/java-sdk/pull/953/{{ revealButtonHref }}
.../src/main/java/io/modelcontextprotocol/server/InMemoryStatelessCompletionsRepository.javahttps://github.com/modelcontextprotocol/java-sdk/pull/953/files#diff-d022fb70694d788d552c974e26a1b9249e5c8eb5e38f3d108dc5454c508b4ea3
View file https://github.com/modelcontextprotocol/java-sdk/blob/a1381285b34a7820923a36b797f6b1c1761fe51b/mcp-core/src/main/java/io/modelcontextprotocol/server/InMemoryStatelessCompletionsRepository.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/java-sdk/pull/953/{{ revealButtonHref }}
Please reload this pagehttps://github.com/modelcontextprotocol/java-sdk/pull/953/files
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.