Scalr MCP Server
Overview
The Scalr MCP Server is the brain that securely connects your AI assistant (like Claude Desktop or VSCode) directly to your Scalr platform via the Scalr API. It can run remotely or locally as a containerized service, translating your natural language requests into the precise API calls needed to manage your infrastructure. Requests that would have previously taken days to compile the right API endpoints and scripts now take minutes through the AI prompts.
In the documentation below, there are configuration instructions for specific LLM clients, but the MCP server will work with any MCP-compatible client.
HTTP Configuration
The HTTP configuration runs wherever the Docker image is pulled and installed. Users can connect to it over a network without requiring local installation on their workstations.
Prerequisites
Please review the following prerequisites before configuring the MCP server.
- Docker installed and running wherever the MCP server will run. Docker must be running when starting the MCP server.
- Scalr API token (Personal Access Token or Service Account Token). Learn how to generate a token here. It is recommended to create a dedicated API token for the MCP server use with the minimum required permissions.
- MCP-compatible client (e.g., Claude Desktop) to connect to the MCP server.
Configuring the MCP Server
To install and configure the MCP server, the following Docker command should be executed wherever the MCP server will run:
docker run -d
--pull always
--name scalr-mcp-server
-p 8000:8000
-e SCALR_API_URL=[https://your-account.scalr.io](https://your-account.scalr.io)
-e MCP_TRANSPORT=http
-e MCP_HTTP_HOST=0.0.0.0
-e MCP_LOG_FILE=/var/log/mcp/server.log
-v ~/mcp-logs:/var/log/mcp
scalr/mcp-server:latest
Replace your-account.scalr.io with your actual Scalr.io URL
Authentication:
Authentication for the MCP server can be added as a variable in the Docker command above or set up per request when adding the connection to your LLM client (See below).
- Clients provide a token via the Authorization: Bearer
<token>header (per-request in the LLM client) - Or set
SCALR_API_TOKENenvironment variable as global fallback - Per-request tokens take precedence over global tokens
Security:
- Configure CORS:
-e MCP_CORS_ORIGINS='[https://your-app.com](https://your-app.com) - Restrict hosts:
-e MCP_HTTP_ALLOWED_HOSTS='your-domain.com'
Example LLM Configurations
Cursor IDE (HTTP)
Open your MCP JSON file for Cursor and update it as seen below.
File location:
- Mac/Linux:
~/.cursor/config.json - Windows:
%APPDATA%\Cursor\config.json
{
"mcpServers": {
"scalr-local": {
"url": "http://localhost:8000/mcp",
"headers": {
"Authorization": "Bearer <your token>",
"Content-Type": "application/json"
}
}
}
}
#
Make sure to replace the url value with your actual URL and the "Bearer <your token>" with your token.
In Cursor, you can validate that the MCP server is running and execute a test prompt to make sure you are receiving answers back:
STDIO Configuration
The STDIO configuration runs as local subprocesses on the machine where it is configured.
Prerequisites
Regardless of the MCP client you are using, you will need to review the following prerequisites before using the MCP server.
- Docker installed and running on your machine. Docker must be running when starting the MCP server.
- Scalr API token (Personal Access Token or Service Account Token). Learn how to generate a token here. It is recommended to create a dedicated API token for the MCP server use with the minimum required permissions.
- MCP-compatible client (e.g., Claude Desktop)
Example LLM Configurations
Choose between Claude, Cursor, or VS Code depending on what you have installed locally:
The following section provides information specific to configuring the Claude desktop app and running the MCP server locally. To start, add the following configuration to your Claude Desktop config file:
- Open Claude Settings
- Navigate to "Developer"
- Click "Add MCP Server"
- Add the following to the config file.
{
"mcpServers": {
"scalr": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"--pull=always",
"--env",
"SCALR_API_TOKEN=your_api_token_here",
"--env",
"SCALR_API_URL=https://your-account.scalr.io",
"scalr/mcp-server:latest"
]
}
}
}You must replace the following values:
your_api_token_herewith your actual Scalr API tokenyour-account.scalr.iowith your Scalr instance URL (e.g.,mycompany.scalr.io)
Before restarting Claude, ensure that Docker is running on your machine. Once confirmed, close and reopen Claude Desktop to load the new configuration. Start with a simple question like "List all of my Scalr environments" to make sure that it is pulling the information back from the Scalr API:

Available MCP Tools
MCP tools give large language models (LLMs) the ability to perform actions by calling executable functions exposed by servers. The following tools are available for the Scalr MCP server.
Note: All endpoints marked with x-mcp-tool: true in the Scalr Public OpenAPI Specification are available as MCP tools.
| Category | Function | Description |
|---|---|---|
| Environments | list_environments | List all environments |
get_environment | Get details of a specific environment | |
| Workspaces | list_workspaces | List all workspaces (with filtering and pagination) |
get_workspace | Get details of a specific workspace | |
create_workspace | Create a new workspace | |
| Runs | list_runs | List Terraform/OpenTofu runs |
get_run | Get details of a specific run | |
| Policy Groups | list_policy_groups | List policy groups |
get_policy_group | Get details of a specific policy group | |
list_pull_request_policy_check_results | List policy check results for pull requests | |
| Modules | list_modules | List Terraform modules in the registry |
get_module | Get details of a specific module | |
| VCS Providers | list_vcs_providers | List VCS (Version Control System) providers |
get_vcs_provider | Get details of a specific VCS provider | |
| Token Usage | list_access_token_usage | View access token usage statistics |
| Modules Usage | list_module_usage_namespaces | List unique module namespaces |
list_terraform_module_sources | List unique Terraform module sources | |
list_terraform_module_usages | List module usage across workspaces | |
list_terraform_module_usage | Get detailed usage for a specific module | |
list_terraform_module_versions_usage | List module versions in use | |
| Provider Usage | list_terraform_provider_sources | List unique Terraform provider sources |
list_terraform_provider_usages | List provider usage across workspaces | |
list_terraform_provider_usage | Get detailed usage for a specific provider | |
list_terraform_provider_versions_usage | List provider versions in use | |
| Resource Usage | list_terraform_resource_providers | List unique resource provider types |
list_terraform_resource_usages | List Terraform resource usage | |
list_terraform_resource_instances_usage | List resource instances with details | |
| Version Usage | list_terraform_versions_usage_versions | List Terraform/OpenTofu versions in use |
| Billing Reports | list_billing_usage | Returns information from the billing report |
| IAM Usage | get_access_policy | Get details of a specific IAM access policy |
get_account | Get information about the current Scalr account | |
get_permission | Get details of a specific IAM permission | |
get_role | Get details of a specific IAM role and its permissions | |
get_service_account | Get details of a specific service account | |
get_team | Get details of a specific team | |
get_user | Get details of a specific user | |
get_workload_identity_provider | Get details of a specific workload identity provider | |
list_permissions | List all available IAM permissions | |
list_roles | List all IAM roles | |
list_security_rules | List account-level security rules and settings | |
list_service_accounts | List all service accounts | |
list_sso_bypass_users | List users allowed to bypass SSO | |
list_teams | List all teams | |
list_users | List all users | |
list_workload_identity_providers | List all configured workload identity providers |
Troubleshooting
Claude Desktop doesn't show Scalr tools
- Check configuration file syntax: Ensure your JSON is valid (use a JSON validator)
- Restart Claude Desktop: Completely quit and reopen the application
- Check Docker: Ensure Docker is running:
docker ps - View logs: Check Claude Desktop logs for errors:
- macOS:
~/Library/Logs/Claude/mcp-server-scalr.log - Windows:
%APPDATA%\Claude\Logs\mcp-server-scalr.log - Linux:
~/.config/Claude/logs/mcp-server-scalr.log
- macOS:
Authentication Errors
- Verify API token: Test your token with curl:
curl -H "Authorization: Bearer YOUR_TOKEN" \
https://your-account.scalr.io/api/iacp/v3/account- Check token permissions: Ensure the token has appropriate read/write permissions
Docker pull errors
If you see "pull access denied" or network errors:
# Manually pull the image to test connectivity
docker pull scalr/mcp-server:latest
# Check if image exists
docker images | grep scalr/mcp-serverTools not responding
- Check API connectivity: Ensure you can reach your Scalr instance
- Review rate limits: Check if you're hitting API rate limits
- Increase timeout: Docker might need more time on slower connections
Example Prompts
Here are some example questions you can ask Claude:
Discovery & Exploration
- "Show me all workspaces in the production environment."
- "Which Terraform modules are most used?"
- "What versions of Terraform are running across my infrastructure?"
Security
- "Review token usage in my account. Show tokens that don't have owners, have never been rotated, and don't have a description. Separate it into three outputs."
- "Suggest ways to tighten my Scalr account security"
- "Pull all users in my Scalr account that have an admin access policy."
- "How many tokens have not been rotated in the last 30 day?s"
Monitoring & Insights
- "Show me recent runs that failed."
- "What policy checks have failed recently?"
- "Show me usage statistics for AWS provider."
Management
- "Create a workspace named 'new-app-staging' in the dev environment"
- "Show me details about workspace ws-abc123"
- "List all VCS providers configured in my account"
Analytics
- "Which Terraform resources are most commonly used?"
- "Show me module usage by namespace"
- "What provider versions are in use?"
- "List all access tokens and their usage"
Support & Resources
- Scalr API Documentation: https://docs.scalr.io/reference/overview-1
- Model Context Protocol: https://modelcontextprotocol.io/
- Docker Hub: https://hub.docker.com/r/scalr/mcp-server
Demo
Updated 8 days ago
