Skip to main content
Glama
kamrul-dev

Local MySQL MCP Server

by kamrul-dev

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
LOG_LEVELNoLogging level (debug, info, warn, error).info
MYSQL_HOSTNoThe MySQL host. The server refuses to start against non-loopback hosts unless ALLOW_REMOTE_MYSQL=1.127.0.0.1
MYSQL_PORTNoThe MySQL port.3306
MYSQL_USERYesThe MySQL user account. To follow least privilege, use the dedicated read-only 'mcp_readonly' user created by scripts/setup-mysql-user.sql.
MCP_MAX_ROWSNoMaximum number of rows returned by get_rows.1000
MCP_AUDIT_LOGNoPath to a JSONL audit log file. If empty, audit events go to stderr.
MYSQL_DATABASEYesThe name of the database to connect to. This must match an entry in MCP_ALLOWED_SCHEMAS.
MYSQL_PASSWORDYesThe password for MYSQL_USER. For the read-only user, set it in the SQL script and then in .env.
ALLOW_REMOTE_MYSQLNoSet to '1' to allow connecting to a non-loopback MySQL host. The server still requires a non-empty MYSQL_PASSWORD.0
MCP_ALLOWED_TABLESNoOptional comma-separated allowlist of tables. If empty, all tables in the allowed schemas are visible.
MCP_ALLOWED_SCHEMASYesComma-separated list of schemas the server is allowed to access. Wildcards are only allowed if ALLOW_WILDCARD_SCHEMAS=1.
ALLOW_WILDCARD_SCHEMASNoSet to '1' to allow wildcard entries in MCP_ALLOWED_SCHEMAS. Off by default for safety.0
MYSQL_CONNECTION_LIMITNoMaximum number of simultaneous MySQL connections in the pool.5
MYSQL_QUERY_TIMEOUT_MSNoQuery timeout in milliseconds. Queries exceeding this are aborted.3000
MYSQL_CONNECT_TIMEOUT_MSNoMySQL connection timeout in milliseconds.5000

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
list_tablesA

List tables in allowlisted MySQL schemas. Returns table metadata (schema, name, type). Always read-only. No raw SQL.

describe_tableA

Describe a single allowlisted MySQL table: columns, types, nullability, and key metadata. Sensitive columns may be redacted. Read-only.

get_rowsA

Read rows from a single allowlisted MySQL table. Requires an explicit column list, supports equality/IN/range filters and pagination. Read-only. Sensitive columns are masked. Cap is MCP_MAX_ROWS.

health_checkA

Report server/database reachability. Returns ok=true and a latencyMs value when the configured MySQL is reachable. Does NOT expose host, user, password, or version.

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/kamrul-dev/local-mysql-mcp-server'

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