|
| 1 | +# Example settings: the only env file committed to git. Copy it to start: |
| 2 | +# cp .env.example .env |
| 3 | +# Variables already set in the environment (Docker, CI, shell) always win over .env. |
| 4 | +# Keep only placeholders and local-only defaults here, never real secrets. |
| 5 | + |
| 6 | +# ---------------------------------------------------------------- App |
| 7 | +# dev | stage | prod (maps to Development | Staging | Production) |
| 8 | +APP_ENV=dev |
| 9 | +# Port the server listens on (also used by Docker Compose). |
| 10 | +APP_PORT=5080 |
| 11 | +# Public base URL clients use (behind a proxy: https://mcp.example.com). Empty = http://localhost:${APP_PORT} |
| 12 | +APP_URL= |
| 13 | + |
| 14 | +# ---------------------------------------------------------------- MCP |
| 15 | +MCP_SERVER_NAME=DotnetMcpTemplate |
| 16 | +MCP_PATH=/mcp |
| 17 | +# Optional instructions sent to clients (what this server is for). |
| 18 | +MCP_INSTRUCTIONS= |
| 19 | +# required: every MCP request needs a token (clients log in on connect) |
| 20 | +# mixed: anonymous clients can connect; [Authorize] is checked per tool/resource/prompt |
| 21 | +# none: no login, a fixed developer user is signed in (only allowed when APP_ENV=dev) |
| 22 | +MCP_AUTH_MODE=required |
| 23 | +# Where built MCP App bundles live. Empty = ui_dist next to the app. |
| 24 | +MCP_UI_DIST_DIR= |
| 25 | + |
| 26 | +# ---------------------------------------------------------------- Auth |
| 27 | +# oidc (default, proxy for any OIDC identity provider) | jwt (validate IdP tokens directly) | your own provider |
| 28 | +AUTH_PROVIDER=oidc |
| 29 | + |
| 30 | +# --- OIDC identity provider (any IdP: Google, Entra ID, Auth0, Okta, Keycloak, Zitadel, ...) |
| 31 | +# Register ONE app in your IdP with redirect URI: ${APP_URL}/oauth/callback |
| 32 | +OIDC_DISCOVERY_URL=https://accounts.google.com/.well-known/openid-configuration |
| 33 | +OIDC_CLIENT_ID=change-me |
| 34 | +# Empty = public client (PKCE only). |
| 35 | +OIDC_CLIENT_SECRET= |
| 36 | +# client_secret_basic | client_secret_post |
| 37 | +OIDC_CLIENT_AUTH_METHOD=client_secret_basic |
| 38 | +OIDC_SCOPES=openid,profile,email |
| 39 | +# auto: call userinfo when the IdP advertises it | always | never |
| 40 | +OIDC_USERINFO=auto |
| 41 | +# Claim holding roles; dot paths work for nested claims, e.g. realm_access.roles |
| 42 | +OIDC_ROLE_CLAIM=roles |
| 43 | +OIDC_GROUPS_CLAIM=groups |
| 44 | +# Extra IdP claims to copy into the server token (comma-separated), e.g. tenant_id,department |
| 45 | +OIDC_TOKEN_CLAIMS= |
| 46 | +# jwt provider only: accepted token audience(s). Empty = the MCP URL (APP_URL + MCP_PATH). |
| 47 | +OIDC_AUDIENCE= |
| 48 | + |
| 49 | +# --- OIDC proxy (the MCP server is the OAuth server for MCP clients) |
| 50 | +# Signs server-issued tokens and encrypts stored IdP tokens. 32+ chars: openssl rand -base64 48 |
| 51 | +AUTH_TOKEN_SIGNING_KEY=development-only-signing-key-change-me-0123456789 |
| 52 | +AUTH_TOKEN_LIFETIME_MINUTES=60 |
| 53 | +AUTH_REFRESH_TOKEN_LIFETIME_DAYS=30 |
| 54 | +# Redirect URIs MCP clients may register (comma-separated; * allowed in port and path). |
| 55 | +AUTH_ALLOWED_REDIRECT_URIS=http://localhost:*,http://127.0.0.1:*,https://claude.ai/api/mcp/auth_callback,https://claude.com/api/mcp/auth_callback |
| 56 | +# Remember a user's consent for a client for N days (0 = always ask). |
| 57 | +AUTH_CONSENT_REMEMBER_DAYS=30 |
| 58 | +# memory (single instance) | redis (several instances) |
| 59 | +AUTH_STORE=memory |
| 60 | +REDIS_URL= |
| 61 | + |
| 62 | +# ---------------------------------------------------------------- API clients (one prefix per data source) |
| 63 | +# {PREFIX}_BASE_URL, _TIMEOUT_SECONDS, _RETRY_COUNT, _RETRY_UNSAFE_METHODS, _HEADERS, |
| 64 | +# _AUTH = none | bearer | api_key | basic | client_credentials | user |
| 65 | +SAMPLE_API_BASE_URL=https://jsonplaceholder.typicode.com/ |
| 66 | +SAMPLE_API_TIMEOUT_SECONDS=15 |
| 67 | +SAMPLE_API_RETRY_COUNT=3 |
| 68 | +SAMPLE_API_AUTH=none |
| 69 | +SAMPLE_API_HEADERS= |
0 commit comments