Adds OAuth 2.1 authorization and provider connections to Node.js MCP servers with a few lines of code.
Also known as mcp-auth/js, @antogyn/mcp-auth, mcp-auth
- Stars
- 50
- Tools
- —
- Downloads, 30 days
- 24,687
- Latest version
- —
- Last commit
- Aug 31, 2026
- License
- MIT
What is Auth MCP?
Auth adds OAuth 2.1 authorization and provider connections to Node.js MCP servers with a few lines of code.
Summary generated from the project's README
About Auth MCP server
Integrating OAuth 2.1 authorization into Node.js MCP servers becomes a streamlined process for developers using this SDK. It allows creators to connect their servers to trusted identity providers without spending weeks implementing complex security protocols manually. The library is designed specifically for those building with the MCP TypeScript SDK v2, though it maintains compatibility for users still on the v1 @modelcontextprotocol/sdk by using the 0.2 version line.
By implementing RFC 9728 Protected Resource Metadata and RFC 8707 audience-bound token validation, the package ensures that servers meet the latest Model Context Protocol specification requirements. Developers can install the package via npm, pnpm, or yarn to add these security features to their local or remote server environments. It supports any OAuth 2.0 or OpenID Connect provider that meets the compatibility criteria.
What you can do with it
- 1Connect to identity providersYou can link your MCP server to an existing OpenID Connect provider using minimal code.
Written from the project's README. Every use case is checked against a quote from it.
How to install Auth MCP
Formats verified 10 Nov 2026Add to CursorAdd to GooseInstall Auth MCP in Claude Code
$ claude mcp add js -- npx -y @antogyn/mcp-authInstall Auth MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"js": {
"command": "npx",
"args": [
"-y",
"@antogyn/mcp-auth"
]
}
}
}Install Auth MCP in VS Code
.vscode/mcp.json
{
"servers": {
"js": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@antogyn/mcp-auth"
]
}
}
}Install Auth MCP in VS Code CLI
$ code --add-mcp '{"name":"js","type":"stdio","command":"npx","args":["-y","@antogyn/mcp-auth"]}'Install Auth MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"js": {
"command": "npx",
"args": [
"-y",
"@antogyn/mcp-auth"
]
}
}
}Install Auth MCP in Codex
$ codex mcp add js -- npx -y @antogyn/mcp-authInstall Auth MCP in Codex config.toml
~/.codex/config.toml
[mcp_servers.js] command = "npx" args = ["-y", "@antogyn/mcp-auth"]
Install Auth MCP in Gemini CLI
$ gemini mcp add -s user js npx -- -y @antogyn/mcp-authInstall Auth MCP in Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"js": {
"command": "npx",
"args": [
"-y",
"@antogyn/mcp-auth"
]
}
}
}Automated checks
Ran Nov 12, 2026Full report →Passed our automated checks. That is not a security audit: read the code and give the server the narrowest access it needs. How checks work
- Source repository linked and reachablePass
- Open source license (OSI)Pass
- Commit or release in the last yearPass
- Package name not close to a popular packagePass
- Remote endpoint uses HTTPSNot checked
- Destructive tools are labelledNot checked
- No hidden instructions to the modelPass
- No critical advisory in the package or its dependenciesNot checked
README
View on GitHubMCP Auth Node.js SDK
The MCP spec requires OAuth 2.1 and other RFCs for auth. Instead of spending weeks on them, use MCP Auth to connect to a trusted provider with a few lines of code.
mcp-auth targets the latest MCP specification and the MCP TypeScript SDK v2, implementing the spec's authorization requirements — RFC 9728 Protected Resource Metadata and RFC 8707 audience-bound token validation — for any OAuth 2.0 / OpenID Connect provider.
Get started
Is my provider supported?
Check out the MCP-compatible providers to see which providers are supported. It also includes a tool for real-time checking of provider compatibility.
Installation
npm install mcp-auth
Or use your package manager of choice, such as pnpm or yarn.
Still on MCP SDK v1 (@modelcontextprotocol/sdk)? Stay on the 0.2 line — npm install mcp-auth@0.2 — and see the v0.2.0 code and samples.
See the documentation for the full guide.
Join the discussion
Join the MCP Auth org discussion to ask questions or share your feedback.
Auth MCP questions
How do I add Auth MCP to Claude Code?
Run claude mcp add js -- npx -y @antogyn/mcp-auth in your terminal. Add --scope user to make it available in every project.
How do I add Auth MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
How do I add OAuth authentication to a Node.js MCP server?
Install the mcp-auth package with npm and configure it to connect to a supported OAuth 2.0 or OpenID Connect provider in a few lines of code.
Which MCP specification version does mcp-auth target?
It targets the latest MCP specification and the MCP TypeScript SDK v2.
Which providers are supported by mcp-auth?
It supports any OAuth 2.0 / OpenID Connect provider, and there is an MCP-compatible providers list with a compatibility checker.
Can I use mcp-auth with MCP SDK v1?
Yes, stay on the 0.2 line and install mcp-auth@0.2 when using @modelcontextprotocol/sdk v1.