mysql-mcp-server

v0.4.5
mysql-mcp-server Checked 12 hours ago Published 1 month ago

A Model Context Protocol (MCP) server that enables secure interaction with MySQL databases.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

execute_sql

Execute a SQL statement against the MySQL server. Use for SELECT, DML (INSERT/UPDATE/DELETE), SHOW, DESCRIBE, and ad-hoc queries. Supports cross-database queries using database.table notation. Single statements only — use fully qualified names instead of USE statements.

ParameterTypeDescription
query *stringThe SQL statement to execute. Single statements only.

get_schema_info

Get column metadata for a table or all tables in the configured database: column names, data types, nullability, default values, and comments. Call this before querying an unfamiliar table. Omit table_name to see all tables at once. Accepts bare table names (uses MYSQL_DATABASE) or database.table for cross-database lookups.

ParameterTypeDescription
table_namestringOptional: bare table name, or database.table for a cross-database lookup.

get_table_sample

Fetch a small sample of rows from a table to understand its data format and content. Use alongside get_schema_info before writing complex queries. Accepts bare table names (uses MYSQL_DATABASE) or database.table for cross-database lookups.

ParameterTypeDescription
table_name *stringTable to sample. Use database.table notation for cross-database queries.
limitintegerNumber of rows to return (default 5, max 20).