install

install is a skill for Claude Code from BrainWeb/payload-mcp-oauth. It costs 122 tokens per session (1,239 once invoked), scanned A, original, MIT.

An installation guide for adding OAuth login to a Payload CMS server that uses MCP, a standard way for AI tools to connect to applications.

In plain words
What is it for?
Use it to install and configure OAuth 2.1, PKCE, and dynamic client registration so the server can be added as a custom connector in Claude.ai.
Why use it?
It helps avoid setup mistakes involving plugin order, shared settings, proxy files, and environment variables.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the payload-mcp-oauth plugin — 1 skill, 1 agent shipped together

Good fit Use it to install and configure OAuth 2.1, PKCE, and dynamic client registration so the server can be added as a custom connector in Claude.ai.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/brainweb/payload-mcp-oauth/install
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add BrainWeb/payload-mcp-oauth --skill install
Clone the repo
git clone --depth 1 https://github.com/BrainWeb/payload-mcp-oauth

Made for: Claude Code.

Or install payload-mcp-oauth, the plugin that ships this one along with the rest of its 1 skill, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for install

README.md
[![agentmods](https://agentmods.dev/badge/skills/brainweb/payload-mcp-oauth/install/github.svg)](https://agentmods.dev/skills/brainweb/payload-mcp-oauth/install)
Your own site
<a href="https://agentmods.dev/skills/brainweb/payload-mcp-oauth/install"><img src="https://agentmods.dev/badge/skills/brainweb/payload-mcp-oauth/install/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for install

Your own site · 80×15
<a href="https://agentmods.dev/skills/brainweb/payload-mcp-oauth/install"><img src="https://agentmods.dev/badge/skills/brainweb/payload-mcp-oauth/install.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 122 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,239 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00122 $0.01239
Opus 5.5 $0.00049 $0.00496
Sonnet 5.5 $0.00024 $0.00248
Haiku 4.5 $0.00012 $0.00124

Measured 1mo ago against content hash 38ab7846468d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

install scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- `curl <issuer>/.well-known/oauth-authorization-server` returns JSON metadata.
skills/install/SKILL.md · 97 lines

How it starts

The opening of the file, as written. The whole thing — 97 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Install @brainwebuk/payload-plugin-mcp-oauth

Adds OAuth 2.1 + PKCE + Dynamic Client Registration to an existing @payloadcms/plugin-mcp MCP server. Additive — the API-key flow keeps working. Always prefer the latest version (the install path has had several fixes; use >= 0.3.3).

Prerequisites

  • A Payload v3 app with @payloadcms/plugin-mcp already installed and working.
  • Next.js 14 / 15 / 16 (for the exported proxy/middleware).

Steps

  1. Install: pnpm add @brainwebuk/payload-plugin-mcp-oauth

  2. Register it AFTER mcpPlugin(), sharing ONE options object (most common footgun):

    const mcpOptions = {
      collections: { posts: { enabled: { find: true, create: true, update: true } } },
    }
    plugins: [
      mcpPlugin(mcpOptions),
      payloadMcpOAuth({
        issuer: process.env.NEXT_PUBLIC_SERVER_URL!,
        mcpPluginOptions: mcpOptions, // ← the SAME reference, never a copy/spread
      }),
    ]
    

    A copy/spread silently breaks OAuth token auth (API keys keep working, so it's easy to miss). Registering it before mcpPlugin() throws on boot.

  3. Add the proxy — Next 16: src/proxy.ts; Next 14/15: src/middleware.ts. Re-export the handler but declare config as a local literal (never re-export config — it 500s every route on Next 16):

    export { mcpOAuthMiddleware as proxy } from '@brainwebuk/payload-plugin-mcp-oauth/middleware'
    export const config = {
      matcher: ['/', '/.well-known/oauth-authorization-server', '/.well-known/oauth-protected-resource'],
    }
    
  4. Env: set NEXT_PUBLIC_SERVER_URL (public HTTPS origin; used as the OAuth issuer) and PMOAUTH_TOKEN_PEPPER (openssl rand -hex 32; required ≥ 32 chars in production). Ensure Payload's serverURL equals NEXT_PUBLIC_SERVER_URL — the consent flow relies on a first-party session cookie matching that origin.

  5. Apply the schema — pick ONE workflow, don't mix:

    • Dev push (SQLite/Postgres in dev): just start the app.
    • Migrations (production): pnpm payload migrate:create then pnpm payload migrate. If you already booted the app once before installing, on SQLite either upgrade to >= 0.3.2 or reset the dev DB (rm your.db*) so the schema is created fresh.

Read the full file on GitHub · 97 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 97 lines · 122 tokens per session scan A 38ab7846468d

Subscribe to this mod's changes

install is a skill published in the GitHub repository BrainWeb/payload-mcp-oauth (8 stars, last pushed 2d ago), licensed MIT. It adds 122 tokens to every session and 1,239 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

oauth-state-parameter-abuse

Identify and exploit logic flaws in OAuth implementations, focusing specifically on the absence or improper validation of the state parameter, which leads to Cross-Site Request Forgery (CSRF) and account takeover (ATO).

akashrpatil/awesome-offensive-security-skills · 52 tokens

design-mcp-server

Design the tool surface, resources, and service layer for a new MCP server. Use when starting a new server, planning a major feature expansion, or when the user describes a domain/API they want to expose via MCP. Produces a design doc at docs/design.md that drives implementation.

cyanheads/obsidian-mcp-server · 62 tokens

api-telemetry

Catalog of OpenTelemetry instrumentation built into framework @cyanheads/mcp-ts-core — spans, metrics, completion logs, env config, runtime caveats, custom instrumentation patterns, and cardinality rules. Use when enabling OTel export, adding custom spans or metrics in services, debugging missing telemetry, looking up…

cyanheads/obsidian-mcp-server · 85 tokens

api-connector-builder

Use when writing a client for someone else's REST or GraphQL API: auth flow choice and token refresh, pagination to exhaustion, retry-with-jitter on transient failures only, rate-limit-aware throttling. NOT inbound callbacks (that is webhooks), NOT chaining services (that is automation-flows), NOT designing your own…

ericrisco/rsc-harness · 80 tokens

api-services

API reference for built-in service providers (LLM, Speech, Graph). Use when looking up service interfaces, provider capabilities, or integration patterns.

cyanheads/obsidian-mcp-server · 32 tokens

cmdb-patterns

Create ServiceNow CIs and cmdbrelci relationships, walk upstream/downstream impact, detect orphan/stale CIs, and align discovered CIs with the proper sysclassname hierarchy.

serac-labs/serac · 43 tokens