@mcp-z/oauth
    Preparing search index...

    @mcp-z/oauth

    @mcp-z/oauth

    Docs: https://mcp-z.github.io/oauth Multi-account OAuth orchestration and token storage for MCP servers.

    • Add consistent account tools to MCP servers
    • Store OAuth tokens with a shared config and storage backend
    • Reuse the same account lifecycle across Google and Microsoft providers
    npm install @mcp-z/oauth
    

    Optional storage backends:

    npm install keyv-duckdb
    npm install keyv-file
    npx @mcp-z/oauth init
    

    This creates a .tokens/ directory and a default config file for token storage.

    Use AccountServer to add account tools to your MCP server.

    When using loopback OAuth, these tools are added:

    • account-me
    • account-switch
    • account-remove
    • account-list

    When using stateless auth (DCR/bearer tokens), only this tool is available:

    • account-me
    import { AccountServer } from '@mcp-z/oauth';

    const { tools, prompts } = AccountServer.createLoopback({
    service: 'gmail',
    store: tokenStore,
    logger,
    auth: authProvider
    });

    Use sanitizeForLoggingFormatter to avoid leaking secrets in logs.

    • Node.js >= 22