CloudQuery MCP Server

The CloudQuery MCP (Model Context Protocol) Server lets you query your CloudQuery asset inventory using Claude Desktop, Cursor IDE, or any LLM tool that supports the MCP protocol.

If you're not a CloudQuery Platform customer but you are a CLI user, you can still use the CloudQuery MCP server in PostgreSQL Mode.

This server supports two operating modes:

  • Platform Mode – for CloudQuery Platform customers

  • PostgreSQL Mode – for CLI users syncing to a PostgreSQL destination


πŸš€ Quick Start

Download the latest version of the MCP binary for your platform: https://github.com/cloudquery/mcp-releases/releases/latest

Unzip the binary and ensure it's executable.

πŸ”§ Requirements

Platform Mode

This mode is for CloudQuery Platform customers. You’ll need:

  • Your CloudQuery Platform API Key

  • Your deployment’s API URL

PostgreSQL Mode

This mode is available to all CloudQuery CLI users who sync to a PostgreSQL destination. You'll need:

  • The Connection String or DSN to the PostgreSQL database

Note: The MCP server must be able to reach the Postgres database from where it is running.


βš™οΈ Environment Variables

Required

Use one of the following sets depending on the mode:

Platform Mode

  • CQ_PLATFORM_API_URL

  • CQ_PLATFORM_API_KEY

Postgres Mode

  • POSTGRES_CONNECTION_STRING

Optional

  • CQAPI_LOG_LEVEL: Log level (debug, info, warn, error, default: info)

  • LOG_PRETTY: Enable pretty console logging (auto-detected by default)

  • LOG_COLOR: Enable colored logging (auto-detected by default)

You can place these in a .env file or export them in your shell.


πŸ–₯️ IDE Integration

Claude Desktop

Add the following config to:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Linux: ~/.config/Claude/claude_desktop_config.json

Platform Mode

{
  "mcpServers": {
    "cloudquery": {
      "command": "/absolute/path/to/cq-platform-mcp",
      "args": [],
      "env": {
        "CQ_PLATFORM_API_KEY": "your_api_key",
        "CQ_PLATFORM_API_URL": "https://your-deployment.cloudquery.io/api"
      }
    }
  }
}

Postgres Mode

{
  "mcpServers": {
    "cloudquery": {
      "command": "/absolute/path/to/cq-platform-mcp",
      "args": [],
      "env": {
        "POSTGRES_CONNECTION_STRING": "postgres://user:pass@localhost:5432/db?sslmode=disable"
      }
    }
  }
}

The "command" must be an absolute path to the binary.


Cursor IDE

  1. Open Cursor

  2. Go to Settings β†’ Cursor Settings β†’ Tools and Integrations

  3. Add a new MCP server configuration:

Platform Mode Example

{
  "name": "cloudquery",
  "command": "/path/to/cq-platform-mcp",
  "args": [],
  "env": {
    "CQ_PLATFORM_API_KEY": "your_api_key",
    "CQ_PLATFORM_API_URL": "https://your-deployment.cloudquery.io/api"
  }
}

🍎 macOS Security Note

If macOS blocks the binary, use:

xattr -d com.apple.quarantine /absolute/path/to/cq-platform-mcp

Or allow it in System Preferences β†’ Security & Privacy β†’ General.


πŸ“š About MCP

MCP (Model Context Protocol) is a standard for tools like Claude Desktop to interact with external structured data sources. The CloudQuery MCP Server exposes your asset inventory to these tools.

Last updated

Was this helpful?