Scalr MCP Server

Overview

The Scalr MCP (Model Context Protocol) Server enables AI assistants to interact with the Scalr API 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 and makes direct API calls to your Scalr account.

In the example below, we'll configure ClaudeDesktop, Cursor client, or VS Code, but the MCP server will work with any MCP-compatible client.

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:

  1. Open Claude Settings
  2. Navigate to "Developer"
  3. Click "Add MCP Server"
  4. 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_here with your actual Scalr API token
  • your-account.scalr.io with 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.

CategoryFunctionDescription
Environmentslist_environmentsList all environments
get_environmentGet details of a specific environment
Workspaceslist_workspacesList all workspaces (with filtering and pagination)
get_workspaceGet details of a specific workspace
create_workspaceCreate a new workspace
Runslist_runsList Terraform/OpenTofu runs
get_runGet details of a specific run
Policy Groupslist_policy_groupsList policy groups
get_policy_groupGet details of a specific policy group
list_pull_request_policy_check_resultsList policy check results for pull requests
Moduleslist_modulesList Terraform modules in the registry
get_moduleGet details of a specific module
VCS Providerslist_vcs_providersList VCS (Version Control System) providers
get_vcs_providerGet details of a specific VCS provider
Token Usagelist_access_token_usageView access token usage statistics
Modules Usagelist_module_usage_namespacesList unique module namespaces
list_terraform_module_sourcesList unique Terraform module sources
list_terraform_module_usagesList module usage across workspaces
list_terraform_module_usageGet detailed usage for a specific module
list_terraform_module_versions_usageList module versions in use
Provider Usagelist_terraform_provider_sourcesList unique Terraform provider sources
list_terraform_provider_usagesList provider usage across workspaces
list_terraform_provider_usageGet detailed usage for a specific provider
list_terraform_provider_versions_usageList provider versions in use
Resource Usagelist_terraform_resource_providersList unique resource provider types
list_terraform_resource_usagesList Terraform resource usage
list_terraform_resource_instances_usageList resource instances with details
Version Usagelist_terraform_versions_usage_versionsList Terraform/OpenTofu versions in use
Billing Reportslist_billing_usageReturns information from the billing report

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 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"
  • "How many tokens have not been rotated in the last 30 days"

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