This is the documentation for the v2 beta — looking for the v1 documentation?
Skip to content

MCP TypeScript SDK (V2) / @modelcontextprotocol/server-legacy / auth

auth

Interfaces

AuthInfo

Defined in: packages/core-internal/src/types/types.ts:724

Information about a validated access token, provided to request handlers.

Properties

clientId

clientId: string

Defined in: packages/core-internal/src/types/types.ts:733

The client ID associated with this token.

expiresAt?

optional expiresAt?: number

Defined in: packages/core-internal/src/types/types.ts:743

When the token expires (in seconds since epoch).

extra?

optional extra?: Record<string, unknown>

Defined in: packages/core-internal/src/types/types.ts:755

Additional data associated with the token. This field should be used for any additional data that needs to be attached to the auth info.

resource?

optional resource?: URL

Defined in: packages/core-internal/src/types/types.ts:749

The RFC 8707 resource server identifier for which this token is valid. If set, this MUST match the MCP server's resource identifier (minus hash fragment).

scopes

scopes: string[]

Defined in: packages/core-internal/src/types/types.ts:738

Scopes associated with this token.

token

token: string

Defined in: packages/core-internal/src/types/types.ts:728

The access token.

References

AccessDeniedError

Re-exports AccessDeniedError


allowedMethods

Re-exports allowedMethods


authenticateClient

Re-exports authenticateClient


AuthMetadataOptions

Re-exports AuthMetadataOptions


authorizationHandler

Re-exports authorizationHandler


AuthorizationHandlerOptions

Re-exports AuthorizationHandlerOptions


AuthorizationParams

Re-exports AuthorizationParams


AuthRouterOptions

Re-exports AuthRouterOptions


BearerAuthMiddlewareOptions

Re-exports BearerAuthMiddlewareOptions


ClientAuthenticationMiddlewareOptions

Re-exports ClientAuthenticationMiddlewareOptions


clientRegistrationHandler

Re-exports clientRegistrationHandler


ClientRegistrationHandlerOptions

Re-exports ClientRegistrationHandlerOptions


createOAuthMetadata

Re-exports createOAuthMetadata


CustomOAuthError

Re-exports CustomOAuthError


getOAuthProtectedResourceMetadataUrl

Re-exports getOAuthProtectedResourceMetadataUrl


InsufficientScopeError

Re-exports InsufficientScopeError


InvalidClientError

Re-exports InvalidClientError


InvalidClientMetadataError

Re-exports InvalidClientMetadataError


InvalidGrantError

Re-exports InvalidGrantError


InvalidRequestError

Re-exports InvalidRequestError


InvalidScopeError

Re-exports InvalidScopeError


InvalidTargetError

Re-exports InvalidTargetError


InvalidTokenError

Re-exports InvalidTokenError


mcpAuthMetadataRouter

Re-exports mcpAuthMetadataRouter


mcpAuthRouter

Re-exports mcpAuthRouter


metadataHandler

Re-exports metadataHandler


MethodNotAllowedError

Re-exports MethodNotAllowedError


OAUTH_ERRORS

Re-exports OAUTH_ERRORS


OAuthError

Re-exports OAuthError


OAuthRegisteredClientsStore

Re-exports OAuthRegisteredClientsStore


OAuthServerProvider

Re-exports OAuthServerProvider


OAuthTokenVerifier

Re-exports OAuthTokenVerifier


ProxyEndpoints

Re-exports ProxyEndpoints


ProxyOAuthServerProvider

Re-exports ProxyOAuthServerProvider


ProxyOptions

Re-exports ProxyOptions


redirectUriMatches

Re-exports redirectUriMatches


requireBearerAuth

Re-exports requireBearerAuth


revocationHandler

Re-exports revocationHandler


RevocationHandlerOptions

Re-exports RevocationHandlerOptions


ServerError

Re-exports ServerError


TemporarilyUnavailableError

Re-exports TemporarilyUnavailableError


tokenHandler

Re-exports tokenHandler


TokenHandlerOptions

Re-exports TokenHandlerOptions


TooManyRequestsError

Re-exports TooManyRequestsError


UnauthorizedClientError

Re-exports UnauthorizedClientError


UnsupportedGrantTypeError

Re-exports UnsupportedGrantTypeError


UnsupportedResponseTypeError

Re-exports UnsupportedResponseTypeError


UnsupportedTokenTypeError

Re-exports UnsupportedTokenTypeError