# Auth MCP server

> Adds OAuth 2.1 authorization and provider connections to Node.js MCP servers with a few lines of code.

- Repository: https://github.com/mcp-auth/js
- Page: https://hostedmcp.org/servers/mcp-auth/js
- Transport: stdio
- Stars: 50
- License: MIT

## Install

### Claude Code

```sh
claude mcp add js -- npx -y @antogyn/mcp-auth
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "js": {
      "command": "npx",
      "args": [
        "-y",
        "@antogyn/mcp-auth"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "js": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@antogyn/mcp-auth"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"js","type":"stdio","command":"npx","args":["-y","@antogyn/mcp-auth"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "js": {
      "command": "npx",
      "args": [
        "-y",
        "@antogyn/mcp-auth"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add js -- npx -y @antogyn/mcp-auth
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.js]
command = "npx"
args = ["-y", "@antogyn/mcp-auth"]
```

### Gemini CLI

```sh
gemini mcp add -s user js npx -- -y @antogyn/mcp-auth
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "js": {
      "command": "npx",
      "args": [
        "-y",
        "@antogyn/mcp-auth"
      ]
    }
  }
}
```

## FAQ

### 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.
