MCP quickstart with AI coding agents
Use AI coding agents to add OAuth 2.1 authentication to your MCP servers in minutes
Use AI coding agents like Claude Code, GitHub Copilot CLI, Cursor, and OpenCode to add Scalekit’s OAuth 2.1 authentication to your MCP servers. This guide shows you how to configure these agents so they analyze your codebase, apply consistent authentication patterns, and generate production-ready code that integrates OAuth 2.1 end-to-end, reduces implementation time from hours to minutes, and follows security best practices.
Prerequisites
- A Scalekit account with MCP server management access
- Basic familiarity with OAuth 2.1 and MCP server architecture
- Terminal access for installing coding agent tools
-
Add the Scalekit Auth Stack marketplace
Not yet on Claude Code? Follow the official quickstart guide to install it.
Register Scalekit’s plugin marketplace to access pre-configured authentication skills. This marketplace provides context-aware prompts and implementation guides that help coding agents generate correct authentication code.
Start the Claude Code REPL:
Terminal claudeThen add the marketplace:
Claude REPL /plugin marketplace add scalekit-inc/claude-code-authstackWhen the marketplace registers successfully, you’ll see confirmation output:
Terminal ❯ /plugin marketplace add scalekit-inc/claude-code-authstack⎿ Successfully added marketplace: scalekit-auth-stackThe marketplace provides specialized authentication plugins that understand MCP server architectures and OAuth 2.1 security requirements. These plugins guide the coding agent to generate implementation code that matches your project structure.
To remove the Scalekit Auth Stack marketplace, use the uninstall command:
Claude REPL /plugin marketplace remove scalekit-auth-stack -
Enable authentication plugins
Select which authentication capabilities to activate in your development environment. Each plugin provides specific skills that the coding agent uses to generate authentication code.
Directly install the specific plugin:
Claude REPL /plugin install mcp-auth@scalekit-auth-stackAlternative: Enable authentication plugins via plugin wizard
Run the plugin wizard to browse and enable available plugins:
Claude REPL /pluginsNavigate through the visual interface to enable the MCP authentication plugin:

-
Generate authentication implementation
Use a structured prompt to direct the coding agent. A well-formed prompt ensures the agent generates complete, production-ready authentication code that includes all required security components.
Copy the following prompt into your coding agent:
Authentication implementation prompt Add OAuth 2.1 authentication to my MCP server using Scalekit. Initialize ScalekitClient with environment credentials, implement /.well-known/ metadata endpoint for discovery, and add authentication middleware that validates JWT bearer tokens on all MCP requests. Code only.When you submit this prompt, Claude Code loads the MCP authentication skill from the marketplace -> analyzes your existing MCP server structure -> generates authentication middleware with token validation -> creates the OAuth discovery endpoint -> configures environment variable handling.

-
Verify and test the implementation
After the coding agent completes, verify that all authentication components are properly configured:
Check generated files:
- Authentication middleware with JWT validation
- Environment variable configuration (
.env.example) - OAuth discovery endpoint (
/.well-known/oauth-authorization-server) - Error handling for invalid or expired tokens
Test the authentication flow:
Claude REPL Now that your MCP server has authentication integrated, let's verify it's working correctly by testing the flow step by step. First, start your MCP server using npm start (Node.js) or python server.py (Python) and confirm it's running without errors. Next, test the OAuth discovery endpoint by running curl http://localhost:3000/.well-known/oauth-authorization-server to verify your server exposes the correct authorization configuration. Then, verify authentication is enforced by calling curl http://localhost:3000/mcp without credentials—this should return a 401 Unauthorized response, confirming protected endpoints are secured. Finally, test with a valid token by running curl -H "Authorization: Bearer YOUR_TOKEN" http://localhost:3000/mcp (replace YOUR_TOKEN with an actual access token from your auth provider) to confirm authenticated requests succeed and return the expected response—if all these steps work as described, your authentication implementation is functioning correctly.Terminal # Start your MCP servernpm start# Test discovery endpointcurl http://localhost:3000/.well-known/oauth-authorization-server# Test protected endpoint (should return 401)curl http://localhost:3000/mcp# Test with valid tokencurl -H "Authorization: Bearer YOUR_TOKEN" http://localhost:3000/mcpTerminal # Start your MCP serverpython server.py# Test discovery endpointcurl http://localhost:3000/.well-known/oauth-authorization-server# Test protected endpoint (should return 401)curl http://localhost:3000/mcp# Test with valid tokencurl -H "Authorization: Bearer YOUR_TOKEN" http://localhost:3000/mcpThe discovery endpoint should return OAuth configuration metadata. Protected endpoints should reject requests without valid tokens and accept requests with properly scoped access tokens.
-
Add the Scalekit authstack marketplace
Need to install GitHub Copilot CLI? See the getting started guide — an active GitHub Copilot subscription is required.
Register Scalekit’s plugin marketplace to access pre-configured authentication plugins. This marketplace provides implementation skills that help GitHub Copilot generate correct MCP server authentication code.
Terminal copilot plugin marketplace add scalekit-inc/github-copilot-authstackThe marketplace provides specialized plugins that understand MCP server architectures and OAuth 2.1 security requirements. These plugins guide GitHub Copilot to generate implementation code that matches your project structure.
To remove the Scalekit authstack marketplace, use the remove command:
Terminal copilot plugin marketplace remove github-copilot-authstack -
Install the MCP Auth plugin
Install the MCP Auth plugin to give GitHub Copilot the skills needed to generate OAuth 2.1 authentication code for MCP servers:
Terminal copilot plugin install mcp-auth@scalekit-auth-stackVerify the plugin is installed
Confirm the plugin installed successfully:
Terminal copilot plugin list -
Generate authentication implementation
Use a structured prompt to direct GitHub Copilot. A well-formed prompt ensures the agent generates complete, production-ready authentication code that includes all required security components.
Copy the following command into your terminal:
Terminal copilot "Add OAuth 2.1 authentication to my MCP server using Scalekit. Initialize ScalekitClient with environment credentials, implement /.well-known/ metadata endpoint for discovery, and add authentication middleware that validates JWT bearer tokens on all MCP requests. Code only."GitHub Copilot uses the MCP Auth plugin to analyze your existing MCP server structure, generate authentication middleware with token validation, create the OAuth discovery endpoint, and configure environment variable handling.
-
Verify the implementation
After GitHub Copilot completes, verify that all authentication components are properly configured:
Check generated files:
- Authentication middleware with JWT validation
- Environment variable configuration (
.env.example) - OAuth discovery endpoint (
/.well-known/oauth-authorization-server) - Error handling for invalid or expired tokens
Test the authentication flow:
Terminal # Start your MCP servernpm start# Test discovery endpointcurl http://localhost:3000/.well-known/oauth-authorization-server# Test protected endpoint (should return 401)curl http://localhost:3000/mcp# Test with valid tokencurl -H "Authorization: Bearer YOUR_TOKEN" http://localhost:3000/mcpThe discovery endpoint should return OAuth configuration metadata. Protected endpoints should reject requests without valid tokens and accept requests with properly scoped access tokens.
-
Register the Scalekit Auth Stack marketplace
Cursor surfaces Claude Code plugins in Settings > Plugins. If you haven’t installed Claude Code yet, follow the Claude Code quickstart first.
Open the Claude Code REPL:
Terminal claudeThen add the Scalekit marketplace:
Claude REPL /plugin marketplace add scalekit-inc/claude-code-authstackWhen the marketplace registers successfully, you’ll see:
Terminal ❯ /plugin marketplace add scalekit-inc/claude-code-authstack⎿ Successfully added marketplace: scalekit-auth-stack -
Open the plugin in Cursor
Launch Cursor and go to Settings > Plugins. The Scalekit Auth Stack plugins appear here automatically — Cursor picks them up from Claude Code’s plugin registry.
Select the authentication plugin you need (for example, Modular SSO, Full Stack Auth, or MCP Auth) and enable it.
-
Generate the implementation
Open Cursor’s chat panel with Cmd+L (macOS) or Ctrl+L (Windows/Linux) and paste in an implementation prompt. Use the same prompt from the corresponding Claude Code tab — the Scalekit plugins and their authentication skills work identically in Cursor.
-
Verify the implementation
After Cursor finishes generating code, confirm all authentication components are in place:
- Scalekit client initialized with your API credentials (set up a
.envfile with your Scalekit environment variables) - Authorization URL generation and callback handler
- Session or token integration matching your application’s existing patterns
- Scalekit client initialized with your API credentials (set up a
Once the Scalekit Auth Stack is live on cursor.com/marketplace, you can skip steps 1–2 entirely. A single click on the Add to Cursor button will install the plugin directly into Cursor, and it will appear immediately in Settings > Plugins.
Support for additional coding agents is coming soon:
- OpenCode
- Windsurf
- Gemini CLI
- Amazon Q Developer
Join the Slack community to share feedback and get notified when support for your agent launches.
In the meantime, use the Claude Code tab — the implementation prompts work with any coding agent that supports custom instructions.
Next steps
Section titled “Next steps”Your MCP server now has OAuth 2.1 authentication integrated. Test the implementation with your MCP host to verify the authentication flow works correctly.
Test with MCP hosts
Section titled “Test with MCP hosts”Connect your authenticated MCP server to any MCP-compatible host:
- Claude Desktop or Claude Code: Configure the MCP server connection in settings
- Cursor: Add the MCP server to your workspace configuration
- Windsurf: Register the server in your MCP settings
- Other MCP hosts: Follow your host’s documentation for connecting authenticated MCP servers
When you connect, the host authenticates using the OAuth 2.1 flow you configured. Verify that protected MCP resources require valid access tokens and that the discovery endpoint provides correct OAuth metadata.