Skip to main content
Glama
liliangshan

MCP MySQL Server

by liliangshan

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
READONLYNoIf set to 'true', only SELECT and SHOW commands are allowedfalse
ALLOW_DDLNoWhether to allow DDL operationsfalse
ALLOW_DROPNoWhether to allow DROP operationsfalse
MYSQL_HOSTYesMySQL host addresslocalhost
MYSQL_PORTYesMySQL port3306
MYSQL_USERYesMySQL usernameroot
MCP_LOG_DIRNoLog directory./.setting
TOOL_PREFIXNoOptional tool prefix for tool names and config isolation
ALLOW_DELETENoWhether to allow DELETE operationsfalse
MCP_LOG_FILENoLog filenamemcp-mysql.log
PROJECT_NAMENoOptional project branding for tool descriptions
MYSQL_DATABASEYesDatabase name
MYSQL_PASSWORDYesMySQL password
MCP_DDL_LOG_FILENoDDL SQL log filenameddl.sql

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
sql_queryC

Execute SQL query, supports DDL and DML operations

get_database_infoA

Get database information, including database list, table list and configuration information

get_operation_logsC

Get operation logs

check_permissionsA

Check database permissions for DDL, DROP, DELETE and other operations. Returns detailed permission status including readonly mode restrictions (only SELECT and SHOW allowed when readonly is enabled)

get_ddl_sql_logsC

Get DDL SQL operation logs

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

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

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