MCP Server Framework - v1.0.0
    Preparing search index...

    Interface TokenVerifier

    Minimal interface for custom token verification.

    Implement this to integrate non-OAuth auth (API keys, JWTs, custom tokens) into the framework's auth pipeline. Structurally compatible with the SDK's OAuthTokenVerifier.

    const apiKeyVerifier: TokenVerifier = {
    verifyAccessToken: async (token) => {
    const user = await db.users.findByApiKey(token);
    if (!user) throw new Error('Invalid API key');
    return { token, clientId: user.id, scopes: user.permissions };
    },
    };
    interface TokenVerifier {
        verifyAccessToken(token: string): Promise<AuthInfo>;
    }
    Index

    Methods

    • Verify an access token and return auth information.

      Parameters

      • token: string

        The bearer token from the Authorization header

      Returns Promise<AuthInfo>

      Auth info with clientId, scopes, and optional expiry

      If the token is invalid, expired, or revoked