Skip to main content
Not all users interact with ClickHouse through the Cloud console. For example, many developers work directly from their preferred code editors, CLI agents, or connect to the database via custom setups, while others rely on general-purpose AI assistants such as Anthropic Claude for most of their explorations. These users and the agentic workloads acting on their behalf need a way to securely access and query ClickHouse Cloud without complex setups or custom infrastructure. The remote MCP server capability in ClickHouse Cloud addresses this by exposing a standard interface that external agents can use to retrieve analytical context. MCP, or Model Context Protocol, is a standard for structured data access by AI applications powered by LLMs. With this integration, external agents can list databases and tables, inspect schemas, and run scoped, read-only SELECT queries. Authentication is handled via OAuth 2.0 or a ClickHouse Cloud API key. The server is fully managed on ClickHouse Cloud, so no setup or maintenance is required. This makes it easier for agentic tools to plug into ClickHouse and retrieve the data they need, whether for analysis, summarization, code generation, or exploration.

Remote MCP server vs open-source MCP server

ClickHouse offers two MCP servers. The remote MCP server provides the richest integration with ClickHouse Cloud, including service management, backup monitoring, ClickPipe visibility, and billing data, with no infrastructure to manage. For self-hosted ClickHouse instances, see the open-source MCP server guides.

Enabling the remote MCP server

The remote MCP server must be enabled per service before it can accept connections. In the ClickHouse Cloud console, open your service, click the Connect button, select MCP, and enable it. For ClickHouse services, enabling or disabling the remote MCP server requires the control-plane:service:manage-mcp permission (see Console roles and permissions). For Managed Postgres services, open the service’s Connect panel and turn on Enable Model Context Protocol. Read replicas inherit the parent database’s MCP setting. For detailed steps with screenshots, see the setup guide.

Endpoint

Once enabled, the remote MCP server is available at:

Authentication

The remote MCP server supports two authentication methods:
  • OAuth 2.0: Recommended for interactive clients. When an MCP client connects for the first time, it opens a browser window for the user to sign in with their ClickHouse Cloud credentials. Access is scoped to the organizations and services the authenticated user has permission to access.
  • ClickHouse Cloud API key: Intended for remote, headless, and automated environments where a browser-based OAuth flow is not practical. Send the API key ID and secret using HTTP Basic authentication:
API-key access is scoped by the roles, permissions, and expiration configured for the key. Use a dedicated, least-privilege key and inject it through a secret-management system. Base64 encoding does not encrypt the credentials, so do not commit the encoded value to source control or expose it in logs. For an example of configuring an MCP client in a headless environment, see Authenticate from a headless environment.

Safety

All tools exposed by the remote MCP server are read-only. Each tool is annotated with readOnlyHint: true in its MCP metadata. No tool can modify data, alter service configuration, or perform any destructive operation.

Available tools

The remote MCP server provides tools in the following categories. Tool availability depends on the authentication method and enabled features.

Query and schema exploration

These tools allow agents to discover what data is available and run analytical queries.

Managed Postgres

These tools query and monitor Managed Postgres services. Use get_organizations to find the organizationId, then get_services_list to find a service whose serviceType is postgres and use its id as serviceId. For fromDate and toDate, use UTC timestamps with millisecond precision, such as 2026-11-03T00:00:00.000Z. The start is inclusive. The end is inclusive at minute granularity for slow query patterns and exclusive for metrics. To inspect a slow query pattern, pass its queryId, dbName, dbUser, dbOperation, and app from list_postgres_slow_query_patterns to get_postgres_slow_query_pattern_details. Preserve an empty app string for queries without an application_name; omitting app includes all applications.

Organizations

Services

Backups

ClickPipes

Billing

Getting started

See the setup guide for step-by-step instructions on enabling the remote MCP server and connecting it to an MCP client.