Skip to Content

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 CLI, PostgreSQL, or Snowflake Mode.

This server supports four operating modes:

  • CLI Mode – for getting started with CloudQuery CLI and generating configuration files using natural language
  • Platform Mode – for CloudQuery Platform customers
  • PostgreSQL Mode – for CLI users syncing to a PostgreSQL destination
  • Snowflake Mode – for CLI users syncing to a Snowflake destination (Requires MCP server >= 1.8.0)

Quick Start

Download the latest version of the MCP binary for your platform.

Unzip the binary and ensure it’s executable.

Requirements

CLI Mode

The default mode and available to all users.

Tools
ToolDescription
cli-list-source-pluginsList source integrations available on CloudQuery Hub (e.g. aws, gcp, azure, github).
cli-list-destination-pluginsList destination integrations (e.g. PostgreSQL, BigQuery, Snowflake, ClickHouse).
cli-get-plugin-docsGet documentation for a source or destination integration (name and kind required).
cli-list-source-tablesList all tables for a given source integration.
cli-get-cli-docsGet CloudQuery CLI documentation (e.g. login, sync).

Platform Mode

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

  • Your CloudQuery Platform API Key
  • Your deployment’s API URL
Tools
ToolDescription
list-installed-pluginsList integrations installed in the CloudQuery Platform deployment.
table-search-regexSearch for tables by regex; includes the unified cloud_assets table.
table-schemasGet column definitions, types, and JSON schemas for given tables.
column-searchSearch for columns by regex across all tables.
known-good-queriesList curated ClickHouse query examples (filter by name).
execute-clickhouse-sql-queryExecute a ClickHouse SQL query against the asset inventory.

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
Tools
ToolDescription
postgres-list-pluginsList integrations present in the database from synced CloudQuery data.
postgres-table-search-regexSearch for tables by regex (e.g. aws_ec2.*, .*storage.*).
postgres-table-schemasGet column definitions and types for given tables.
postgres-column-searchSearch for columns by regex across all tables.
execute-postgres-queryRun a PostgreSQL SQL query against the database.

The MCP server must be able to reach the PostgreSQL database from its host.

Snowflake Mode (Requires MCP server >= 1.8.0)

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

  • The Snowflake connection string in the format: user:password@account/database/schema?warehouse=warehouse_name
Tools
ToolDescription
snowflake-list-pluginsList integrations present in the database from synced CloudQuery data.
snowflake-table-search-regexSearch for tables by regex (e.g. aws_ec2.*, .*storage.*).
snowflake-table-schemasGet column definitions and types for given tables.
snowflake-column-searchSearch for columns by regex across all tables.
execute-snowflake-queryRun a Snowflake SQL query against the database.

The MCP server must be able to reach the Snowflake database from its host.


Environment Variables

CLI Mode

If no environment variables are set, the MCP server will default to CLI mode.

PostgreSQL Mode

Configure the following environment variables to enable PostgreSQL mode.

  • POSTGRES_CONNECTION_STRING - postgres://user:password@host:port/database

If no search_path is specified in the connection string, the MCP server automatically defaults to public schema. You can override this by explicitly setting search_path in your connection string (e.g., postgres://user:password@host:port/database?search_path=myschema).

The MCP server supports reading .env files.

Kerberos Authentication

For Kerberos/GSSAPI authentication, include the appropriate parameters in the connection string:

  • postgres://[email protected]@host:port/database?krbsrvname=postgres
  • postgres://username@host:port/database?krbsrvname=postgres&gsslib=gssapi

Snowflake Mode (Requires MCP server >= 1.8.0)

Configure the following environment variables to enable Snowflake mode.

  • SNOWFLAKE_CONNECTION_STRING - Snowflake connection string in the format: user:password@account/database/schema?warehouse=warehouse_name

Example connection strings:

  • user:password@account/database/schema - Basic authentication
  • user:password@account/database/schema?warehouse=COMPUTE_WH - With warehouse specified
  • user:[email protected]/database/schema?warehouse=COMPUTE_WH - With region

For more connection string options, see the Snowflake Go Driver documentation.

The MCP server supports reading .env files.

Platform Mode

Configure the following environment variables to enable Platform mode.

  • CQ_PLATFORM_API_URL - https://your-deployment.cloudquery.io/api
  • CQ_PLATFORM_API_KEY - Your CloudQuery Platform API key

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 configuration to:

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

CLI Mode

{ "mcpServers": { "cloudquery": { "command": "/absolute/path/to/cq-platform-mcp", "args": [], "env": {} } } }

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" } } } }

PostgreSQL Mode

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

Snowflake Mode (Requires MCP server >= 1.8.0)

{ "mcpServers": { "cloudquery": { "command": "/absolute/path/to/cq-platform-mcp", "args": [], "env": { "SNOWFLAKE_CONNECTION_STRING": "user:password@account/database/schema?warehouse=COMPUTE_WH" } } } }

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


Cursor IDE

  1. Open Cursor
  2. Go to SettingsCursor SettingsTools 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" } }

PostgreSQL Mode Example

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

Snowflake Mode Example (Requires MCP server >= 1.8.0)

{ "name": "cloudquery", "command": "/path/to/cq-platform-mcp", "args": [], "env": { "SNOWFLAKE_CONNECTION_STRING": "user:password@account/database/schema?warehouse=COMPUTE_WH" } }

VS Code IDE Integration

There are multiple ways to integrate MCP servers in VS Code, as described in the VS Code MCP documentation.

  1. Open VS Code IDE
  2. Go to MCP: Open User Configuration (can also be done at the workspace or folder level) via the keyboard shortcut Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (Mac)
  3. Add a new MCP server with the following configuration:

CLI Mode

{ "servers": { "CloudQuery": { "type": "stdio", "command": "/path/to/cq-platform-mcp", "env": {} } } }

Platform Mode

{ "inputs":[ { "type":"promptString", "id":"cloudquery-platform-api-key", "description":"CloudQuery Platform API Key", "password":true }, { "type":"promptString", "id":"cloudquery-platform-api-url", "description":"CloudQuery Platform API URL", "password":false } ], "servers":{ "CloudQuery":{ "type":"stdio", "command": "/path/to/cq-platform-mcp", "env":{ "CQ_PLATFORM_API_KEY": "${input:cloudquery-platform-api-key}", "CQ_PLATFORM_API_URL": "${input:cloudquery-platform-api-url}" } } } }

PostgreSQL Mode

{ "inputs":[ { "type":"promptString", "id":"cloudquery-postgres-connection-string", "description":"CloudQuery PostgreSQL Connection String", "password":true } ], "servers":{ "CloudQuery":{ "type":"stdio", "command": "/path/to/cq-platform-mcp", "env":{ "POSTGRES_CONNECTION_STRING": "${input:cloudquery-postgres-connection-string}" } } } }

Snowflake Mode (Requires MCP server >= 1.8.0)

{ "inputs":[ { "type":"promptString", "id":"cloudquery-snowflake-connection-string", "description":"CloudQuery Snowflake Connection String", "password":true } ], "servers":{ "CloudQuery":{ "type":"stdio", "command": "/path/to/cq-platform-mcp", "env":{ "SNOWFLAKE_CONNECTION_STRING": "${input:cloudquery-snowflake-connection-string}" } } } }

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.


Streamable HTTP Server

The MCP server can also be run as a Streamable HTTP server, which allows you to connect to it remotely. To enable this, set the HTTP_ADDRESS environment variable to the desired address and port, e.g.:

export HTTP_ADDRESS=":8080"

The server will then listen for incoming HTTP requests under the path /mcp on the specified address and port.

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.

Next Steps

  • AI Query Writer - Use the built-in AI query writer in the platform
  • SQL Console - Run queries directly in the platform
  • API Keys - Generate API keys for MCP server authentication
Last updated on