Skip to main content
Glama
bpamiri

CockroachDB MCP Server

by bpamiri

disconnect

Terminate the active connection to a 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'. Decorated with @mcp.tool(), registers the tool and executes by delegating to connection_manager.disconnect().
    @mcp.tool() async def disconnect() -> dict[str, Any]: """Disconnect from the CockroachDB cluster. Returns: Disconnection status. """ return await connection_manager.disconnect()
  • Core implementation of disconnect in ConnectionManager class. Closes the AsyncConnection and resets the connection 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