René's URL Explorer Experiment


Title: feat(mcp): add resource templates and a resources changed hook by erkamyaman · Pull Request #452 · devframes/devframe · GitHub

Open Graph Title: feat(mcp): add resource templates and a resources changed hook by erkamyaman · Pull Request #452 · devframes/devframe

X Title: feat(mcp): add resource templates and a resources changed hook by erkamyaman · Pull Request #452 · devframes/devframe

Description: What Two new MCP route options. mcp.resourceTemplates serves resources whose URI holds parameters, such as one page's data: mcp: { resourceTemplates: [{ uriTemplate: 'my-tool://page/{pageId}/tree', name: 'my-tool:page:tree', mimeType: 'application/json', list: ctx => pages(ctx).map(id => ({ uri: `my-tool://page/${id}/tree`, name: `Tree of ${id}` })), read: ({ pageId }, uri, ctx) => ({ json: treeOf(ctx, pageId) }), }], } With a non-empty list, resources/templates/list returns the templates and resources/list adds each template's list() entries. resources/read tries the templates after the registered and shared-state resources, and before the existing unknown-resource error. The first matching template wins. A result is text, or json stringified like the other resources. Matching is RFC 6570 level 1 ({var}) only. Each variable matches one non-empty segment and is percent-decoded, so / gives a /. Malformed percent-encoding does not match. An invalid template (an operator, a modifier, an empty {}, a stray brace, a repeated name) fails when the route mounts, with DF0084. A read or list that throws reaches the client the same way a throwing resource read does today. mcp.onResourcesChanged(notify, ctx) lets the host tell coding agents that the resource list changed. notify() sends notifications/resources/list_changed over HTTP and stdio. The returned unsubscribe runs when the server closes, and a notify() after that does nothing. list, read and the hook take the devframe context as their last argument. Route options are resolved before setup() runs, so this is how they reach live state. In the hub they get the hub context. Without these options the server is unchanged: resources/templates/list stays method-not-found and resources/list is the same. The options follow the same path as the other MCP route options: McpRouteOptions, resolveMcpConfig, mountMcpRoute, the hub's initHub, createMcpFetchHandler, stdio createMcpServer and the Next.js host. New types: McpResourceTemplate, McpResourceTemplateEntry, McpResourceTemplateContent, McpResourcesChangedHook. Why Pangular Inspector lets coding agents read one browser tab's data as pangular://page/{pageId}/, and tells them when a tab connects or goes away. Today it does this through a local patch of the dist. This moves both options into devframe. Tests mcp-server.test.ts: no change without templates, templates/list, reads with different parameters and several variables, percent-decoding, no match for an extra /, an empty segment or a malformed %, first match wins, registered resources first, list() entries, the context passed in, a throwing read, DF0084 for 8 invalid templates, and onResourcesChanged sending list_changed and unsubscribing on close. mcp-http.test.ts: templates over Streamable HTTP, and list_changed on a listen stream. devframe and hub initiate.test.ts: the options reach the route, and the hook gets the hub context and unsubscribes on close. pnpm lint && pnpm knip && pnpm test && pnpm typecheck && pnpm build pass. Note: DF0081 to DF0083 are left free because #451 and the prompts PR use them.

Open Graph Description: What Two new MCP route options. mcp.resourceTemplates serves resources whose URI holds parameters, such as one page's data: mcp: { resourceTemplates: [{ uriTemplate: 'my-tool://page/{...

X Description: What Two new MCP route options. mcp.resourceTemplates serves resources whose URI holds parameters, such as one page's data: mcp: { resourceTemplates: [{ uriTemplate: 'my-tool:...

Opengraph URL: https://github.com/devframes/devframe/pull/452

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:9b0ad47d-fb78-bceb-ec88-5264f25c5fed
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9FA0:352446:2600AF:34FA14:6AFB7C78
html-safe-nonced14341700d0980ceb8d7d9468eb22cab2956cecce3fa2baa5358d11fe33d6263
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RkEwOjM1MjQ0NjoyNjAwQUY6MzRGQTE0OjZBRkI3Qzc4IiwidmlzaXRvcl9pZCI6Ijg5ODE5ODQ0MzU1NDg5NDU1MjkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacfd55e4fbffeae871b76e1367ff2137e1a828dc6678bf2de066fdc6b98f4f0567
hovercard-subject-tagpull_request:4884101219
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/devframes/devframe/pull/452/files
twitter:imagehttps://avatars.githubusercontent.com/u/88717125?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/88717125?s=400&v=4
og:image:altWhat Two new MCP route options. mcp.resourceTemplates serves resources whose URI holds parameters, such as one page's data: mcp: { resourceTemplates: [{ uriTemplate: 'my-tool://page/{...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneef32892d4269fb87b55e81cc4ba8d86e0f16aa28446ffbf46cba8be5179ab188
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/devframes/devframe git https://github.com/devframes/devframe.git
octolytics-dimension-user_id279879373
octolytics-dimension-user_logindevframes
octolytics-dimension-repository_id1231722386
octolytics-dimension-repository_nwodevframes/devframe
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1231722386
octolytics-dimension-repository_network_root_nwodevframes/devframe
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
releasebc3703b4dcbe820d1284ef63c88b001c850be25e
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/devframes/devframe/pull/452/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdevframes%2Fdevframe%2Fpull%2F452%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdevframes%2Fdevframe%2Fpull%2F452%2Ffiles
Sign uphttps://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=devframes%2Fdevframe
Reloadhttps://github.com/devframes/devframe/pull/452/files
Reloadhttps://github.com/devframes/devframe/pull/452/files
Reloadhttps://github.com/devframes/devframe/pull/452/files
devframeshttps://github.com/devframes
devframehttps://github.com/devframes/devframe
Codehttps://github.com/devframes/devframe
Issues12 (12)https://github.com/devframes/devframe/issues
Pull requests13 (13)https://github.com/devframes/devframe/pulls
Actionshttps://github.com/devframes/devframe/actions
Security and qualityhttps://github.com/devframes/devframe/security
Insightshttps://github.com/devframes/devframe/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fdevframes%2Fdevframe%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fdevframes%2Fdevframe%2Fissues%2Fnew%2Fchoose
antfuhttps://github.com/antfu
devframes:mainhttps://github.com/devframes/devframe/tree/main
erkamyaman:feat/mcp-resource-templateshttps://github.com/erkamyaman/devframe/tree/feat/mcp-resource-templates
Conversation 12 https://github.com/devframes/devframe/pull/452
Commits 7 https://github.com/devframes/devframe/pull/452/commits
Checks 12 https://github.com/devframes/devframe/pull/452/checks
Files changed https://github.com/devframes/devframe/pull/452/files
Please reload this pagehttps://github.com/devframes/devframe/pull/452/files
feat(mcp): add resource templates and a resources changed hook https://github.com/devframes/devframe/pull/452/files#top
Show all changes 7 commits https://github.com/devframes/devframe/pull/452/files
56f387d feat(mcp): add resource templates and a resources changed hook erkamyaman Oct 16, 2026 https://github.com/devframes/devframe/pull/452/commits/56f387d45d75d7e3aae9854be5d3648071ce7e30
96640ea refactor(mcp): trim resource template listing and redundant tests antfubot Oct 20, 2026 https://github.com/devframes/devframe/pull/452/commits/96640ea2d602c717dc402b2f43b581bf020c9a85
d81d1d1 fix(mcp): match resource templates in one pass and keep a __proto__ v… erkamyaman Oct 20, 2026 https://github.com/devframes/devframe/pull/452/commits/d81d1d1e2cbf3a661686e7ba5ae16c07f9aee4ff
61427ef fix(mcp): do not split a template value inside a percent escape erkamyaman Oct 20, 2026 https://github.com/devframes/devframe/pull/452/commits/61427efbcc5307381b1f1dd71c4ba4008e1d820b
fd0b203 Merge remote-tracking branch 'origin/main' into erkamyaman/feat/mcp-r… antfubot Oct 30, 2026 https://github.com/devframes/devframe/pull/452/commits/fd0b203e5eaf3dd437552a4748bcf4f7376ace22
5c9c804 Merge remote-tracking branch 'origin/main' into erkamyaman/feat/mcp-r… antfubot Oct 30, 2026 https://github.com/devframes/devframe/pull/452/commits/5c9c8048ada1abb38e27376fb2a8f47b8859851c
8e5b23f refactor(mcp): trim resource template compile and tests antfubot Oct 30, 2026 https://github.com/devframes/devframe/pull/452/commits/8e5b23f875abd315968872962abead1f0c2317d9
Clear filters https://github.com/devframes/devframe/pull/452/files
Please reload this pagehttps://github.com/devframes/devframe/pull/452/files
Please reload this pagehttps://github.com/devframes/devframe/pull/452/files
18.hub-initiate.md https://github.com/devframes/devframe/pull/452/files#diff-c911ddd426817578cc6655c6ada19630b98f84f60f947704c3fc5cd2ba08c1bb
7.mcp.md https://github.com/devframes/devframe/pull/452/files#diff-769d96ffd948ba24074be6c6f8b457d5b1cd3df1633a14a996aa98344bc95b57
DF0084.md https://github.com/devframes/devframe/pull/452/files#diff-5ea9620035f1d1dd5aaa61ccfc7e753a9d5de759334cde7e12c12f00b8d83d10
index.md https://github.com/devframes/devframe/pull/452/files#diff-98be74a69c00df291caec3fa9122f7b7afc74b917b7ea8714472bdd2b7fd23f8
mcp-http.test.ts https://github.com/devframes/devframe/pull/452/files#diff-c608d44d08e96b055f973d8eccce399e4229a7029c428400fa73f767d09c5781
mcp-server.test.ts https://github.com/devframes/devframe/pull/452/files#diff-7ac7e9a9bae251339ab373422092dc488f6e7ffb379dd4cadc02069b36025f46
build-server.ts https://github.com/devframes/devframe/pull/452/files#diff-54466ac21a0dd3beacb5a3fca42cdd0499fac1aeabf34c5e16382d96881215db
fetch.ts https://github.com/devframes/devframe/pull/452/files#diff-b0103f51de2225c81fd6a44f57367bff6ba07f334d5699779dcd573a3541f7fc
_shared.ts https://github.com/devframes/devframe/pull/452/files#diff-cdd58b3ec2c6b0f9cfea033419805385934c80e092023dd55f6b8bf4f17490d0
initiate.ts https://github.com/devframes/devframe/pull/452/files#diff-a9bcfb29d9c365ee0dd03456bdef86e93a812ea81bdada66f197d5e0d7631975
mcp.ts https://github.com/devframes/devframe/pull/452/files#diff-80afc426c9bbc971ff5797d832aab1c917a2806feca3b146f18e31ff3b730c98
diagnostics.ts https://github.com/devframes/devframe/pull/452/files#diff-509316a0571ce8effd61922fd33d28e974c8cb509b3d59a3fdb15a5ee20bdc3f
devframe.ts https://github.com/devframes/devframe/pull/452/files#diff-753444a22cd40457a3aeb4a48d0bda1e9c7768bca343ccf72f16699131320795
mcp.ts https://github.com/devframes/devframe/pull/452/files#diff-f7efa41fc8522b5175dcfc82f1b794d55f8b8d7c51d4e571eda478e1c355b752
initiate.test.ts https://github.com/devframes/devframe/pull/452/files#diff-25706eadb28a322bb2a43ffff82c94d39cf906ed65c2d9a10b26ee6fc3d4e907
initiate.ts https://github.com/devframes/devframe/pull/452/files#diff-500061a187e404009222ccd84a3d851545df0a3826241909a3b3b3d9580a4b02
host.ts https://github.com/devframes/devframe/pull/452/files#diff-994880ec688e6b1d550ad444739813a3c806ad75e2a7f5531d6708ba2f44dea4
hub.snapshot.d.ts https://github.com/devframes/devframe/pull/452/files#diff-d1187b5290bedae6a899fd021b09002d161dc2abae3201aee17793335d2b8998
mcp.snapshot.d.ts https://github.com/devframes/devframe/pull/452/files#diff-c19fa429000946da1295f5a22441c2c7b60729284a66e1f490d00f42999d2495
index.snapshot.d.ts https://github.com/devframes/devframe/pull/452/files#diff-e36c6d402239a03e9a6e3a7c285d18780f3584e9dd275c7e5220a6fc41fb160d
internal.snapshot.d.ts https://github.com/devframes/devframe/pull/452/files#diff-cf90d6f74b3f49997e90ee080ce227993bfabf8fadfa4f1d20f7644c507b10d0
types.snapshot.d.ts https://github.com/devframes/devframe/pull/452/files#diff-c53339d04f6316f1476d6844f94bc701efbac1c0e63dd7200d31a385ff9a3ad9
docs/content/1.guide/18.hub-initiate.mdhttps://github.com/devframes/devframe/pull/452/files#diff-c911ddd426817578cc6655c6ada19630b98f84f60f947704c3fc5cd2ba08c1bb
View file https://github.com/erkamyaman/devframe/blob/8e5b23f875abd315968872962abead1f0c2317d9/docs/content/1.guide/18.hub-initiate.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/devframes/devframe/pull/452/{{ revealButtonHref }}
https://github.com/devframes/devframe/pull/452/files#diff-c911ddd426817578cc6655c6ada19630b98f84f60f947704c3fc5cd2ba08c1bb
https://github.com/devframes/devframe/pull/452/files#diff-c911ddd426817578cc6655c6ada19630b98f84f60f947704c3fc5cd2ba08c1bb
docs/content/2.adapters/7.mcp.mdhttps://github.com/devframes/devframe/pull/452/files#diff-769d96ffd948ba24074be6c6f8b457d5b1cd3df1633a14a996aa98344bc95b57
View file https://github.com/erkamyaman/devframe/blob/8e5b23f875abd315968872962abead1f0c2317d9/docs/content/2.adapters/7.mcp.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/devframes/devframe/pull/452/{{ revealButtonHref }}
https://github.com/devframes/devframe/pull/452/files#diff-769d96ffd948ba24074be6c6f8b457d5b1cd3df1633a14a996aa98344bc95b57
https://github.com/devframes/devframe/pull/452/files#diff-769d96ffd948ba24074be6c6f8b457d5b1cd3df1633a14a996aa98344bc95b57
docs/content/6.errors/DF0084.mdhttps://github.com/devframes/devframe/pull/452/files#diff-5ea9620035f1d1dd5aaa61ccfc7e753a9d5de759334cde7e12c12f00b8d83d10
View file https://github.com/erkamyaman/devframe/blob/8e5b23f875abd315968872962abead1f0c2317d9/docs/content/6.errors/DF0084.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/devframes/devframe/pull/452/{{ revealButtonHref }}
docs/content/6.errors/index.mdhttps://github.com/devframes/devframe/pull/452/files#diff-98be74a69c00df291caec3fa9122f7b7afc74b917b7ea8714472bdd2b7fd23f8
View file https://github.com/erkamyaman/devframe/blob/8e5b23f875abd315968872962abead1f0c2317d9/docs/content/6.errors/index.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/devframes/devframe/pull/452/{{ revealButtonHref }}
https://github.com/devframes/devframe/pull/452/files#diff-98be74a69c00df291caec3fa9122f7b7afc74b917b7ea8714472bdd2b7fd23f8
https://github.com/devframes/devframe/pull/452/files#diff-98be74a69c00df291caec3fa9122f7b7afc74b917b7ea8714472bdd2b7fd23f8
packages/agentic/src/mcp/__tests__/mcp-http.test.tshttps://github.com/devframes/devframe/pull/452/files#diff-c608d44d08e96b055f973d8eccce399e4229a7029c428400fa73f767d09c5781
View file https://github.com/erkamyaman/devframe/blob/8e5b23f875abd315968872962abead1f0c2317d9/packages/agentic/src/mcp/__tests__/mcp-http.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/devframes/devframe/pull/452/{{ revealButtonHref }}
https://github.com/devframes/devframe/pull/452/files#diff-c608d44d08e96b055f973d8eccce399e4229a7029c428400fa73f767d09c5781
https://github.com/devframes/devframe/pull/452/files#diff-c608d44d08e96b055f973d8eccce399e4229a7029c428400fa73f767d09c5781
https://github.com/devframes/devframe/pull/452/files#diff-c608d44d08e96b055f973d8eccce399e4229a7029c428400fa73f767d09c5781
https://github.com/devframes/devframe/pull/452/files#diff-c608d44d08e96b055f973d8eccce399e4229a7029c428400fa73f767d09c5781
Please reload this pagehttps://github.com/devframes/devframe/pull/452/files
Please reload this pagehttps://github.com/devframes/devframe/pull/452/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.