install
Skill9 starsChanged 6 months agoMITView on GitHub
Install and configure @brainwebuk/payload-plugin-mcp-oauth — OAuth 2.1 + PKCE + Dynamic Client Registration for a Payload @payloadcms/plugin-mcp server, so it can be added as a Custom Connector in Claude.ai. Use when adding OAuth to a Payload MCP app; wiring the plugin, proxy/middleware, or env; or debugging the install (consent 401 "Authentication required", SQLite push "no such column: oauth_clients_id", missing OAuth admin collections, "must be registered AFTER mcpPlugin", or OAuth tokens 401 while API keys work).
- Reads credentials
- Installs packages
22 other projects use a version of this.
Adopted by
Most recently taken up by
- Dariusplayer09/adaptive-skillstheir own version, first seen Nov 8, 2026
- kkrafft1999/snotratheir own version, first seen Nov 6, 2026
- tykimos/agent-native-agenttheir own version, first seen Nov 6, 2026
- crocotaste/crocotaste-plugintheir own version, first seen Nov 1, 2026
- grace-method/grace-plugintheir own version, first seen Oct 25, 2026
- gpambrozio/Gallagertheir own version, first seen Oct 25, 2026
Used with
Projects with it also use update and release.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
AnthropicSkillupdate
Sync tasks and refresh memory from your current activity. Use when pulling new assignments from your project tracker into TASKS.md, triaging stale or overdue tasks, filling memory gaps for unknown people or projects, or running a comprehensive scan to catch todos buried in chat and email.
Also in 3 projects that use this
MicrosoftSkillrelease
Use ONLY when the user explicitly asks to cut/publish a Huabu desktop release or tag a version. Performs an outward action — bumps the version in apps/desktop/package.json, commits + annotated-tags vX.Y.Z, and pushes the branch + tag. That tag push auto-builds the macOS/Windows installers and publishes a GitHub Release. Provides `status`, `bump`, `tag-push`, and a one-command `run` (bump → tag-push).
Also in 3 projects that use this
Other versions22 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 22
- kubeshark/kubeshark★ 12ksame name
- PrimeIntellect-ai/prime-rl★ 2.2ksame name
- tykimos/agent-native-agent★ 130same name
- htlin222/openevidence-mcp★ 78same name
- jeremylongshore/claude-code-slack-channel★ 43same name
- kkrafft1999/snotra★ 6same name
- WeDataLab-AI-Lab/cctrace★ 5same name
- gpambrozio/Gallager★ 4same name
- Pierry/harness-kit★ 4same name
- hazarsozer/ren-os★ 2same name
12 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repositoryOne other file it gives its agents.
- CLAUDE.mdCLAUDE.md
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 18 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 62
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 …
“Common” is measured: kept by at least 6 in 10 of the 18 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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-mcpalready installed and working. - Next.js 14 / 15 / 16 (for the exported proxy/middleware).
Steps
- Install:
pnpm add @brainwebuk/payload-plugin-mcp-oauth - Register it AFTER
mcpPlugin(), sharing ONE options object (most common footgun):
A copy/spread silently breaks OAuth token auth (API keys keep working, so it's easy to miss). Registering it beforeconst 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 }), ]mcpPlugin()throws on boot. - Add the proxy — Next 16:
src/proxy.ts; Next 14/15:src/middleware.ts. Re-export the handler but declareconfigas a local literal (never re-exportconfig— 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'], } - Env: set
NEXT_PUBLIC_SERVER_URL(public HTTPS origin; used as the OAuth issuer) andPMOAUTH_TOKEN_PEPPER(openssl rand -hex 32; required ≥ 32 chars in production). Ensure Payload'sserverURLequalsNEXT_PUBLIC_SERVER_URL— the consent flow relies on a first-party session cookie matching that origin. - Apply the schema — pick ONE workflow, don't mix:
- Dev push (SQLite/Postgres in dev): just start the app.
- Migrations (production):
pnpm payload migrate:createthenpnpm payload migrate. If you already booted the app once before installing, on SQLite either upgrade to>= 0.3.2or reset the dev DB (rm your.db*) so the schema is created fresh.
Verify
curl <issuer>/.well-known/oauth-authorization-serverreturns JSON metadata.- In the admin, the MCP nav group shows OAuth Clients and OAuth Tokens
(when logged in as a user of your
userCollection).
Make it usable for AI agents (recommended)
Agents only know what the server tells them. On mcpPlugin() set
serverOptions.instructions (how to use the server + non-obvious field rules),
per-collection description, and field admin.description (these flow into the
generated tool schemas). For gnarly create flows, define an MCP prompt. A Claude Skill
cannot reach a connecting web agent — instructions/prompts are the
protocol-native bridge.
Common failures → fixes
- Consent Approve →
401 access_denied / "Authentication required"— upgrade to>= 0.3.1(aReferrer-Policy: no-referrerbug made the browser sendOrigin: null). If it persists,serverURL/NEXT_PUBLIC_SERVER_URLmust exactly match the browser origin (scheme, host, no trailing slash). SQLITE_ERROR: no such column: oauth_clients_id(rebuildingpayload_locked_documents_rels) — upgrade to>= 0.3.2, or reset the dev DB, or add the plugin before the first boot.- OAuth tokens 401 but API keys work —
mcpPluginOptionswasn't the same object reference passed to both plugins. must be registered AFTER mcpPlugin()— fix plugin order. (On>= 0.3.3it's fine to leavepayloadMcpOAuthregistered while the MCP plugin isdisabled— it no-ops instead of crashing.)- A tool like
createPagesis missing — enable that op incollections.<slug>.enabled(create/update/delete);enabled: trueturns on all of them.
For the full reference see the package's INSTALL_FOR_AGENTS.md and README.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

