NEUS MCP uses OAuth 2.0 Authorization Code with PKCE (RFC 6749 + RFC 7636) as the primary authentication flow for MCP clients. OAuth wraps the existing NEUS hosted login. The user sees the same NEUS sign-in page — OAuth provides the standard contract that MCP clients expect.Documentation Index
Fetch the complete documentation index at: https://docs.neus.network/llms.txt
Use this file to discover all available pages before exploring further.
Flow overview
How /oauth/authorize works
The/oauth/authorize endpoint owns all OAuth validation and orchestrates the login flow. The frontend does not manually invent or own the OAuth callback behavior.
- Validates all OAuth parameters:
response_type=code,client_id,redirect_uri,code_challenge_method=S256,resource=https://mcp.neus.network/mcp. - If no NEUS session: stores the pending OAuth request server-side, then redirects/renders the existing HostedLoginFlow (the same passkey/wallet login used everywhere on NEUS).
- After login: returns to the
/oauth/authorizecontinuation, where the backend issues a one-time authorization code bound to subjectId, client_id, redirect_uri, code_challenge, resource, and scope. - Redirects to
redirect_uri?code=...&state=....
Discovery
Protected resource metadata
Authorization server metadata
Authorization
| Parameter | Required | Description |
|---|---|---|
response_type | Yes | Must be code |
client_id | Yes | Registered client identifier |
redirect_uri | Yes | Must exactly match a registered URI |
code_challenge | Yes | PKCE challenge (BASE64URL of SHA-256 of code_verifier) |
code_challenge_method | Yes | Must be S256 |
state | Yes | CSRF protection — returned verbatim |
scope | No | Default: neus:core neus:profile neus:secrets offline_access |
resource | Yes | Must be https://mcp.neus.network/mcp |
Token exchange
Refresh tokens
offline_access in the initial scope to receive one.
Token claims
The MCP access token is a JWT:| Claim | Value | Description |
|---|---|---|
iss | https://neus.network | Token issuer |
aud | https://mcp.neus.network/mcp | Resource audience — MCP server validates this |
sub | Profile subject ID | Unique user identifier |
did | did:pkh:... | Decentralized identifier |
azp | Client ID | Client that requested the token |
scope | Space-separated | Granted scopes |
token_use | mcp_access | Token type — MCP server rejects other values |
iat | Unix seconds | Issued at |
exp | Unix seconds | Expires at |
aud is https://mcp.neus.network/mcp, iss is https://neus.network, token_use is mcp_access, and the token is not expired or revoked.
Scope model
| Scope | Description | Default |
|---|---|---|
neus:core | Public protocol tools | Yes |
neus:profile | Signed-in profile via neus_me | Yes |
neus:secrets | Portable encrypted secrets | Yes |
offline_access | Refresh token | Yes |
Revocation
Compatibility
The existing/verify?intent=mcp flow remains as a compatibility alias. New integrations should use the standard OAuth endpoints.
Registered clients
client_id | Use |
|---|---|
neus-cli | NEUS SDK CLI (neus auth) — loopback redirect on 127.0.0.1 |
/.well-known/mcp.json.
Security properties
| Property | Enforcement |
|---|---|
| PKCE required | code_challenge_method=S256 is mandatory |
| Exact redirect_uri match | Prevents open redirect attacks |
| State parameter preserved | CSRF protection |
| Resource indicator required | Prevents token misuse across services |
| Token audience validated | MCP tokens cannot be used for other NEUS services |
| Refresh token rotation | Old refresh token invalidated on each use |
| Tokens never in query strings | Bearer header only |
| Single-use auth codes | Code invalidated after first exchange |
| Access key fallback | For servers and automation where browser is unavailable |
Auth
Keys and headers.
Setup
Install and configure.
Endpoints
Discovery URLs.