Back to GuidesDeveloper

Cloptima MCP Setup

8 min readUpdated August 2026

What You Get

Cloptima offers two ways to connect an MCP-compatible AI client to your LLM spend, AI gateway governance, cloud, and Kubernetes cost data: a hosted MCP endpoint you connect to directly with an access token, or a local MCP server embedded in the Cloptima CLI. Both expose the same 160+ tools, so your AI client can pull that intelligence into conversations, investigations, and engineering workflows either way.

Prerequisites

Create a Personal Access Token from Organization Settings > Access Tokens (or with cloptima tokens create). To use the local server, also install cloptima-cli.

Option 1: Hosted MCP Endpoint

Connect directly with any MCP client that supports the Streamable HTTP transport. Pass your Personal Access Token as a bearer token — nothing to install or run.

text
Endpoint: https://api.cloptima.ai/v1/mcp
Authorization: Bearer <your-personal-access-token>

Option 2: Local MCP Server (CLI)

Run the CLI's embedded MCP server for local, offline, or air-gapped use. Add --read-only when you want the server to reject mutating operations.

bash
cloptima mcp serve
cloptima mcp serve --read-only

Claude Desktop Example (Local Server)

Add an MCP server entry that launches cloptima and passes your access token via environment variables.

json
{
  "mcpServers": {
    "cloptima": {
      "command": "cloptima",
      "args": ["mcp", "serve"],
      "env": {
        "CLOPTIMA_ACCESS_TOKEN": "pat_..."
      }
    }
  }
}

Cursor Example (Local Server)

Use the same command/args pattern in Cursor's MCP settings.

json
{
  "mcpServers": {
    "cloptima": {
      "command": "cloptima",
      "args": ["mcp", "serve"],
      "env": {
        "CLOPTIMA_ACCESS_TOKEN": "pat_..."
      }
    }
  }
}

Cline Example (Local Server)

Configure Cline's MCP server entry with identical command wiring.

json
{
  "mcpServers": {
    "cloptima": {
      "command": "cloptima",
      "args": ["mcp", "serve"],
      "env": {
        "CLOPTIMA_ACCESS_TOKEN": "pat_..."
      }
    }
  }
}

How Clients Discover It

Your MCP client will automatically discover the available Cloptima capabilities after connecting, whether hosted or local. In practice, that means users can ask cost questions, investigate anomalies, review recommendations, explore Kubernetes cost context, and run recurring cost checks from the AI tool they already use.

Validation and Troubleshooting

For the hosted endpoint, confirm your access token is valid and has the scopes your queries need. For the local server, run cloptima version and cloptima accounts list in the same shell used by your AI client, and verify cloptima is available in PATH for the MCP client process and that your client supports stdio MCP transport.

Put This Guide Into Practice

Cloptima automates the strategies described in this guide.

No credit card required
5-minute setup
Free trial