Configuration
Learn how to configure Seed for your OIDC provider and customize its behavior.
Configuration Overview
Seed is configured entirely through environment variables, either in a .env file or passed directly to the container/process.
Configuration file: .env
cp .env.example .env
vim .envRequired Configuration
Minimum Configuration (No Auth)
For testing or development:
PORT=3000
AUTH_REQUIRED=falseDevelopment Only
Never deploy to production with AUTH_REQUIRED=false. This disables all authentication!
Full Production Configuration
For production with OIDC authentication:
# Server
PORT=3000
BASE_URL=https://seed.example.com
# Authentication
AUTH_REQUIRED=true
# OIDC Provider
OIDC_ISSUER=https://auth.example.com/application/o/my-app/
OIDC_AUDIENCE=my-client-id
# OAuth Endpoints
OAUTH_TOKEN_URL=https://auth.example.com/application/o/token/
OAUTH_AUTHORIZATION_URL=https://auth.example.com/application/o/authorize/
# Redis
REDIS_URL=redis://localhost:6379Environment Variables Reference
Server Configuration
| Variable | Required | Default | Description |
|---|---|---|---|
PORT | No | 3000 | HTTP server port |
BASE_URL | No | `` | Base URL for WWW-Authenticate header |
NODE_ENV | No | development | Environment mode (development, production) |
Example:
PORT=8080
BASE_URL=https://seed.mycompany.com
NODE_ENV=productionAuthentication Configuration
| Variable | Required | Default | Description |
|---|---|---|---|
AUTH_REQUIRED | No | true | Enable/disable authentication |
Example:
# Production: Enable authentication
AUTH_REQUIRED=true
# Development: Disable authentication
AUTH_REQUIRED=falseOIDC Configuration
| Variable | Required | Default | Description |
|---|---|---|---|
OIDC_ISSUER | Yes* | `` | OIDC issuer URL (used for JWT validation and JWKS discovery) |
OIDC_AUDIENCE | Yes* | `` | Expected audience claim in JWT (client ID) |
OIDC_JWKS_URL | No | Auto-discovered | Explicit JWKS URL (overrides discovery) |
* Required when AUTH_REQUIRED=true
Example:
OIDC_ISSUER=https://authentik.company.com/application/o/seed/
OIDC_AUDIENCE=seed-client-abc123OAuth Endpoints
| Variable | Required | Default | Description |
|---|---|---|---|
OAUTH_TOKEN_URL | Yes* | `` | Token endpoint for code exchange |
OAUTH_AUTHORIZATION_URL | Yes* | `` | Authorization endpoint for user login |
* Required when AUTH_REQUIRED=true
Example:
OAUTH_TOKEN_URL=https://authentik.company.com/application/o/token/
OAUTH_AUTHORIZATION_URL=https://authentik.company.com/application/o/authorize/Redis Configuration
| Variable | Required | Default | Description |
|---|---|---|---|
REDIS_URL | No | redis://redis:6379 | Redis connection URL |
Example:
# Local
REDIS_URL=redis://localhost:6379
# With password
REDIS_URL=redis://:mypassword@localhost:6379
# Remote with TLS
REDIS_URL=rediss://user:pass@redis.example.com:6380
# Custom database
REDIS_URL=redis://localhost:6379/2Dynamic Client Registration (DCR)
| Variable | Required | Default | Description |
|---|---|---|---|
DCR_CLIENT_TTL | No | 2592000 | Client TTL in seconds (30 days) |
DCR_RATE_LIMIT_MAX | No | 10 | Max registrations per window |
DCR_RATE_LIMIT_WINDOW_MS | No | 3600000 | Rate limit window (1 hour) |
Example:
DCR_CLIENT_TTL=604800 # 7 days
DCR_RATE_LIMIT_MAX=5 # 5 registrations
DCR_RATE_LIMIT_WINDOW_MS=1800000 # 30 minutesCORS Configuration
| Variable | Required | Default | Description |
|---|---|---|---|
CORS_EXTRA_ORIGINS | No | `` | Additional CORS origins (comma-separated) |
Default origins: localhost, claude.ai, *.anthropic.com
Example:
CORS_EXTRA_ORIGINS=https://app.company.com,https://dev.company.comOIDC Provider Examples
Authentik
Authentik is an open-source identity provider.
1. Create OAuth2/OpenID Provider in Authentik:
- Name:
Seed MCP Server - Client type:
Confidential - Redirect URIs: Add client callback URLs
2. Get configuration values:
- Issuer:
https://authentik.company.com/application/o/seed/ - Token URL:
https://authentik.company.com/application/o/token/ - Authorization URL:
https://authentik.company.com/application/o/authorize/ - Client ID: Copy from provider settings
3. Configure Seed:
OIDC_ISSUER=https://authentik.company.com/application/o/seed/
OIDC_AUDIENCE=your-client-id
OAUTH_TOKEN_URL=https://authentik.company.com/application/o/token/
OAUTH_AUTHORIZATION_URL=https://authentik.company.com/application/o/authorize/Keycloak
Keycloak is a popular open-source identity solution.
1. Create Client in Keycloak:
- Realm: Select or create realm
- Client ID:
seed-mcp - Client Protocol:
openid-connect - Access Type:
confidential - Valid Redirect URIs: Add client callback URLs
2. Get configuration values:
- Issuer:
https://keycloak.company.com/realms/myrealm - Well-known URL:
https://keycloak.company.com/realms/myrealm/.well-known/openid-configuration - Copy
token_endpointandauthorization_endpoint
3. Configure Seed:
OIDC_ISSUER=https://keycloak.company.com/realms/myrealm
OIDC_AUDIENCE=seed-mcp
OAUTH_TOKEN_URL=https://keycloak.company.com/realms/myrealm/protocol/openid-connect/token
OAUTH_AUTHORIZATION_URL=https://keycloak.company.com/realms/myrealm/protocol/openid-connect/authAuth0
Auth0 is a commercial identity platform.
1. Create Application in Auth0:
- Type:
Regular Web Application - Name:
Seed MCP Server - Add Allowed Callback URLs
2. Get configuration values:
- Domain:
your-tenant.auth0.com - Client ID: From application settings
- Issuer:
https://your-tenant.auth0.com/
3. Configure Seed:
OIDC_ISSUER=https://your-tenant.auth0.com/
OIDC_AUDIENCE=your-client-id
OAUTH_TOKEN_URL=https://your-tenant.auth0.com/oauth/token
OAUTH_AUTHORIZATION_URL=https://your-tenant.auth0.com/authorizeOkta
Okta is an enterprise identity provider.
1. Create Application in Okta:
- Type:
Web Application - Grant types:
Authorization Code,Refresh Token - Add Sign-in redirect URIs
2. Get configuration values:
- Domain:
your-org.okta.com - Authorization Server:
defaultor custom - Issuer:
https://your-org.okta.com/oauth2/default
3. Configure Seed:
OIDC_ISSUER=https://your-org.okta.com/oauth2/default
OIDC_AUDIENCE=your-client-id
OAUTH_TOKEN_URL=https://your-org.okta.com/oauth2/default/v1/token
OAUTH_AUTHORIZATION_URL=https://your-org.okta.com/oauth2/default/v1/authorizeGoogle Identity
Google Identity for Google Cloud.
1. Create OAuth 2.0 Client:
- Console: Google Cloud Console → APIs & Services → Credentials
- Type:
Web application - Add Authorized redirect URIs
2. Get configuration values:
- Issuer:
https://accounts.google.com - Client ID: From credentials page
3. Configure Seed:
OIDC_ISSUER=https://accounts.google.com
OIDC_AUDIENCE=your-client-id.apps.googleusercontent.com
OAUTH_TOKEN_URL=https://oauth2.googleapis.com/token
OAUTH_AUTHORIZATION_URL=https://accounts.google.com/o/oauth2/v2/authMicrosoft Entra ID (Azure AD)
Microsoft Entra ID (formerly Azure AD).
1. Register Application:
- Portal: Azure Portal → Entra ID → App registrations
- Type:
Web - Add Redirect URIs
2. Get configuration values:
- Tenant ID: From app overview
- Client ID: Application (client) ID
- Issuer:
https://login.microsoftonline.com/{tenant-id}/v2.0
3. Configure Seed:
OIDC_ISSUER=https://login.microsoftonline.com/your-tenant-id/v2.0
OIDC_AUDIENCE=your-client-id
OAUTH_TOKEN_URL=https://login.microsoftonline.com/your-tenant-id/oauth2/v2.0/token
OAUTH_AUTHORIZATION_URL=https://login.microsoftonline.com/your-tenant-id/oauth2/v2.0/authorizeConfiguration Validation
Test Configuration
After configuring, test the setup:
1. Start Seed:
npm start2. Check health:
curl http://localhost:3000/health3. Test discovery:
curl http://localhost:3000/.well-known/oauth-authorization-server4. Verify OIDC issuer:
# Should return JWKS
curl $OIDC_ISSUER/.well-known/openid-configurationCommon Issues
Issuer Mismatch:
Error: JWT issuer does not match OIDC_ISSUERSolution: Ensure OIDC_ISSUER exactly matches the iss claim in tokens.
JWKS Not Found:
Error: Unable to fetch JWKS from issuerSolution:
- Verify
OIDC_ISSUERis accessible - Check OIDC provider returns valid OpenID configuration
- Use
OIDC_JWKS_URLto specify explicit JWKS endpoint
Audience Mismatch:
Error: JWT audience does not match OIDC_AUDIENCESolution: Ensure OIDC_AUDIENCE matches the aud claim in tokens (usually the client ID).
Security Best Practices
Production Checklist
- [ ]
AUTH_REQUIRED=trueenabled - [ ] Strong Redis password (if exposed)
- [ ] HTTPS enabled (via reverse proxy)
- [ ]
BASE_URLset to public HTTPS URL - [ ] OIDC endpoints use HTTPS
- [ ] Redis uses
rediss://for TLS (if remote) - [ ] Rate limiting configured appropriately
- [ ] Client TTL set according to security policy
Environment File Security
Protect .env file:
# Set restrictive permissions
chmod 600 .env
# Never commit to git
echo ".env" >> .gitignoreUse secrets management in production:
- Docker: Use secrets or env files
- Kubernetes: Use Secrets
- systemd: Use
EnvironmentFilewith restricted permissions
CORS Configuration
Limit CORS origins to trusted domains:
# Bad: Allows all origins
# Don't set CORS_EXTRA_ORIGINS to wildcard
# Good: Specific origins
CORS_EXTRA_ORIGINS=https://app.company.com,https://internal.company.comAdvanced Configuration
Multiple Environments
Use different .env files:
# Development
cp .env.example .env.development
# Edit for local development
# Production
cp .env.example .env.production
# Edit for production
# Load specific environment
NODE_ENV=production node dist/index.jsDocker Environment
Pass via environment variables:
docker run -d \
-e AUTH_REQUIRED=true \
-e OIDC_ISSUER=https://auth.example.com/... \
-e OIDC_AUDIENCE=client-id \
-e OAUTH_TOKEN_URL=https://auth.example.com/token \
-e OAUTH_AUTHORIZATION_URL=https://auth.example.com/authorize \
-e REDIS_URL=redis://redis:6379 \
seed:latestOr use env file:
docker run -d --env-file .env.production seed:latestKubernetes ConfigMap
apiVersion: v1
kind: ConfigMap
metadata:
name: seed-config
data:
PORT: "3000"
AUTH_REQUIRED: "true"
OIDC_ISSUER: "https://auth.example.com/application/o/seed/"
REDIS_URL: "redis://redis-service:6379"Use in deployment:
envFrom:
- configMapRef:
name: seed-config
- secretRef:
name: seed-secrets # For sensitive valuesNext Steps
- Quick Start - Run Seed with your configuration
- First Steps - Test your setup
- Architecture: Configuration - Deep dive into configuration system
Related Documentation
- Authentication Flow - How JWT validation works
- OAuth Implementation - OAuth 2.1 flow details
- API: Discovery - Discovery endpoint documentation