Skip to content
PluginStats

@zgeoff/mcp-auth weekly downloads statistics

By zgeoff (3 listings) · npm · MCP servers

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

View on npm Fresh · Dec 6, 2026

@zgeoff/mcp-auth has 42,777 recorded weekly downloads on npm, ranking #826 of 3,247 tracked listings.

Weekly downloads
42,777
Official API · Dec 4, 2026
7-day growth
—
Insufficient history
30-day growth
—
Insufficient history
90-day growth
—
Insufficient history
Rank
#826
Among tracked npm listings

About @zgeoff/mcp-auth

@zgeoff/mcp-auth

An OAuth server that lets a hosted MCP client, such as a Claude.ai connector, reach an app's /mcp route. It is built on better-auth and bun:sqlite, and holds the OAuth routes and pages, passkey login for the owner, pre-registered clients, service tokens and grant revoke. Each app passes in its own scopes, paths, table names and grant limits.

The package exports the core from @zgeoff/mcp-auth, an Elysia 2 adapter from @zgeoff/mcp-auth/elysia and the test helpers from @zgeoff/mcp-auth/testing. The package needs Bun.

Install

bun add @zgeoff/mcp-auth kysely

Kysely is a peer dependency. Elysia 2 is an optional peer dependency, needed only for the adapter.

Usage

The app opens the server once at start, on a bun:sqlite connection that it owns. An app whose own Kysely runs on that connection passes the Kysely as database instead, so both share one driver lock. Each route is a function from Request to Response, and verify turns a bearer token into an Access or null.

import { DEFAULT_PATHS, openMCPAuth } from '@zgeoff/mcp-auth';

const auth = await openMCPAuth({
  database: sqlite,
  origin: 'https://app.example.com',
  productName: 'app',
  scopes: ['read', 'write'],
  paths: DEFAULT_PATHS,
  tables: { passkey: 'app_passkey', enrollmentToken: 'app_enrollment_token' },
  clock: { now: () => Date.now() },
  security: { record: (event) => console.log(event) },
  onGrantRevoked: (grantID) => closeStreamsOf(grantID),
});

const access = await auth.verify(bearerToken);

createMCPHTTPApp from @zgeoff/mcp-auth/elysia serves the routes in an Elysia app. It refuses a wrong Host or Origin header, and checks the bearer token before it hands a request to mcp.fetch.

import { createMCPHTTPApp } from '@zgeoff/mcp-auth/elysia';

app.use(
  createMCPHTTPApp({
    auth,
    hosts: new Set(['app.example.com']),
    origins: new Set(['https://app.example.com']),
    readRequester,
    security: { record: (event) => console.log(event) },
    mcp: { fetch: (request, access) => mcpHandler.fetch(request, access) },
    besidePrefix: '/api',
  }),
);

A command that only manages clients, grants and passkeys calls openMCPAuthAdmin, with no origin.

Service clients

A client with no browser, such as a CI job, gets a service client in the service-token file, with static tokens, secretDigests, or both. A client with a digest uses the client_credentials grant: it sends its ID, service:<name>, and its secret in a client_secret_basic header to the token route, and gets a 600-second access token capped to its scopes. verify gives that token the same service access that a static token gets.

mintServiceSecret() returns { secret, digest }. Show the secret once, and put only the digest in the file. A client holds 1 or 2 digests, so a rotation adds the new one, then drops the old one.

An app reloads the file on SIGHUP and calls auth.replaceServiceTokens(file) with the parsed result. The next token request and the next verify read the new file, and a file that fails to parse leaves the old one in place.

Features

  • OAuth authorization code flow with PKCE for clients the owner adds by name.
  • Passkey login and consent pages, with the scopes the owner ticks.
  • Refresh tokens that rotate, and a grant that ends when a client replays a replaced token.
  • A revoke that ends every token of a grant with one delete, even in the middle of a refresh.
  • Bearer tokens only: the token route drops DPoP, and verify refuses a token bound to a key.
  • Service tokens, and the client_credentials grant, for clients that cannot run the browser flow.
  • An Elysia adapter that checks Host, Origin and the bearer token of each MCP request.
  • Test helpers: openTestAuth, authorizeTestClient, and seeds for clients and passkeys.

Documentation

The architecture doc explains how grants, tokens, service clients and sign-ins work, and the decision records 0001 to 0003 in docs/decisions/ give the reasons for its main choices.

Description from the npm listing.

  • better-auth
  • mcp
  • oauth
  • passkey

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

@zgeoff/mcp-auth weekly downloads on npm, last 90 days: 42,777 weekly downloads as of Dec 4, 2026.@zgeoff/mcp-authWeekly downloads on npm · Last 90 days42,777downloads / week38K40K42K44K46K48KSep 5Sep 20Oct 5Oct 20Nov 4Nov 19Dec 4downloads / weekDec 4, 2026 – Dec 4, 2026 · 1 observations · Updated Dec 4, 2026pluginstats.com
@zgeoff/mcp-auth weekly downloads on npm, last 90 days: 42,777 weekly downloads as of Dec 4, 2026.

7/30/90-day growth

@zgeoff/mcp-auth weekly downloads growth on npm: 7-day growth unavailable, 30-day growth unavailable, 90-day growth unavailable.@zgeoff/mcp-authWeekly downloads growth on npm42,777downloads / week now7-day growthinsufficient historyInsufficient history30-day growthinsufficient historyInsufficient history90-day growthinsufficient historyInsufficient historyGrowth vs. nearest observation to each baseline date · Updated Dec 4, 2026pluginstats.com
@zgeoff/mcp-auth weekly downloads growth on npm: 7-day growth unavailable, 30-day growth unavailable, 90-day growth unavailable.

Ranking history

@zgeoff/mcp-auth npm ranking history: currently #826 (by weekly downloads).@zgeoff/mcp-authnpm ranking · by weekly downloads · Last 90 days#826current rank#824#825#826#827#828Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankDec 6, 2026 – Dec 6, 2026 · 1 observations · Updated Dec 4, 2026pluginstats.com
@zgeoff/mcp-auth npm ranking history: currently #826 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,083 shown · page 42, #6 (overall #826)
All npm: every listing in weekly downloads order

Listing placement

MCP servers468 listings · 24 pages · page 7, #6 (overall #126)
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 (1)
Recent weekly downloads observations for @zgeoff/mcp-auth
Date (UTC)Weekly downloadsChange vs. previous
42,777—

Similar npm MCP servers plugins

All 20 @zgeoff/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/@zgeoff/mcp-auth. First seen Dec 6, 2026; last successful collection Dec 6, 2026. See the methodology.