2026-07-28 Authorization Specification on top of NeuroFusion’s existing passwordless Nostr authentication. MCP clients obtain short-lived, audience-bound OAuth 2.1 access tokens without ever handling your Nostr private key or web session token.
Discovery Endpoints
Unauthenticated requests toPOST /mcp return 401 Unauthorized with a WWW-Authenticate challenge pointing to the Protected Resource Metadata document:
Protected Resource Metadata
Per MCP
2026-07-28, offline_access is intentionally omitted from Protected Resource Metadata and WWW-Authenticate headers, and is advertised only in Authorization Server Metadata.Authorization Server Metadata
Client Registration
Two registration mechanisms are supported:-
OAuth Client ID Metadata Documents (CIMD — Primary):
- Use an
https://URL with a non-root path as yourclient_id(for example,https://client.example.com/oauth/client-metadata.json). - The metadata document’s
client_idmust match the URL string-for-string and provide a non-emptyclient_nameandredirect_uris(https://or loopbackhttp://localhost/http://127.0.0.1/http://[::1]). - Symmetric
client_secret_*auth methods are rejected for CIMD clients, and metadata fetches enforce SSRF protection (blocking loopback, private, and link-local IPs).
- Use an
-
Dynamic Client Registration (
POST /oauth/register— RFC 7591):- Supported for backwards compatibility with clients that do not yet implement CIMD.
- Supports
application_type(webornative) and enforces HTTPS or loopback redirect URIs with no fragments or wildcards.
Authorization & Consent Flow
1
Start OAuth Authorization with PKCE S256
The client opens the browser to
GET /oauth/authorize with response_type=code, client_id, redirect_uri, code_challenge, code_challenge_method=S256, resource=https://neurofusionbackendprd.azurewebsites.net/mcp, scope, and state.2
Sign In with NeuroFusion Nostr Auth
If you are not signed in to NeuroFusion, the web app redirects you to
https://usefusion.ai/auth/login to complete the standard Nostr NIP-04 / NIP-07 login flow, then returns you to https://usefusion.ai/oauth/authorize.3
Review & Approve Scopes
The
https://usefusion.ai/oauth/authorize consent screen displays the client name, client URI, registration method, redirect URI hostname (with an explicit warning banner for localhost/127.0.0.1 redirects), and interactive checkboxes so you can approve or narrow the requested scopes.4
Exchange Code for Access Token
NeuroFusion redirects back to
redirect_uri with code, state, and iss (RFC 9207 mix-up protection). The client exchanges the one-time code and code_verifier at POST /oauth/token with resource=https://neurofusionbackendprd.azurewebsites.net/mcp.For native loopback clients (
http://127.0.0.1:<port>/callback or http://localhost:<port>/callback), ephemeral port matching is supported per RFC 8252 Section 7.3 as long as the scheme, hostname, path, and query match a registered loopback redirect URI.OAuth Scopes & Hierarchy
Each*:write scope automatically implies its corresponding *:read scope:
Step-Up Authorization (403 insufficient_scope)
If a client calls a tool or reads a resource that requires a scope not present in its current token, /mcp responds with 403 Forbidden and a standard RFC 6750 step-up challenge:
Token Lifecycle, Rotation & Isolation
Transport & Header Security
Requests toPOST /mcp enforce additional MCP 2026-07-28 safeguards:
- Origin Validation (DNS Rebinding Protection): When an
Originheader is present, it must match an allowed origin (configuredFRONTEND_URL, server origin,https://usefusion.ai, orMCP_ALLOWED_ORIGINS; loopback origins are allowed in non-production). Untrusted origins receive403 Forbidden. - Header-vs-Body Consistency: If
MCP-Protocol-Version,Mcp-Method, orMcp-Nameheaders are sent, they must match the JSON-RPC payload (params._meta["io.modelcontextprotocol/protocolVersion"],method, andparams.name/params.uri); mismatches return400 Bad Request.

