MCPLab

Reference

Environment Variables

All environment variables read by MCPLab.

Provider API Keys

  • ANTHROPIC_API_KEY — required when using provider: anthropic.
  • OPENAI_API_KEY: required for OpenAI LLM agents and the OpenAI Decisions provider.
  • AZURE_OPENAI_API_KEY: required for legacy azure_openai agents. Also used by Azure Foundry if its dedicated key is absent and this key belongs to the same resource.
  • AZURE_OPENAI_ENDPOINT: required for azure_openai agents. Full Azure OpenAI resource URL.
  • AZURE_OPENAI_DEPLOYMENT: required for azure_openai agents. Deployment name used by that backend adapter.
  • AZURE_OPENAI_API_VERSION: optional for legacy azure_openai; defaults to 2024-02-15-preview. Azure Foundry uses the v1 API without this setting.
Anthropic .env
ANTHROPIC_API_KEY=sk-ant-api03-...
OpenAI .env
OPENAI_API_KEY=sk-proj-...
Azure OpenAI .env
AZURE_OPENAI_API_KEY=your-azure-key
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com
AZURE_OPENAI_DEPLOYMENT=your-deployment-name

Azure Foundry Environment Variables

Set these variables on the backend for Azure Foundry LLM agents and decisions. Restart MCPLab after changing them. Agent model and Decision Engine Deployment name choose deployments independently on the configured resource. See Foundry LLM agents and Foundry decisions.

  • AZURE_FOUNDRY_ENDPOINT: required resource endpoint, for example https://your-resource.services.ai.azure.com. Use the resource URL without a project path, embedded credentials, query string, fragment, or API path. MCPLab appends the appropriate inference path.
  • AZURE_FOUNDRY_API_KEY: API key for that resource, taking precedence over AZURE_OPENAI_API_KEY. The latter is an allowed fallback when the dedicated key is absent, but must belong to the same resource. Sharing a key does not make the endpoint optional.
  • AZURE_FOUNDRY_DEPLOYMENTS: optional comma-separated deployment suggestions for the agent editor's Load configured deployments control. It reads this variable rather than listing deployments from Azure. Manual entry works without it.

Decision Engine Credentials

Set these variables on the machine, container, CI job, or MCP server process running evaluations. The CLI/app loads .env from its working directory; restart it after changing variables. Supply the environment explicitly for an independently launched MCP server. Secrets are not Decision Engine form fields or workspace YAML settings. Your Evaluation Judge also requires its own provider credentials.

Follow Judge & Decision Engine for account setup and token permissions.

  • CLOUDFLARE_ACCOUNT_ID: copy Account ID under Get Account ID on Workers AI's Use REST API page. See Cloudflare credential setup.
  • CLOUDFLARE_AUTH_TOKEN: create and copy a Workers AI API Token on that page, with Workers AI Read and Edit permissions for the same account. See Cloudflare credential setup.
  • TYPESAFE_API_KEY: API key for direct TypeSafe Jev requests.
  • OPENAI_API_KEY: reused by OpenAI Decisions, independently of agent and judge model settings.
  • Azure Foundry decisions reuse the endpoint and key described in Azure Foundry Environment Variables; their Deployment name is configured in Decision Engine settings.
  • Ollama requires no API key. Set its backend-reachable URL and installed model in Decision Engine settings.

Bearer Token References

Any environment variable name can be used as a bearer token reference in a server definition. The variable name (without the $ prefix) is looked up at runtime.

example
servers:
  - id: my-server
    transport: http
    url: https://api.example.com/mcp
    token: $MY_SERVER_TOKEN   # reads process.env.MY_SERVER_TOKEN