Skip to main content
Glama
Darkstar326

MCP MySQL Server

by Darkstar326

mysql_disconnect

Terminate active MySQL database connections to manage resources and ensure security when database access is no longer required.

Instructions

Disconnect from the MySQL database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'mysql_disconnect' tool. It ends the MySQL connection pool if it exists, clears the config, and returns a success or no-connection message.
    private async handleDisconnect() { if (this.pool) { await this.pool.end(); this.pool = null; this.config = null; return { content: [ { type: "text", text: "Successfully disconnected from MySQL database", }, ], }; } else { return { content: [ { type: "text", text: "No active MySQL connection to disconnect", }, ], }; } }
  • The tool schema definition including name, description, and empty input schema for 'mysql_disconnect' in the ListTools response.
    { name: "mysql_disconnect", description: "Disconnect from the MySQL database", inputSchema: { type: "object", properties: {}, }, },
  • src/index.ts:263-264 (registration)
    The switch case registration that maps the 'mysql_disconnect' tool name to its handler function in the CallToolRequest handler.
    case "mysql_disconnect": return await this.handleDisconnect();

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/Darkstar326/mcp-mysql'

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