scaledock-mcp-server
Skill1 starsChanged 30 days agoMITView on GitHub
Build or harden a ScaleDock MCP server that follows the MCP authorization spec, OAuth 2.1, JWT verification and Problem Details, with PermDock deciding every tool call. Use when adding an MCP surface, protecting MCP tools, wiring Protected Resource Metadata, scope challenges or step-up, filtering tools/list per user, adding human approval to destructive tools, or reviewing an MCP server against the specs.
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Follow the workflow below step by step: Read the installed SDK and PermDock docs before you configure anything.
- Very specific: line 44
Set the inputs and read the docs: Read the installed @modelcontextprotocol/server docs, the permdock/mcp page through the PermDock docs MCP …
- Very specific: line 51
Approvals and step-up: Put approval on every destructive grant and configure a durable approval store.
- Very specific: line 55
Test and audit: Run the MCP tests from scaledock-repo-standard (tools/list per role, 401 with metadata, a denial, structured output, the …
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
ScaleDock MCP server
An MCP server that is a correct OAuth 2.1 resource server, acts as the signed-in user, and asks PermDock for every tool call. The spec skills carry the rules of each standard; this skill says which ones apply, how they fit the ScaleDock stack, and where PermDock takes over.
Follow the workflow below step by step. Read the installed SDK and PermDock docs before you configure anything; option names drift between versions.
Inputs (fill in, or ask before starting)
- Repo: an existing ScaleDock repo with an
mcpsurface, or a new one (then runscaledock-repo-standardfirst). - Authorization server: Supabase Auth's OAuth 2.1 server (default), or another issuer the user names.
- Tools: the contract procedures to expose, and which of them write or destroy data.
- Approval store: where
approval-requireddecisions wait for a human (required when any tool is destructive).
Skills to install
npx skills add ScaleDockHQ/scaledock-skills --skill mcp-authorization --skill oauth --skill jwt --skill problem-details
npx skills add ScaleDockHQ/PermDockscaledock-repo-standard (its references/mcp.md and references/auth.md) owns the app layout: the @modelcontextprotocol/server package, the Hono mount, the per-request server factory and tools from the contract.
Invariants
- The spec skills win on protocol details. Protected Resource Metadata, the
WWW-Authenticatechallenge, resource indicators and audience checks followmcp-authorizationandoauth; token checks followjwt. Do not restate them here or in the app; link the skill in code review. - Every tool call is a PermDock decision. Tools register through
createPermDock(...).protectServer(server)frompermdock/mcp, one permission per tool. PermDock filterstools/list, validates arguments against the resource schema, and audits each call. - Authorization comes from the user, not from scopes. Scopes say what the client may ask for; PermDock and RLS say what the user may do. Enforce a scope only when the authorization server can issue it.
- The subject is never model-supplied. It comes from the verified access token (
authInfo) through the PermDock subject resolver, never from tool arguments. - Destructive tools wait for a human. A tool that deletes, pays, publishes or changes access has
approvalon its grant, so PermDock returnsapproval-requiredand the MCP adapter turns it into an elicitation. - One error shape. Denials and failures are RFC 9457 Problem Details: HTTP responses use
application/problem+json, tool results useisError: truewith the problem as text andstructuredContent. - Never pass a token through. The server never forwards the client's access token to another API; it calls
servicesas the user.
Workflow
- Set the inputs and read the docs. Read the installed
@modelcontextprotocol/serverdocs, thepermdock/mcppage through the PermDock docs MCP (https://permdock.dev/mcp), and themcp-authorizationskill's Invariants. ✓ You can name the spec revision the SDK serves and the PermDock options you will set. - Resource server. Serve Protected Resource Metadata, return 401 with the
resource_metadatachallenge, and verify every bearer token (signature, issuer, expiry, audience) asmcp-authorizationandjwtrequire. With Supabase, wrap the handler inwithOAuthProtectedResourceandwithSupabase({ auth: "user" })from@supabase/server(the nested form), and serve the OAuth Consent block at/oauth/consentin the app. ->references/stack.md(how each requirement maps to the ScaleDock stack) ✓ An unauthenticated request gets 401 with the metadata URL, a token for another resource is rejected, and a signed-out user reaching/oauth/consentsigns in and returns to the consent screen. - Permissions. Define one permission per tool in
permissions.ts, grant them inpolicy.ts, and register tools withprotectServer. Followwire-permdockfromScaleDockHQ/PermDock. ✓tools/listdiffers per role, and a call without a grant returns a Problem Details denial. - Approvals and step-up. Put
approvalon every destructive grant and configure a durable approval store. When a tool needs a scope the token lacks, return the scope challenge thatmcp-authorizationdescribes. ✓ A destructive call returnsapproval-requiredand resumes only after a distinct approver accepts. - Errors. Route every error through one
problemResult()helper that followsproblem-details. ✓ No stack trace or raw provider message reaches a client. - Test and audit. Run the MCP tests from
scaledock-repo-standard(tools/listper role, 401 with metadata, a denial, structured output, the approval path), then runaudit-permissionsfromScaleDockHQ/PermDock. ✓ The tests pass and the audit has no blocker.
Verify before done
- Every item in the
mcp-authorizationVerify list passes. - Every tool has exactly one permission, and an unmapped tool is not listed.
/oauth/consentis reachable signed out and returns to the consent screen after sign-in.- The subject comes from
authInfo; no tool reads a user, tenant or actor id from its arguments. - Every destructive tool returns
approval-requiredwithout an approval. - Every denial is a Problem Details object with a stable
type. permdock doctorreports no error, andpnpm verifypasses.
Reference index
references/stack.md: each spec requirement mapped to the ScaleDock stack and the PermDock adapter.
In this repository40 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- find-skillsSkill
- a2aSkill
- ag-uiSkill
- ap2Skill
- asyncapiSkill
- authzenSkill
- cedarSkill
- cloudeventsSkill
- eu-ai-actSkill
- fapiSkill
- gnapSkill
- jwtSkill
- mcp-authorizationSkill
- oauthSkill
- ocsfSkill
- openapi-arazzoSkill
- openapi-overlaySkill
- openapiSkill
- openfeatureSkill
- openid4vcSkill
- openid-connectSkill
- openid-federationSkill
- openidSkill
- opentelemetry-genaiSkill
- owasp-agenticSkill
- problem-detailsSkill
- ratelimit-headersSkill
- scaledock-agent-permissionsSkill
- scaledock-enterprise-identitySkill
- scaledock-http-apiSkill
- scaledock-repo-standardSkill
- scimSkill
- shared-signalsSkill
- spiffeSkill
- standard-schemaSkill
- typespecSkill
- web-bot-authSkill
- webmcpSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

