MCP Hub
Back to servers

@mcp-z/oauth

Validation Failed

A specialized MCP server for orchestrating multi-account OAuth authentication and secure token storage across providers like Google and Microsoft. It provides a standardized set of tools for account lifecycle management and identity switching.

Tools
4
Updated
Jan 2, 2026
Validated
Jan 9, 2026

Validation Error:

Process exited with code 1. stderr: npm error could not determine executable to run npm error A complete log of this run can be found in: /Users/mac/.npm/_logs/2026-01-09T09_13_39_418Z-debug-0.log

Quick Install

npx -y @mcp-z/oauth

@mcp-z/oauth

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

Common uses

  • 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

Install

npm install @mcp-z/oauth

Optional storage backends:

npm install keyv-duckdb
npm install keyv-file

Initialize token storage

npx @mcp-z/oauth init

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

Account tools and modes

Use AccountServer to add account tools to your MCP server.

Loopback mode (multi-account)

When using loopback OAuth, these tools are added:

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

Stateless mode (DCR/bearer)

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

  • account-me

Example

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

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

Logging helper

Use sanitizeForLoggingFormatter to avoid leaking secrets in logs.

Requirements

  • Node.js >= 22

Reviews

No reviews yet

Sign in to write a review