MCP Server
Connect your AI assistant (Claude Desktop, VSCode Copilot, or any MCP-compatible client) to your Scalr account.
The Scalr MCP (Model Context Protocol) Server enables AI assistants to interact with your Scalr infrastructure through natural language. Ask questions, query resources, create workspaces, and manage your infrastructure—all through conversation.
Currently, the MCP server runs locally, where you create the Docker container, with data remaining within your environment.
In the example below, we'll configure Claude Desktop, but the MCP server will work with any LLM.

Prerequisites
The following prerequisites are required before using the MCP server.
- Docker installed and running on your machine.
- Scalr account with API access.
- Scalr API token (Personal Access Token or Service Account Token).
- MCP-compatible client (e.g., Claude Desktop)
Getting Started
Step 1: Get Your API Token
Create a Scalr API token:
- Go to your Scalr account settings
- Navigate to Personal access tokens

- Create a new token with appropriate permissions
- Copy the token value
Step 2: Configure Claude Desktop
Add the following configuration to your Claude Desktop config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
"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"
]
}
}
}
Important Replace the values listed with your values:
your_api_token_here
with your actual Scalr API tokenyour-account.scalr.io
with your Scalr instance URL (e.g.,mycompany.scalr.io
)
Step 3: Restart Claude Desktop
Before restarting Claude, ensure that Docker is running on your machine. Once confirmed, close and reopen Claude Desktop to load the new configuration.
Step 4: Start Using!
You can now ask Claude questions like:
- "List all my Scalr environments"
- "Show me workspaces in the production environment."
- "What runs are currently active?"
- "Create a new workspace named 'staging-app' in the dev environment"
- "Show me Terraform module usage across all workspaces."
Available Tools
The MCP server provides 26 tools organized by category.
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 |
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
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-server
Tools 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 Queries
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?"
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"
Security & Privacy
Data Privacy
When using this MCP server, all data remains completely local to your environment. The server operates within a Docker container on your machine, ensuring that your information never leaves your controlled infrastructure. The system makes direct API calls from your machine to your Scalr instance without routing through any third-party servers or intermediaries. For token security, API tokens are passed exclusively as environment variables and are never stored persistently, providing an additional layer of protection for your credentials.
Best Practices
To maintain optimal security when using the MCP server, you should create dedicated API tokens specifically for MCP server usage rather than reusing existing tokens. These tokens should be configured with only the minimum necessary permissions required for the intended operations, following the principle of least privilege. Regular token rotation is essential for maintaining security, so establish a schedule for replacing API tokens periodically. Additionally, you should actively monitor API token usage through the Scalr dashboard to detect any unusual activity or unauthorized access attempts.
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
Updated 1 day ago