feat(nitro): install extension plugins from server/mcp/plugins.ts - #333
Open
HugoRCD wants to merge 1 commit into
Open
feat(nitro): install extension plugins from server/mcp/plugins.ts#333HugoRCD wants to merge 1 commit into
HugoRCD wants to merge 1 commit into
Conversation
An h3-mcp `ExtensionPlugin` is a live function, and `mcp()` options cross into generated code as JSON, so a plugin could not be passed as an option. A file beside `tools/`, `resources/` and `prompts/` can be: the generated handler imports its default export and hands it to `createMcpHandler` as `extensionPlugins`. `ExtensionPlugin` is now re-exported so the file can name the type it satisfies. Like a definition, the file belongs to whichever `mcp()` scans its directory. `discoverPlugins` returns every match rather than picking one, so the module can refuse an ambiguous pair while naming the route it belongs to. The handler virtual is async for the same reason the registry is — a file written after `setup` has to be seen at rebuild — and the watcher treats it like a definition, since nothing imports it until the handler is generated again.
2 tasks
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Thank you for following the naming conventions! 🙏 |
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
Stacked on #332. Independent of the OAuth work below it — it sits here only because it rewrites
renderHandler's signature, which #331 introduces.An h3-mcp
ExtensionPluginis a live function, andmcp()options cross into generated code as JSON, so a plugin could never be passed as an option. A file besidetools/,resources/andprompts/can be: the generated handler imports its default export and hands it tocreateMcpHandlerasextensionPlugins.ExtensionPluginis now re-exported so the file can name the type it satisfies.Like a definition, the file belongs to whichever
mcp()scans its directory.discoverPluginsreturns every match rather than picking one, so the module can refuse an ambiguous pair while naming the route it belongs to. The handler virtual becomes async for the same reason the registry is — a file written aftersetuphas to be seen at rebuild — and the watcher treats it like a definition, since nothing imports it until the handler is generated again.The
nitro-playgroundapp now ships one, and each build names the file it installed alongside the counts it reports.📝 Checklist