Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

MCP Oauth Server

MCP server by wille Verified · npm:mcp-oauth-server

mcp-oauth-server is a self-hosted OAuth 2.1 authorization server for MCP servers, shipped as Express middleware in TypeScript. It is for developers building remote MCP servers who want their own login, consent and storage instead of a hosted auth vendor.

  • Score 83
  • 9 stars
  • 1.7k a week
  • MIT
  • Updated

Install MCP Oauth Server

Built from the published package, never by AI.

claude mcp add mcp-oauth-server -- npx -y mcp-oauth-server

Run in your terminal. Add --scope user to use it in every project.

Step-by-step: install MCP Oauth Server in Claude Code

MCP servers run with your permissions and can read what you give them access to. Some need an API key: check the README and add it under env in the mcp-oauth-server block.

About

mcp-oauth-server is a self-hosted OAuth 2.1 authorization server, packaged as Express middleware in TypeScript. It implements the MCP Authorization spec, so MCP clients such as Claude, ChatGPT and VS Code can register and obtain tokens from it. The package has no runtime dependency on the MCP SDK. It supports PKCE with S256, Client ID Metadata Documents, Dynamic Client Registration, resource indicators, token revocation and the device authorization grant. The library was originally forked from an OAuth server in the MCP TypeScript SDK.

The package is for developers building a remote MCP server who need an authorization server with their own login and consent screen and their own storage. The authorization server and the protected resource can run in one Express app or be split across services that share an OAuthServerModel. Teams that only need to validate tokens from an external identity provider can use requireBearerAuth with a custom verifier instead.

Written from the project's README and checked against it.

What you need

  • Node.js
  • Express
  • TypeScript

Try asking

  • Add OAuth 2.1 protection with PKCE to my remote MCP server
  • Set up Client ID Metadata Documents for my MCP authorization server
  • Enable the device authorization grant for my CLI MCP client

Good to know

  • Token introspection (RFC 7662) is not supported.
  • Only client_secret_post and none are supported for client authentication.
  • OpenID Connect Discovery 1.0 is not supported.
  • CIMD is opt-in and does not cover DNS rebinding or internal hostnames.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: README.md, package.json. This looks for known risky patterns and is not a full audit. How grades work

What you can do with it

  • Protect a remote MCP server with OAuth 2.1
  • Let MCP clients register and obtain tokens
  • Run a self-hosted authorization server without a vendor

Alternatives to MCP Oauth Server

All alternatives →
Agentmesh MCP Proxy microsoft
94

Agentmesh MCP Proxy is a security proxy for MCP servers, described by its publisher as a firewall for the Model Context Protocol. It is aimed at teams that run AI agents which call tools and other agents.

AAA Local 6.6k
Bla qybaihe
94

Hardens client-side artifacts such as binaries, Electron apps, JS bundles, Python and WebAssembly against AI reverse-engineering agents. Built for developers who ship proprietary logic to user-controlled devices.

AAA Local 7.3k
Bla Agents qybaihe
94

Bla Agents is an MCP server and CLI that adds seeded, format-specific decoys to shipped binaries, JavaScript, WebAssembly and other artifacts. It is for developers who ship proprietary logic to user-controlled devices and want to make AI reverse-engineering slower.

AAA Local 11k/wk
MCP Auth zgeoff
94

A shared OAuth server for the MCP route of an app, built on better-auth, with passkey sign-in for the owner

AAC Local 44k/wk
Agentos MCP Server microsoft
94

Agent Governance Toolkit adds policy enforcement, identity, sandboxing and audit logging to autonomous AI agents. It is aimed at teams shipping agents to production. The source does not confirm the Claude Desktop MCP server named in the listing.

AAA Local 6.6k
Convex MCP Gateway tfohlmeister
93

Convex MCP Gateway is a Convex component that exposes selected Convex functions as MCP tools. It checks each call with your own authorize callback and writes an audit log. It is for developers who run Convex apps and want AI assistants to call parts of them.

AAC Local 37k/wk

Compare with Agentmesh MCP Proxy, Bla or Bla Agents

MCP Oauth Server: common questions

Is mcp-oauth-server a hosted authentication service?

No. It is self-hosted and runs as Express middleware inside your own app, using your own login screen and storage.

Does it support Dynamic Client Registration?

Yes, under RFC 7591. The source says the MCP spec deprecates it in favor of Client ID Metadata Documents, and it is kept for backwards compatibility.

Can it be used only to validate tokens from another provider?

The source says that for that case you can use requireBearerAuth with a custom verifier instead of the full server.

How do I install MCP Oauth Server?

In Claude Code run claude mcp add mcp-oauth-server -- npx -y mcp-oauth-server. For Claude Desktop, Cursor and VS Code, paste the config shown above and restart. See the install guides.

Is MCP Oauth Server the official server?

MCP Oauth Server is published by npm:mcp-oauth-server from its verified domain in the official MCP Registry.

Is MCP Oauth Server free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is MCP Oauth Server safe to use?

It scores 83 of 100. Grades: maintenance A, licence A, quality C. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to MCP Oauth Server?

Similar MCP servers: Agentmesh MCP Proxy, Bla, Bla Agents, MCP Auth.

Does MCP Oauth Server work with ChatGPT?

Not directly. It runs locally, and ChatGPT only connects to remote servers with a URL. Use it in Claude Code, Claude Desktop, Cursor, VS Code or Codex.

MCP Oauth Server Install

Add to stack

Loading.