Secure authentication for protected MCP servers using Adobe IMS or Okta
MCP Remote with Adobe and Okta Authentication
A wrapper for mcp-remote that handles Adobe IMS or Okta authentication using OAuth implicit flow, providing seamless authentication for protected MCP servers.
Features
- 🔐 Multi-Provider OAuth: Implements Adobe's and Okta's OAuth implicit flow for secure user authentication.
- 🔄 Token Management: Automatic token storage, validation, and expiration handling.
- 🖥️ Cross-Platform: Works on macOS, Windows, and Linux.
- 🚀 Zero Maintenance: Set it once, never worry about tokens again.
- 🔧 Configurable: Support for multiple environments, scopes, and authentication methods.
- 🔒 Secure Storage: Tokens stored securely in user's home directory.
- 🎯 Production Ready: Robust error handling for both Adobe and Okta.
Installation
Via npx (Recommended)
npx mcp-remote-with-okta <mcp-url>
Global Installation
npm install -g mcp-remote-with-okta
mcp-remote-with-okta <mcp-url>
Configuration
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
AUTH_PROVIDER |
Optional | adobe |
Authentication provider (adobe or okta) |
ADOBE_CLIENT_ID |
✅ If AUTH_PROVIDER is adobe |
- | Client ID for Adobe IMS |
ADOBE_SCOPE |
Optional | AdobeID,openid |
OAuth scope for Adobe IMS |
ADOBE_IMS_ENV |
Optional | prod |
IMS environment (prod, stage, dev) |
OKTA_CLIENT_ID |
✅ If AUTH_PROVIDER is okta |
- | Client ID for Okta |
OKTA_DOMAIN |
✅ If AUTH_PROVIDER is okta |
- | Your Okta domain (e.g., dev-12345.okta.com) |
OKTA_SCOPE |
Optional | openid profile email |
OAuth scope for Okta |
REDIRECT_URI |
Optional | http://localhost:8080/callback |
OAuth redirect URI |
AUTH_METHOD |
Optional | jwt |
Authentication method (jwt or access_token) |
DEBUG_MODE |
Optional | false |
Enable debug mode for troubleshooting |
AUTO_REFRESH |
Optional | true |
Enable automatic token refresh |
REFRESH_THRESHOLD |
Optional | 10 |
Auto-refresh threshold in minutes |
MCP Configuration
For Adobe
{
"mcpServers": {
"my-mcp-server": {
"command": "npx",
"args": [
"mcp-remote-with-okta",
"https://your-mcp-server.com/mcp"
],
"env": {
"AUTH_PROVIDER": "adobe",
"ADOBE_CLIENT_ID": "your_client_id_here",
"ADOBE_IMS_ENV": "prod"
}
}
}
}
For Okta
{
"mcpServers": {
"my-mcp-server": {
"command": "npx",
"args": [
"mcp-remote-with-okta",
"https://your-mcp-server.com/mcp"
],
"env": {
"AUTH_PROVIDER": "okta",
"OKTA_CLIENT_ID": "your_okta_client_id",
"OKTA_DOMAIN": "your_okta_domain.okta.com"
}
}
}
}
Usage
As MCP Server (Primary Use Case)
The script automatically detects the configured authentication provider and handles user authentication transparently.
For Adobe:
export AUTH_PROVIDER=adobe
export ADOBE_CLIENT_ID=your_client_id
npx mcp-remote-with-okta https://my.mcp-server.com/mcp
For Okta:
export AUTH_PROVIDER=okta
export OKTA_CLIENT_ID=your_client_id
export OKTA_DOMAIN=your.okta.domain
npx mcp-remote-with-okta https://my.mcp-server.com/mcp
CLI Commands
The package also provides CLI commands for token management:
# Authenticate user and get token
npx mcp-remote-with-okta <mcp-url> authenticate
# Check token status
npx mcp-remote-with-okta <mcp-url> status
# Display current token
npx mcp-remote-with-okta <mcp-url> token
# Clear stored tokens
npx mcp-remote-with-okta <mcp-url> clear
# Show help
npx mcp-remote-with-okta <mcp-url> help
How It Works
This wrapper implements the OAuth implicit flow for authentication:
- OAuth Setup: Configures OAuth parameters for the selected provider (Adobe or Okta).
- Browser Authentication: Opens browser for secure user authentication.
- Token Capture: Local HTTP server captures OAuth callback with tokens.
- Token Storage: Securely stores tokens with expiration tracking.
- JWT Exchange: Optional JWT token exchange for servers requiring JWT authentication.
- MCP Launch: Launches
mcp-remotewithAuthorization: Bearer <token>header.
Authentication Flow
The package implements a complete OAuth implicit flow:
1. Generate OAuth URL → Auth Server (Adobe IMS or Okta)
2. Open Browser → User Authentication
3. Capture Callback → Local HTTP Server
4. Extract Tokens → From URL Fragment
5. Store Tokens → Secure Local Storage
6. Launch MCP → With Auth Header
Environments
The library supports multiple Adobe IMS environments. For Okta, the domain is configured directly via OKTA_DOMAIN.
- Production (
prod) - Default Adobe production environment - Stage (
stage,stg) - Adobe staging environment for testing - Development (
dev, `
Environment Variables
AUTH_PROVIDERAuthentication provider (adobe or okta)ADOBE_CLIENT_IDClient ID for Adobe IMSOKTA_CLIENT_IDClient ID for OktaOKTA_DOMAINYour Okta domain (e.g., dev-12345.okta.com)Configuration
{"mcpServers": {"my-mcp-server": {"command": "npx", "args": ["mcp-remote-with-okta", "https://your-mcp-server.com/mcp"], "env": {"AUTH_PROVIDER": "okta", "OKTA_CLIENT_ID": "your_okta_client_id", "OKTA_DOMAIN": "your_okta_domain.okta.com"}}}}