Repository navigation
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Thank you for following the naming conventions! 🙏 |
commit: |
This branch was successfully deployed
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.
Written by an AI agent on behalf of @HugoRCD, who shaped the solution. @HugoRCD has not reviewed it yet.
The beta guides still taught SDK-era APIs, and common typed tool outputs needed return annotations or
satisfies. This aligns the guides with the shared runtime, lets discovered endpoints keep runtime settings beside their definitions and read authentication credentials at request time, and makes enum/array output inference work without extra syntax. Nitro 2 also removes unused MCP/JWT dependencies from deployment output.Stack
Based on #405 (
v1-05-nuxt). Review after #402 → #403 → #405; retarget tov1as predecessors land. This PR includes the runtime auth and DX follow-up to the documentation work. Beta consumer readiness remains required before publishing.Changes
index.tswithdefineMcpServer()for metadata, instructions, protocol settings and runtime authentication. Keep routing and directory discovery in framework config. Index values override module defaults, the first layer containing an index wins, and conflicting authentication refuses requests. ExplicitdefineMcpAuth()files remain supported.llms.txt. Creation/removal of an index triggers a development rebuild; definition ownership remains per endpoint.toolResult()envelopes. Add public-type and emitted-declaration regressions.Server configuration beside definitions
nuxt.config.tsselects endpoints:server/mcp-admin/index.tsconfigures the admin server:Set
NUXT_MCP_ADMIN_TOKENat runtime. Add tools, resources and prompts under the same directory; no imports or registration lists are needed. Bare Nitro uses the same index convention with imports fromnitro-mcp-toolkit. Moduleauth/oauthcannot be combined with indexauth; invalid exports and ambiguous selected indexes refuse access.The Nuxt and Nitro playgrounds use this convention. The public metadata virtual reads only the selected index and does not load definitions or plugins, so install links and the optional
llms.txtsection use the same name, description and documentation URL as the endpoint.Output inference regression
The same TypeScript compiler input was checked with the previous
tool.tsfroma582ad1and the current source, using an in-memory source overlay. No checkout was reverted.test/types.test.tsalso checks invalid literal, missing-field, async, nested-array and callable-field results.Actual compiler input and before/after output
Packed consumer evidence
Actual output from the packed-package run using discovered index authentication, exit 0:
joseBytesmeasures rendered JWT code. Bearer-only consumers also assert no external jose files; OAuth consumers verify ES256 signatures and reject expired tokens and wrong audiences, serving modern and legacy clients.The earlier controlled experiment, with the same installed dependencies and fresh build directories, measured JavaScript gzip size of 161,388 → 120,433 bytes after the jose inlining rule. This is a minimal Nitro 2 fixture measurement, not a whole-application or deployment startup claim.
Portable helper types
Compiling the examples exposed H3 v1 alias collisions in continuation helpers and an unnecessary host-context requirement in the test client's fetch type. The public helper aliases now keep the exact engine function references while exposing canonical
h3/genericevent signatures, including signed-state callbacks and codecs. The test client requires the request-to-response function it actually calls.New regression tests cover inferred response types, canonical event/header access, state codecs, composed Nuxt handlers, and engine function identity. Patch changesets cover both packages. The same Nuxt type-check command failed before and passes after:
Original type-check failure excerpt
Command:
pnpm --filter @nuxtjs/mcp-toolkit typecheck, exit 1. Unedited excerpt:Final execution of the same command exits 0.
Evidence
The documented code was copied into a temporary production Nuxt consumer with a local JWKS issuer and real MCP clients. Captured output, exit 0:
Built documentation checks, exit 0:
Per-folder configuration verification
The final nuxt.com production build consumes locally packed toolkit packages. Actual discovery output, exit 0:
Real modern and legacy clients confirm exact per-directory catalogs, rejected cross-server calls, preserved admin instructions and runtime token checks. Missing, wrong and unconfigured admin tokens are refused. Installation links use the public server name from its index. The website’s 447 unit tests and 46 Nuxt integration tests pass; its published-preview build and type checking pass. Focused catalogs/auth/prompt checks pass against that artifact too. Its broader documentation-content smoke currently hits an external GitHub 403 fetching
nuxt/nuxt#4.x; the earlier local-candidate content smoke passed. See nuxt/nuxt.com#2567 for both results.Current validation and limitations
type, resource path values may be undefined, and a created todo may be undefined. The auth example prepared without errors.ELI5
Each MCP server keeps its description, instructions and access checks beside its tools. The guides match the beta APIs, ordinary tool results need less TypeScript boilerplate, and servers avoid shipping unused JWT code.