js
๐ Plug-and-play auth for Node.js MCP servers.
claude mcp add --transport stdio mcp-auth-js npx -y mcp-auth
How to use
This MCP server provides the MCP_AUTH.js SDK, enabling you to connect to trusted providers using modern OAuth 2.1 flows and related RFCs. It offers utilities to discover provider compatibility, perform authentication flows, and validate tokens within your MCP-enabled environment. The included tools help you verify provider support in real time and streamline integration with the MCP ecosystem.
To start using it, install the package in your Node.js project and import the SDK where you handle authentication. Initialize the client with the provider you intend to support, and then leverage the library's methods to start the OAuth flow, fetch and refresh tokens, and verify the authenticated session. The library aims to minimize boilerplate while remaining compliant with MCP requirements and provider-specific nuances.
How to install
Prerequisites:
- Node.js (recommended: latest LTS) installed on your system
- npm or pnpm/yarn as your package manager
Install the MCP Auth package:
npm install mcp-auth
Alternatively, with pnpm or yarn:
pnpm add mcp-auth
yarn add mcp-auth
Usage outline:
- Import the SDK into your project
- Initialize the client with your provider configuration
- Use the authentication helpers to start OAuth flows, exchange codes for tokens, and validate sessions
For more details, refer to the package documentation linked in the repository.
Additional notes
Notes:
- This package focuses on MCP-compatible authentication flows, primarily OAuth 2.1; ensure your provider supports the required scopes and endpoints.
- The MCP ecosystem often requires provider compatibility checks; use the SDKโs built-in utilities to verify support before initiating flows.
- If you encounter network or token issues, verify client credentials, redirect URIs, and clock synchronization (token validation is time-sensitive).
- When deploying, consider environment variables for client IDs/secrets (do not hard-code them); you can inject them at runtime through your hosting platform.
Related MCP Servers
pluggedin-app
The Crossroads for AI Data Exchanges. A unified, self-hostable web interface for discovering, configuring, and managing Model Context Protocol (MCP) serversโbringing together AI tools, workspaces, prompts, and logs from multiple MCP sources (Claude, Cursor, etc.) under one roof.
python
๐ Plug-and-play auth for Python MCP servers.
any-script
An MCP server that exposes arbitrary CLI tools and shell scripts as MCP Tools
mcp -weather-js
Simple Weather MCP Server Example
google -remote
Collection of Google-native tools (e.g., Gmail, Calendar) for the MCP
zenstack -auth
ZenStack Remote MCP Server with Authorization