MCP-MySQL Server

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
DB_HOSTNoMySQL database hostlocalhost
DB_USERNoMySQL database user
DB_DATABASENoMySQL database name
DB_PASSWORDNoMySQL database password
DATABASE_URLNoMySQL database connection URL in the format mysql://user:password@host:3306/database

Schema

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Tools

Functions exposed to the LLM to take actions

NameDescription
connect_db

Connect to MySQL database using URL or config

query

Execute a SELECT query

execute

Execute an INSERT, UPDATE, or DELETE query

list_tables

List all tables in the database

describe_table

Get table structure

create_table

Create a new table in the database

add_column

Add a new column to existing table