Skip to main content
Glama

clickhouse-mcp-server

connect_database

Establish a connection to a specified ClickHouse database for secure interactions and query execution, facilitating data access and management through the MCP server.

Instructions

Connect to a specific ClickHouse database

Input Schema

NameRequiredDescriptionDefault
databaseYes

Input Schema (JSON Schema)

{ "properties": { "database": { "title": "Database", "type": "string" } }, "required": [ "database" ], "title": "connect_databaseArguments", "type": "object" }

Implementation Reference

  • The connect_database tool handler: switches to the specified database by executing a USE query via the QueryExecutor, returns JSON-formatted result or error message.
    @mcp.tool() def connect_database(database: str, ctx: Context) -> str: """Connect to a specific ClickHouse database""" try: executor = _get_executor(ctx) result = executor.execute_single_query(f"USE {database}") return json.dumps(result, indent=2) except (ConnectionError, QueryError) as e: return str(e)

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/burakdirin/clickhouse-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server