Connect AI tools to Cast AI MCP
Connect your AI tools to Cast AI MCP to ask questions about your clusters, costs, efficiency, and health.
Use Cast AI MCP to ask questions about your clusters, costs, efficiency, and health from your preferred AI tool.
The connection provides read-only access to your Cast AI data. It cannot modify your clusters or configuration.
Before you start
You'll need:
- A Cast AI account.
- An AI tool that supports remote MCP connections over HTTP, with browser-based OAuth authentication or the ability to send a custom
Authorizationheader.
Setup also uses your Cast AI region. If you're not sure which one your organization uses, contact your Cast AI Account Manager.
| Region | MCP server URL | --api-region value |
|---|---|---|
| US | https://mcp.cast.ai/mcp | us |
| EU | https://mcp.eu.cast.ai/mcp | eu |
| India | https://mcp.india.cast.ai/mcp | india |
Which AI tools can I use?
Any MCP-compatible client can connect to Cast AI, for example:
- Coding assistants and terminal tools, such as Claude Code, Kimchi, Cursor, or Codex CLI.
- Desktop and web chat apps, such as Claude Desktop or ChatGPT (where custom connectors are available).
- Your own agents, built with frameworks or SDKs that support remote MCP servers. For these, authenticate with an API access key — see Option 3.
If your tool lets you add a remote MCP server by URL, it should work with Cast AI.
Option 1: Guided setup with castctl
castctlIf you already use castctl, the Cast AI CLI, this is the easiest way to connect a supported AI client.
-
Update
castctlto the latest version. -
Run the setup command in your terminal:
castctl mcp add-
Follow the prompts. The command detects supported AI clients and guides you through configuration.
-
Sign in when prompted to complete the browser login. When the prompt appears depends on your tool: some authenticate on first use, and others ask you to authenticate the connection from the tool's MCP settings.
Claude Desktop setup is manual
castctl mcp adddetects Claude Desktop but does not configure it automatically. It links to Claude's guide for adding a custom connector instead: follow that guide and use the MCP server URL for your region from the table above. On some workspaces, adding a custom connector requires an organization owner, who can add it for your team.
To select a region, use the --api-region value for your region from the table above.
Option 2: Manual setup
Use this option if you don't have castctl or prefer to configure the connection yourself.
-
Open your AI tool's settings for adding an MCP server or connector.
-
Give the connection a recognizable name, such as Cast AI.
-
Choose HTTP as the transport type, if your tool asks for it.
-
Enter the MCP server URL for your Cast AI region from the table above.
-
Save the connection and complete the browser sign-in flow when prompted.
-
Enable the Cast AI connection in your conversation if your AI tool requires it.
The exact names of settings and buttons vary between AI tools.
Option 3: Connect with an API access key
Use this option for headless agents, CI pipelines, and integrations that can't complete a browser sign-in. Instead of OAuth, you authenticate with a Cast AI API access key sent as a bearer token.
Create an API access key
-
In the Cast AI console, click your user menu (top-right) and select API keys.
-
Click Create access key.
-
Name the key and select the organization to scope it to. The key inherits the permissions from your role bindings within that organization.
-
Copy the key immediately. It is shown only once.
For screenshots and more details, see API access.
For machine-to-machine access, consider a service account API keyAs an alternative, you can create a service account and generate an API key for it. The key then belongs to the service account instead of an individual user: its access follows the service account's role bindings and user groups, so it works independently of any person's account — an even better fit for machine-to-machine integrations.
Connect your tool
Use the MCP server URL for your region from the table above. Send the key as a standard bearer token in the Authorization header. There is no separate header scheme and no URL parameter.
Most MCP clients accept a headers map for remote HTTP servers:
{
"mcpServers": {
"castai": {
"url": "https://mcp.cast.ai/mcp",
"headers": {
"Authorization": "Bearer your-api-access-key"
}
}
}
}For EU or India, substitute the regional MCP server URL from the table above.
Treat the key like a passwordThe key carries the permissions of your role bindings within the selected organization, and you can't view it again after creation. Prefer a key scoped to a single organization for shared or automated integrations, and store it in a secrets manager or environment variable rather than committing it to repositories.
Verify the connection with curl
An MCP initialize request against the endpoint should return HTTP 200 with a session:
curl -i https://mcp.cast.ai/mcp \
-H "Authorization: Bearer your-api-access-key" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"smoke-test","version":"1.0"}}}'200— the key was accepted; proceed with tool calls.401— the key is missing, mistyped, revoked, or expired. See Troubleshooting.403— the key is valid, but its role bindings don't cover the listing endpoint. Tool-level authorization still applies to each call.
Check that the connection works
Start a conversation with the Cast AI connection enabled and ask:
Use Cast AI to list the clusters I can access and show their current state.
If your AI tool asks for permission to use Cast AI tools, review and approve the request. A working connection returns a list of your actual clusters. If you recognize them, your tool is connected and has access to your Cast AI data.
If you connected with an API access key, no browser sign-in is needed. A 403 on a tool call means the key is valid but its organization scope or role bindings don't cover that operation.
Try it on a real task
Once connected, try a question from your day-to-day work:
- "Which of my clusters are driving the most cost?"
- "Where are the rightsizing opportunities?"
- "Help me understand the health of this cluster."
Name the cluster and time period where relevant. You can ask follow-up questions to explore the results.
In clients that support the command, try /mcp prompts to explore available prompts. For example:
castai:
/mcp__castai__cluster-health [cluster]
One-page health summary for a cluster.
/mcp__castai__commitment-coverage [window]
Report commitment and discount coverage against actual usage.
/mcp__castai__cost-spike [cluster] [since]
Find what drove a cost increase for a cluster over a time window.
/mcp__castai__rightsizing-review [cluster]
Summarize workload rightsizing opportunities by potential saving.Troubleshooting
If you can't connect, work through the following checks:
- Region: the server URL or
--api-regionvalue matches your Cast AI region. If you sign in but don't see your clusters, check the region first. - Sign-in: the browser sign-in completed and you approved the connection. If no browser window appeared, the pop-up was likely blocked: retry the connection and allow pop-ups for your tool.
- Connection enabled: the Cast AI connection is enabled in your tool, and in the conversation if your tool requires it.
- Tool permissions: if your tool asks for permission to use Cast AI tools, review and approve the request.
- API key rejected (401): the key is revoked, expired, or mistyped, for example pasted with trailing whitespace. Re-copy the key or create a new one if you lost it.
- Connected with an API key, but tool calls return permission errors (403): the key is valid, but its organization scope or role bindings don't cover the operation. Adjust the key's organization or permissions in the console.
- Browser sign-in starts even though you use an API key: your tool didn't send the
Authorizationheader. Some tools drop custom headers on redirects. Check that the header is configured for the HTTP transport, or complete OAuth as before. - Restart: if you configured the connection in a configuration file, fully quit and relaunch your tool. Most tools do not reload MCP configuration without a restart.
For connection errors, check the MCP or connector logs in your tool. In Cursor and Windsurf, open the Output panel and select MCP. Claude Desktop writes MCP logs to ~/Library/Logs/Claude/. If the connection still fails, contact your Cast AI Account Manager.
Next steps
Updated 9 days ago
