Skip to main content
Glama
nilsir

MCP Server MySQL

by nilsir

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MYSQL_HOSTYesThe MySQL host addresslocalhost
MYSQL_PORTYesThe MySQL port number3306
MYSQL_USERYesThe MySQL usernameroot
MYSQL_DATABASENoThe MySQL database name (optional)
MYSQL_PASSWORDYesThe MySQL password
MYSQL_ALLOW_DELETENoSet to "false" to disable DELETE operationstrue
MYSQL_ALLOW_INSERTNoSet to "false" to disable INSERT operationstrue
MYSQL_ALLOW_UPDATENoSet to "false" to disable UPDATE operationstrue

Tools

Functions exposed to the LLM to take actions

NameDescription
connect

Connect to a MySQL database. If not called explicitly, will use environment variables for connection.

query

Execute a SELECT query and return results. Use this for reading data.

execute

Execute an INSERT, UPDATE, DELETE or other modifying query. Returns affected rows count.

list_databases

List all databases on the MySQL server

list_tables

List all tables in the current or specified database

describe_table

Get the structure/schema of a table

create_table

Create a new table with specified columns

alter_table

Modify an existing table structure

drop_table

Drop/delete a table

create_database

Create a new database

drop_database

Drop/delete a database

use_database

Switch to a different database

create_index

Create an index on a table

drop_index

Drop an index from a table

health_check

Check database connection health and get server status

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

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