Skip to content

feat(nitro): accept oauth on mcp() - #331

Merged
HugoRCD merged 1 commit into
mainfrom
feat/nitro-oauth-module-option
Sep 4, 2026
Merged

feat(nitro): accept oauth on mcp()#331
HugoRCD merged 1 commit into
mainfrom
feat/nitro-oauth-module-option

Conversation

@HugoRCD

@HugoRCD HugoRCD commented Sep 3, 2026

Copy link
Copy Markdown
Member

📚 Description

Stacked on #330.

mcp({ oauth }) protects a file-based endpoint without a route file. The module generates the createMcpOAuth call into its own virtual module, wires it as the handler's auth, and mounts the RFC 9728 protected-resource document on the path derived from resource — so a client that gets a 401 can find where to authenticate without any wiring on your side.

oauth and auth cannot both be set on one endpoint, and a config without a JWKS URL throws while the app is being built rather than accepting everything at runtime.

This is the second exception to "mcp() options are data": they cross into generated code as JSON, so a validate callback still means a route file, but JWT verification can be generated.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nuxt-mcp-toolkit-docs Ready Ready Preview Sep 4, 2026 8:58am UTC

Request Review

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Thank you for following the naming conventions! 🙏

Base automatically changed from feat/nitro-oauth-resource-server to main September 4, 2026 08:48
`mcp({ oauth })` protects a file-based endpoint without a route file. The
module generates the `createMcpOAuth` call into its own virtual module,
wires it as the handler's `auth`, and mounts the RFC 9728
protected-resource document on the path derived from `resource`.

`oauth` and `auth` cannot both be set on one endpoint, and a config
without a JWKS URL throws while the app is being built rather than
accepting everything at runtime.
@pkg-pr-new

pkg-pr-new Bot commented Sep 4, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/nitro-mcp-toolkit@331
npm i https://pkg.pr.new/@nuxtjs/mcp-toolkit@331

commit: b6abfe6

@HugoRCD HugoRCD self-assigned this Sep 4, 2026
@HugoRCD
HugoRCD merged commit 6f57222 into main Sep 4, 2026
15 checks passed
@HugoRCD
HugoRCD deleted the feat/nitro-oauth-module-option branch September 4, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant