install

install is a skill for Claude Code, Codex 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 CodeCodex

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

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.

agentmods
npx agentmods add skills/brainweb/payload-mcp-oauth/install
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, Codex.

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.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.svg" alt="Measured on agentmods" 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. Scan, not verified.
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 $0.00122 $0.01239
Opus 5 $0.00061 $0.00620
Sonnet 5 $0.00024 $0.00248
Haiku 4.5 $0.00012 $0.00124

Measured 4d ago against content hash 38ab7846468d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 4d 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. 4d 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 (7 stars, last pushed 2d ago), licensed MIT. It adds 122 tokens to every session and 1,239 once invoked, about $0.0006 per session on Opus 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

class-closure-review

Exact-head local PR review for mcp-sso that refuses PASS until a defective behavior is closed across every sibling cell, not just the named instance. Use when reviewing a pull request locally, after a Codex finding, before requesting another hosted review round, or when leftover claims, unswept adapters/stores…

acartag7/mcp-sso · 84 tokens

codex-with-chatgpt

Use ChatGPT (web) as the planning and review brain for Codex coding sessions, while Codex keeps full execution ownership. Use when the user says "使用 Codex with ChatGPT ..." / "Set up Codex with ChatGPT" / "用 ChatGPT 规划", when they ask to connect ChatGPT to the current workspace, disconnect it, or run a task through…

XiaoDuoYa/codex-with-chatgpt · 90 tokens

webmcp-e2e

WebMCP reverse connection gateway(pairing + static/remote モード)の E2E 結合確認を実行する。Manifold 起動 → デモページ → 拡張入り Chromium → ペアリング → tools/call 検証 → タブクローズ時エラー確認までを通し、スクリーンショット証跡を残す。remote モードでは自前 JWKS + JWT で identityKey ルーティングの分離も検証する。「webmcp の E2E」「reverse gateway の動作確認」「拡張の結合テスト」で使用。.

nonchan7720/manifold · 140 tokens

auth0-docs

Auth0 — identity platform: auth flows, Universal Login, SSO, identity providers, MFA, RBAC, Actions, tokens.

pledgeandgrow/pledge-skills · 32 tokens

cx-devassist-asca

Runs a Checkmarx ASCA (AI Security Code Assistant) SAST scan on a SOURCE CODE file to detect code vulnerabilities, and remediates findings using the Checkmarx MCP tool. Use when a user asks to scan or fix a source code file (.py/.js/.java/.go/.ts/…) for security vulnerabilities. For dependency manifests/lockfiles…

Checkmarx/cx-agentic-ai · 109 tokens

cx-devassist-sca

Runs a Checkmarx SCA (Software Composition Analysis / OSS) scan on dependency manifests and lockfiles to detect vulnerable and malicious open-source packages, and remediates findings using the Checkmarx MCP tool. Use when a user asks to scan dependencies, check packages, audit a manifest/lockfile (package.json…

Checkmarx/cx-agentic-ai · 102 tokens