Environment variables in UMCP allow you to pass secrets, API keys, and configuration values to MCP providers. UMCP supports both single values and arrays for round-robin rotation.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/grittyninja/umcp/llms.txt
Use this file to discover all available pages before exploring further.
Basic Usage
Define environment variables in theenv object of a provider:
Schema Reference
Map of environment variable names to valuesEach value can be either:
- A single string
- An array of strings (for round-robin rotation)
Environment variable valueSingle string:Array (round-robin):Arrays must contain at least one non-empty string.
Single Values
Use a string for environment variables that don’t need rotation:Round-Robin Rotation
UMCP supports round-robin rotation for environment variables by providing an array of values. This is useful for:- Load balancing across multiple API keys
- Rate limit management by rotating between keys
- High availability with fallback credentials
Configuration
Provide an array of strings instead of a single value:How It Works
When you provide an array of values:- First invocation: Uses the first value (
BRAVE_API_KEY_1) - Second invocation: Uses the second value (
BRAVE_API_KEY_2) - Third invocation: Uses the third value (
BRAVE_API_KEY_3) - Fourth invocation: Wraps back to the first value (
BRAVE_API_KEY_1)
Rotation happens per provider invocation, not per tool call. Each time the provider process is started, the next value in the rotation is used.
Benefits
Rate Limit Distribution:Multiple Environment Variables
You can mix single values and arrays:Validation Rules
UMCP enforces these validation rules for environment variables:- String or array: Values must be either a string or an array of strings
- Non-empty arrays: Arrays must contain at least one element
- Non-empty strings: Array elements must be non-empty strings
- Optional field: The
envobject itself is optional
Examples
Single API Key
Multiple Rotating Keys
Multiple Variables with Rotation
Configuration Values
Security Best Practices
Use Environment Variable References
Instead of hardcoding secrets in the config file, reference environment variables:UMCP passes the
env object directly to the provider process. If your provider supports environment variable expansion, you can use ${VAR} syntax.Separate Config from Secrets
- Check in: Config file with placeholder values
- Don’t check in: Config file with actual secrets
- Use: Secret management tools (Vault, AWS Secrets Manager, etc.)
Rotate Keys Regularly
When using arrays for rotation:- Generate new keys in your API provider dashboard
- Add to array without removing old keys
- Test that new keys work
- Remove old keys after confirming rotation is working
Common Patterns
Development vs Production
Multi-Region Setup
Error Messages
Empty array
Invalid value type
Next Steps
Provider Configuration
Learn more about provider settings
Configuration Overview
Review the complete configuration schema