Skip to content
PluginStats

mcp-auth weekly downloads statistics

By mcp-auth · npm · MCP servers

Plug and play auth for Model Context Protocol (MCP) servers

View on npm Outdated · Oct 27, 2026

mcp-auth has 9,248 recorded weekly downloads on npm, an increase of 23.5% over the past 30 days, ranking #1296 of 3,247 tracked listings.

Weekly downloads
9,248
Official API · Dec 5, 2026
7-day growth
+88.2%
+4.3K weekly downloads
30-day growth
+23.5%
+1.8K weekly downloads
90-day growth
-59.3%
-13.5K weekly downloads
Rank
#1296
▲ 206 in 7 days

About mcp-auth

mcp-auth

The MCP SDK asks you to bring two things: a token verifier and your auth metadata. mcp-auth gives you both, for any OAuth / OIDC provider.

Docs & tutorials · Sample servers

The MCP TypeScript SDK v2 (@modelcontextprotocol/server) ships the entire HTTP layer of MCP authorization itself: requireBearerAuth, verifyBearerToken, oauthMetadataResponse, and official framework adapters like @modelcontextprotocol/express. What it leaves to you is provider integration: verifying the access tokens your OAuth 2.0 / OpenID Connect provider issues, and describing that provider in your server's metadata.

That is exactly what mcp-auth does:

  1. A token verifier: MCPAuth implements the SDK's OAuthTokenVerifier interface. It discovers your provider's metadata, fetches its JWKS, and verifies JWT access tokens (signature, issuer, audience, expiration, and the claims MCP servers need), with sensible caching throughout. mcpAuth.getBearerAuthOptions() bundles the verifier with the RFC 9728 metadata URL into the SDK's BearerAuthOptions, ready for requireBearerAuth.
  2. Your auth metadata: mcpAuth.getAuthMetadataOptions() returns the SDK's AuthMetadataOptions, ready to serve the OAuth discovery documents.

It implements the authorization requirements of the latest MCP specification and works with any OAuth 2.0 / OpenID Connect provider that meets them.

Installation

npm install mcp-auth @modelcontextprotocol/server

@modelcontextprotocol/server v2 is a peer dependency. Node.js >= 20; ESM only. Still on MCP SDK v1 (@modelcontextprotocol/sdk)? Use mcp-auth@0.2.

Get started

import {
  createMcpHandler,
  McpServer,
  oauthMetadataResponse,
  requireBearerAuth,
} from '@modelcontextprotocol/server';
import { getAuthInfo, MCPAuth } from 'mcp-auth';

// 1. Declare this MCP server and the authorization server it trusts
const mcpAuth = new MCPAuth({
  protectedResourceMetadata: {
    resource: 'https://api.example.com/mcp',
    authorizationServer: { issuer: 'https://auth.example.com/oidc', type: 'oidc' },
    scopesSupported: ['read:notes'],
  },
});

// 2. Gate your MCP endpoint: signature, issuer, audience, expiration, and scopes all enforced
const gate = requireBearerAuth(mcpAuth.getBearerAuthOptions({ requiredScopes: ['read:notes'] }));

// 3. Read the verified identity in your tools with `getAuthInfo`
const handler = createMcpHandler(() => {
  const server = new McpServer({ name: 'Notes', version: '1.0.0' });
  server.registerTool('whoami', { description: 'Get the current user' }, (ctx) => {
    // Pass { requiredScopes: [...] } as the second argument for per-tool authorization
    const { subject, claims } = getAuthInfo(ctx);
    return { content: [{ type: 'text', text: JSON.stringify({ subject, claims }) }] };
  });
  return server;
});

// 4. Wire it up (Cloudflare Workers, Deno, Bun, Node.js)
export default {
  async fetch(request: Request): Promise<Response> {
    if (new URL(request.url).pathname.startsWith('/.well-known/')) {
      // Serve the OAuth discovery documents
      const metadata = oauthMetadataResponse(request, await mcpAuth.getAuthMetadataOptions());
      if (metadata) return metadata;
    }

    const auth = await gate(request);
    if (auth instanceof Response) return auth;
    return handler.fetch(request, { authInfo: auth });
  },
};

Head to mcp-auth.dev for tutorials and the full documentation. The sample servers in this repository are complete runnable projects: whoami and todo-manager as Cloudflare Workers, plus an Express variant built with @modelcontextprotocol/express.

Configuration highlights

  • protectedResourceMetadata is your RFC 9728 Protected Resource Metadata declaration. Everything in it is published through the SDK's metadata helpers, and the token verifier enforces what it declares: the aud claim must match resource and the iss claim must match the configured authorization server.
  • authorizationServer accepts a discovery config ({ issuer, type }, metadata fetched lazily and cached, safe for edge runtimes where module-init network calls are not allowed) or a resolved config with metadata (hardcoded or pre-fetched via fetchServerConfig()).
  • Audience (aud) validation always expects your resource identifier and cannot be redirected or disabled: the MCP authorization specification requires access tokens to be bound to the resource they are issued for (RFC 8707), so tokens without a matching aud claim are rejected.
  • jwtVerifyOptions passes options through to jose's jwtVerify for advanced tuning (clock tolerance, required claims, etc.); issuer and audience are excluded since they always come from the metadata declaration.
  • Verified tokens are surfaced as McpAuthInfo, the SDK's AuthInfo plus guaranteed issuer, subject, and the full claims payload.

Opaque access tokens

MCPAuth verifies JWT access tokens against your provider's JWKS. Some authorization servers issue opaque access tokens instead: random strings with nothing to verify locally. The two halves of mcp-auth are decoupled, so this case is covered by bringing your own verifier: implement the SDK's OAuthTokenVerifier against your server's token introspection endpoint (RFC 7662), and keep using the metadata half. The discovery documents, the challenge URL, and getAuthInfo() all work unchanged.

import {
  OAuthError,
  OAuthErrorCode,
  requireBearerAuth,
  type OAuthTokenVerifier,
} from '@modelcontextprotocol/server';
import { MCPAuth, type McpAuthInfo } from 'mcp-auth';…

Description from the npm listing.

  • modelcontextprotocol
  • mcp
  • oauth
  • openid
  • connect
  • oidc

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

mcp-auth weekly downloads on npm, last 90 days: 9,248 weekly downloads as of Dec 5, 2026, -59.3% over 90 days.mcp-authWeekly downloads on npm · Last 90 days9,248downloads / week-59.3% over 90 days05K10K15K20K25KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
mcp-auth weekly downloads on npm, last 90 days: 9,248 weekly downloads as of Dec 5, 2026, -59.3% over 90 days.

7/30/90-day growth

mcp-auth weekly downloads growth on npm: +88.2% over 7 days, +23.5% over 30 days, -59.3% over 90 days.mcp-authWeekly downloads growth on npm9,248downloads / week now7-day growth+4,334 weekly downloads+88.2%30-day growth+1,762 weekly downloads+23.5%90-day growth-13,467 weekly downloads-59.3%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
mcp-auth weekly downloads growth on npm: +88.2% over 7 days, +23.5% over 30 days, -59.3% over 90 days.

Ranking history

mcp-auth npm ranking history: currently #1296 (by weekly downloads).mcp-authnpm ranking · by weekly downloads · Last 90 days#1296current rank#400#600#800#1000#1200#1400#1600Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 17, 2026 – Dec 6, 2026 · 21 observations · Updated Dec 5, 2026pluginstats.com
mcp-auth npm ranking history: currently #1296 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,084 shown · page 65, #16 (overall #1,296)
All npm: every listing in weekly downloads order

Listing placement

MCP servers468 listings · 24 pages · page 15, #11 (overall #291)
MCP servers: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (592)
Recent weekly downloads observations for mcp-auth
Date (UTC)Weekly downloadsChange vs. previous
9,248-253
9,501+1.1K
8,395+314
8,081+609
7,472+1.2K
6,279+835
5,444+530
4,914-345
5,259-352
5,611-256
5,867+781
5,086-130
5,216-235
5,451—

Similar npm MCP servers plugins

All 20 mcp-auth alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/mcp-auth. First seen Oct 16, 2026; last successful collection Oct 27, 2026. See the methodology.