Scalr MCP Server
Overview
Managing infrastructure through an API is powerful, but it requires knowing the right endpoints, structuring the right payloads, and writing the right scripts. For most requests, that means significant time spent before a single resource is touched.
The Scalr MCP Server removes that friction by connecting your AI assistant directly to the Scalr API. Instead of compiling API calls manually, you describe what you need in plain language, and the MCP server handles the translation. Requests that would have taken hours or days of scripting now take minutes.
The server runs remotely or locally as a containerized service and works with any MCP-compatible client. The documentation below includes configuration instructions for specific LLM clients like Claude Desktop and VSCode.
Remote MCP Server
The Scalr remote MCP server is the simplest way to get started. It requires no Docker, no local setup, and no infrastructure to maintain. Just enable it in your account settings and connect your AI client.
Enable the Integration
- Go to Account Settings → Integrations → AI Assistant
- Toggle on Enable Scalr MCP
Connect Your AI Client
Point your MCP client at https://scalr.io/mcp. Authentication is handled via OAuth 2.1, and the client will guide you through login and consent. Once connected, your AI agent has access to all Scalr tools scoped to your account and your user's permissions.
Claude Example
In Claude, go to Settings, Connectors, and click "Add custom connector". Add https://scalr.io/mcp as the URL for the MCP server. Click connect, and you will be redirected to Scalr to authenticate.
Cursor Example
In Cursor, go to settings, "Tools & MCP", click New MCP server. When the editor opens, add the following in the mcp.json:
{
"mcpServers": {
"scalr-remote": {
"url": "https://scalr.io/mcp",
"headers": {
"Content-Type": "application/json"
}
}
}
}Save the file, go back to settings, click connect, and you will be redirected to Scalr to authenticate.
Local MCP Server
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 | |
get_apply_log | Get the apply console output for a run | |
get_plan_log | Get the plan console output for a 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_access_policies | List all IAM access policies | |
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 | |
| Variables | list_variables | List variables |
create_variable | Create a variable in Scalr | |
get_variable | Get detailed info about a specific variable |
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 4 days ago
