Envzero's official MCP server
Overview
The Env0 MCP Server connects AI tools Env0's platform. This gives AI agents, assistants, and chatbots the ability to interact with environments in Env0's platform (for example, deploying, canceling and getting the logs of environments), as well as getting the resources from Env0's Cloud Compass. All through natural language interactions. - - Required to run the MCP server container - - One of the following AI coding assistants: - Cursor, Claude Code, VSCode, Windsurf, Cline, Zed, JetBrains AI Assistant, or another MCP-compatible client - - You'll need to gather the following from your env0 account: Create an API key and secret by following the env0 API Keys guide. Find your organization ID in the env0 dashboard: 1. Click on your organization icon in the bottom left corner 2. Select from the left side panel 3. Go to the tab under Organization Settings 4. Copy the For detailed instructions, see the env0 Organizations documentation.
README
Env0’s MCP Server
The Env0 MCP Server connects AI tools Env0’s platform. This gives AI agents, assistants, and chatbots the ability to interact with environments in Env0’s platform (for example, deploying, canceling and getting the logs of environments), as well as getting the resources from Env0’s Cloud Compass. All through natural language interactions.
🛠️ Installation
Requirements
- Docker - Required to run the MCP server container
- MCP Client - One of the following AI coding assistants:
- Cursor, Claude Code, VSCode, Windsurf, Cline, Zed, JetBrains AI Assistant, or another MCP-compatible client
- Env0 API Credentials - You’ll need to gather the following from your env0 account:
🔑 API Key and Secret
Create an API key and secret by following the env0 API Keys guide.
🏢 Organization ID
Find your organization ID in the env0 dashboard:
- Click on your organization icon in the bottom left corner
- Select Settings from the left side panel
- Go to the General tab under Organization Settings
- Copy the Organization ID
For detailed instructions, see the env0 Organizations documentation.
Note: The Organization ID is required if you belong to multiple organizations. If you only have access to one organization, this step ensures the MCP server connects to the correct one.
🔧 Available Tools
The Env0 MCP Server provides a comprehensive set of tools to interact with Env0’s platform through natural language. These tools are organized into the following categories:
💡 Usage Examples
Here are some example natural language queries you can use with the MCP server:
Project & Environment Management:
- “Show me all my projects”
- “List environments in project xyz”
- “Get details for environment abc123”
- “Do I have any environments in project xyz that require my attention?”
Deployments:
- “Deploy my staging environment”
- “Deploy environment xyz with comment ‘hotfix deployment’”
- “Abort the running deployment for environment xyz”
Monitoring:
- “Show me the plan logs for my production environment”
- “What’s the status of environment abc123?”
- “Analyze errors for environment xyz” or “What went wrong with my last deployment?”
- “Why did the deployment from yesterday on env xyz fail?” (chains
search-deployments→get-deployment-context) - “Show me the apply log for deployment abc123”
Cloud Resources:
- “Show me all my AWS resources”
- “Find resources with drift issues”
- “List all S3 buckets in us-east-1 in AWS account xyz”
- “Generate Terraform code for resource xyz from AWS account xyz”
- “Check if my IaC generation job is complete”
For Development of the MCP Server
To set up the development environment and test the server:
-
Clone and install dependencies:
git clone cd mcp-server npm install -
Run the server:
npm start -
Test with MCP Inspector:
Use the MCP Inspector tool for testing and debugging:
npx @modelcontextprotocol/inspector npx tsx src/cli.tsThis will open a web interface at http://localhost:6274 where you can interact with the MCP server and test its capabilities.
Authentication
To allow the MCP server to connect to Env0’s platform, you need to provide your API credentials. To create a new API key, please follow (this guide)[https://docs.env0.com/docs/api-keys]
Once you have your API credentials, you can configure them in the MCP server by setting the following environment variables:
export ENV0_API_KEY="your-api-key-id"
export ENV0_API_SECRET="your-api-key-secret"
export ENV0_ORGANIZATION_ID="your-organization-id"
You can also create a .env file like our example .env.example and fill in the values:
# Required: Your env0 API Key ID (Get this from the Env0 site using the guide above)
ENV0_API_KEY=your-api-key-id-here
# Required: Your env0 API Key Secret (Get this from the Env0 site using the guide above)
ENV0_API_SECRET=your-api-key-secret-here
# Your env0 Organization ID (found in your env0 organization settings). This is required if you have multiple organizations
ENV0_ORGANIZATION_ID=your-organization-id-here
Docker Configuration
The env0 MCP server supports Docker deployment, making it easy to run in containerized environments and integrate with MCP clients.
Building the Docker Image
-
Build the Docker image:
docker build -t env0/mcp-server . -
Test the container:
docker run --rm -e ENV0_API_KEY=your-api-key -e ENV0_API_SECRET=your-api-secret -e ENV0_ORGANIZATION_ID=your-org-id env0/mcp-server
Docker Transport Modes
The container supports both MCP transport modes:
1. Stdio Transport (Default)
- Used by most MCP clients (Claude Desktop, Windsurf)
- Communication via stdin/stdout
- Use
-iflag for interactive mode
2. HTTP Transport
- For remote MCP server access
- Set
MCP_TRANSPORTenvironment variable tohttpto enable
docker run -d -p 3000:3000 -e PORT=3000 -e MCP_TRANSPORT=http env0/mcp-server
Then, configure your MCP client to use the HTTP transport mode:
{
"mcpServers": {
"env0": {
"serverUrl": "http://localhost:3000/mcp"
}
}
}
Install
docker run -i --rm -e ENV0_API_KEY=your-api-key-here -e ENV0_API_SECRET=your-api-secret-here -e ENV0_ORGANIZATION_ID=your-org-id-here env0/mcp-serverConfiguration
{
"mcpServers": {
"env0": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "ENV0_API_KEY=your-api-key-here",
"-e", "ENV0_API_SECRET=your-api-secret-here",
"-e", "ENV0_ORGANIZATION_ID=your-org-id-here",
"env0/mcp-server"
]
}
}
}