Skip to main content
Glama
bpamiri

CockroachDB MCP Server

by bpamiri

disconnect

Terminate the active connection to the CockroachDB cluster to end database sessions and release resources.

Instructions

Disconnect from the CockroachDB cluster.

Returns: Disconnection status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'disconnect', registered with @mcp.tool() decorator. Delegates disconnection to the connection_manager.
    @mcp.tool() async def disconnect() -> dict[str, Any]: """Disconnect from the CockroachDB cluster. Returns: Disconnection status. """ return await connection_manager.disconnect()
  • Core implementation of disconnection logic in ConnectionManager class, closes the AsyncConnection and resets state.
    async def disconnect(self) -> dict[str, Any]: """Disconnect from CockroachDB cluster. Returns: Disconnection status. """ async with self._lock: if self._state.connection is None: return {"status": "not_connected"} try: await self._state.connection.close() except Exception: pass # Ignore errors on close database = self._state.database self._state = ConnectionState() return { "status": "disconnected", "database": database, }

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/bpamiri/cockroachdb-mcp'

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