skills/mcp-oauth21-scalekit/SKILL.md
Add production-ready OAuth 2.1 authorization to an MCP server using Scalekit. Use this when you need MCP clients (Claude Desktop, Cursor, VS Code, or any MCP client) to discover your authorization server via .well-known/oauth-protected-resource, and when you need to validate Bearer access tokens (aud/iss/exp/scope) before executing MCP tools.
npx skillsauth add scalekit-inc/skills mcp-oauth21-scalekitInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Secure an MCP server so only authenticated + authorized users (and approved MCP clients) can call your tools, using Scalekit as the OAuth 2.1 authorization server and your MCP server as the resource server.
Activate when the user asks to:
aud:
/.well-known/oauth-protected-resource/.well-known/*)todo:read, todo:write, etc.Note: If you toggle DCR/CIMD, restart the MCP server (some frameworks cache auth server details).
Implement GET /.well-known/oauth-protected-resource and return the resource metadata JSON from Scalekit dashboard ("Metadata JSON" for your MCP server).
Minimum fields to include:
authorization_servers: array containing your Scalekit resource authorization server URL (from dashboard)bearer_methods_supported: include headerresource: your MCP server identifier (usually your base URL)resource_documentation: docs URL (optional but recommended)scopes_supported: list of scopes you configuredIf the user wants a template, point them to:
assets/oauth-protected-resource.jsonassets/express/well-known-route.ts or assets/fastapi/well_known_route.pyApply middleware to all MCP endpoints. Rules:
/.well-known/* so clients can discover metadata.Authorization: Bearer <token>401 and include WWW-Authenticate: Bearer ... resource_metadata="<your .well-known url>"aud includes your configured resource identifier401 with WWW-AuthenticateTemplates:
assets/express/auth-middleware.tsassets/fastapi/auth_middleware.pySecurity notes:
For each MCP tool, define required scope(s) and enforce them when executing the tool. Suggested approach:
tool_name -> required_scopes (see assets/tool-scope-map.example.yaml)requiredScopes (or validate once and check claims, depending on SDK support)insufficient_scope) with a helpful message/.well-known/oauth-protected-resource without auth and confirm JSON is correct.aud fails.See references/SECURITY.md. Minimum:
aud) strictlyreferences/REFERENCE.mdreferences/SCOPES.mdreferences/SECURITY.mdtools
Create or review Scalekit custom providers/connectors for proxy-only usage, including MCP providers. Use this skill when the task is to gather API docs, infer whether a connector is OAuth, Basic, Bearer, or API Key, determine if it is an MCP provider, determine required tracked fields like domain or version, generate provider JSON, check for existing custom providers, show update diffs, run approved create or update curls, and print resolved delete curls.
tools
Use when a developer is new to Scalekit and needs guidance on where to start, doesn't know which auth plugin or skill to choose, wants to connect an AI agent or agentic workflow to third-party services (Gmail, Slack, Notion, Google Calendar), needs OAuth or tool-calling auth for agents, wants to add authentication to a project but hasn't chosen an approach yet, or needs to install the Scalekit plugin for their AI coding tool (Claude Code, Codex, Copilot CLI, Cursor, or other agents).
tools
Use when a user asks to generate, review, validate, or fix any code snippet that uses Scalekit APIs or SDKs. This skill is the single source of truth for Scalekit code correctness — it can generate illustration-quality snippets from scratch (for docs, websites, or integration guides) and review existing code to catch wrong method names, missing parameters, security anti-patterns, and broken auth flows. Covers all four SDKs (Node, Python, Go, Java), raw REST API calls, and both Scalekit product suites — SaaSKit (SSO, login, sessions, RBAC, SCIM) and AgentKit (connections, tool calling, MCP auth). Use when the user says review my Scalekit code, generate a Scalekit example, validate this auth flow, check my SDK usage, fix my Scalekit integration, write a code sample for docs, or anything involving Scalekit code quality.
development
Walks through a structured production readiness checklist for Scalekit SSO implementations. Use when the user says they are going live, launching to production, doing a pre-launch review, hardening their SSO setup, or wants to verify their Scalekit implementation is production-ready.