MCP server for ControlMonkey — AI-assisted infrastructure management
Project description
ControlMonkey MCP Server
Manage your cloud infrastructure through natural language. The ControlMonkey MCP server connects AI assistants like Cursor, Claude Code, and Windsurf directly to your ControlMonkey platform - so you can query, create, and operate your Terraform workflows without leaving your editor.
Example Use Cases
Investigate a Failed Deployment
When a deployment fails, ask the AI to pull the logs and diagnose the issue directly in your IDE.
The last deployment on stack "payments-service" failed.
Get the deployment details and show me the Terraform apply logs.
What went wrong?
Policy and Compliance Setup
Enforce governance rules across your infrastructure using control policies.
Create a control policy that prevents deploying resources without
the "team" and "environment" tags. Map it to the "production"
namespace so it applies to all stacks there.
Available Tools
The available tools of the agents are built dynamically during the MCP server startup based on the API token's role and permissions. Once connected, your AI assistant can help you:
- Namespaces & Stacks — Create, update, query, and delete namespaces and Terraform stacks
- Plans & Deployments — Trigger Terraform plans and deployments, review states, approve or cancel runs
- Templates — Manage ephemeral and persistent templates, create stacks from templates
- Variables — Create and manage Terraform input variables across scopes
- Control Policies — Create policies and policy groups, map them to targets for governance
- Cloud Credentials — Manage AWS, Azure, and GCP credentials
- Notifications — Configure Slack, Teams, and email notification endpoints and subscriptions
- Disaster Recovery — Set up and manage DR configurations
- Auto Discovery — Configure automatic stack discovery for namespaces
- VCS & SSH Keys — Add version control providers and manage SSH keys
- Audit — Query audit events across your organization
⚠️ Note – Use AI With Caution
ControlMonkey integrates with third-party LLM providers but does not control the underlying models or their outputs. AI-generated suggestions - including code changes, remediation steps, and infrastructure modifications - should always be reviewed by a qualified team member before being applied to your environment.
Prerequisites
1. Install uv
This server uses uv, the standard Python package manager for the MCP ecosystem.
macOS:
brew install uv
Linux / WSL:
curl -LsSf https://astral.sh/uv/install.sh | sh
Windows:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
2. Create a Programmatic User
You'll need an API token from a ControlMonkey Programmatic User. Follow the Programmatic Users guide to create one.
Note: The role you assign determines which operations are available through the MCP server. Choose permissions appropriate for your use case.
Quick Start
Cursor
Add to .cursor/mcp.json:
{
"mcpServers": {
"controlmonkey": {
"command": "uvx",
"args": ["controlmonkey-mcp"],
"env": {
"CM_BASE_URL": "https://api.controlmonkey.io",
"CM_API_TOKEN": "your-api-token"
}
}
}
}
Claude Code
Run in your terminal:
claude mcp add-json controlmonkey '{"command":"uvx","args":["controlmonkey-mcp"],"env":{"CM_BASE_URL":"https://api.controlmonkey.io","CM_API_TOKEN":"your-api-token"}}'
To make it available across all projects, add the --scope user flag:
claude mcp add-json controlmonkey --scope user '{"command":"uvx","args":["controlmonkey-mcp"],"env":{"CM_BASE_URL":"https://api.controlmonkey.io","CM_API_TOKEN":"your-api-token"}}'
Verify it's connected:
claude mcp list
Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"controlmonkey": {
"command": "uvx",
"args": ["controlmonkey-mcp"],
"env": {
"CM_BASE_URL": "https://api.controlmonkey.io",
"CM_API_TOKEN": "your-api-token"
}
}
}
}
After saving, click Refresh in the MCP toolbar to connect.
Run Directly
CM_BASE_URL=https://api.controlmonkey.io CM_API_TOKEN=your-api-token uvx controlmonkey-mcp
Configuration
You can set configuration via environment variables or a .env file:
| Variable | Required | Default | Description |
|---|---|---|---|
CM_BASE_URL |
✅ | — | ControlMonkey API base URL |
CM_API_TOKEN |
✅ | — | Your Programmatic User API token |
CM_REQUEST_TIMEOUT |
30 |
HTTP timeout in seconds |
Troubleshooting
externally-managed-environment error — Install uv (see Prerequisites) and use uvx instead of running with system Python.
Tools not appearing or outdated — uvx caches packages. Run uv cache clean and restart your MCP client.
Acknowledgments
Special thanks to Lior Azroel (@liorazroel) for helping shape the use cases behind this project.
Resources
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file controlmonkey_mcp-1.0.0.tar.gz.
File metadata
- Download URL: controlmonkey_mcp-1.0.0.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f878441c6e649918c6e90caf2fd47ea7a57210a3a44bbeaf5b452142b4fb0685
|
|
| MD5 |
eb69d716db1422df9e34d9d7c178d322
|
|
| BLAKE2b-256 |
220d9a50f0ff12cc971c94d8f132adf2c945b694ecde103d5fbe04274662c81f
|
File details
Details for the file controlmonkey_mcp-1.0.0-py3-none-any.whl.
File metadata
- Download URL: controlmonkey_mcp-1.0.0-py3-none-any.whl
- Upload date:
- Size: 14.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d643d47968d4b618254d8cd009de162d0ad421a93cff9a08d2bd6898fc15a97
|
|
| MD5 |
64a319dfe77a3bbff2ae5e5d845fac40
|
|
| BLAKE2b-256 |
f45c76451068c57cb5b97d42c6d848cabc07611e8d33c4dfe854801cbaa877a1
|