Skip to main content
Glama
MCP-MySQL-Ops

MCP-MySQL-Ops

by call518

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MYSQL_HOSTYesMySQL server hostname or IP address. Required by the MCPB installer; the server default is localhost.
MYSQL_PORTNoMySQL server port number.3306
MYSQL_USERNoMySQL connection username.root
PYTHONPATHNoPython module search path for MCP server imports, used for local module execution.
FASTMCP_HOSTNoHTTP server bind address for streamable-http transport.127.0.0.1
FASTMCP_PORTNoHTTP server port for MCP communication.8000
FASTMCP_TYPENoMCP transport protocol: stdio or streamable-http.stdio
MCP_LOG_LEVELNoServer logging verbosity: DEBUG, INFO, WARNING, or ERROR.INFO
MYSQL_DATABASENoDefault target MySQL database when no specific database is specified.mysql
MYSQL_PASSWORDYesMySQL user password. Required by the MCPB installer; may be empty in some deployments.
REMOTE_SECRET_KEYNoSecret key for Bearer token authentication. Required when REMOTE_AUTH_ENABLE is true.
REMOTE_AUTH_ENABLENoEnable Bearer token authentication for streamable-http mode. Accepts true/false, 1/0, yes/no, on/off.false

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

MCP-MySQL-Ops inspects one MySQL server (5.7.9+ or 8.0+) through read-only SQL queries: server status and configuration, connections and sessions, users and privileges, databases, schemas, table and index sizes, slow queries, table I/O, and locks.

Scope and access

  • Every tool call runs a real query against the configured MySQL server with the configured MySQL user. Use the tools for facts; never guess, simulate, or invent results.

  • The server is read-only. It cannot change data, schemas, users, settings, or sessions. If the user asks for a change, say this server cannot do it; you may suggest the SQL for the user to review and run.

  • database_name selects the database for a call. When omitted, a tool uses the connection's default database or, for some tools, all databases. State which scope the answer covers.

  • Results depend on the MySQL user's privileges. Missing rows or access errors can mean missing privileges, not missing objects; say so.

Reporting results

  • Report what the tool returned. Never claim success or draw conclusions after an error, an empty result, or a partial result; quote the error.

  • Performance Schema tools (slow queries, table I/O, locks) need performance_schema=ON. If a tool says it is disabled or unavailable, report that; do not substitute guesses.

  • Never ask for the MySQL password in chat; connection settings come from the server environment, and connection info hides the password.

Missing input

  • If a required value is missing or ambiguous (for example, which table, or which of several databases), ask instead of picking one.

Numbers

  • Table rows and data/index sizes come from information_schema and are estimates for InnoDB, not exact counts or on-disk file sizes.

  • Performance Schema counters (statement digests, table I/O, wait times) are cumulative since server start or the last reset, not current rates. Status counters in get_server_status are also cumulative unless they are gauges such as Threads_connected.

  • Label each number as estimated, cumulative, current, or configured. Never present a configured limit as measured usage. If a value is not collected, say "not collected"; never estimate it.

Large results

  • Size, index, slow-query, and I/O tools return the top N rows (limit, default 20). Say when a result may be truncated, and raise limit or narrow by database_name only when the user needs more.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}
logging
{}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
extensions
{
  "io.modelcontextprotocol/ui": {}
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
get_server_infoA

[Tool Purpose]: Get MySQL server version and basic information

[Exact Functionality]:

  • Show MySQL server version, edition, and compilation info

  • Display server uptime and basic configuration

  • Show available storage engines and default engine

  • Provide server connection details (sanitized)

[Required Use Cases]:

  • When user requests "server info", "MySQL version", "server status"

  • When diagnosing compatibility issues

  • When checking server capabilities

get_active_connectionsA

[Tool Purpose]: Monitor active MySQL connections and processes

[Exact Functionality]:

  • List all active connections with process ID, user, host, database

  • Show current command being executed by each connection

  • Display connection time and state information

  • Filter by user or database name

[Required Use Cases]:

  • When user requests "active connections", "current sessions", "process list"

  • When diagnosing connection issues or monitoring user activity

  • When checking for long-running queries

get_database_listA

[Tool Purpose]: List all databases in MySQL server

[Exact Functionality]:

  • Show all databases with names and character sets

  • Display database size information if available

  • Show collation and default character set

[Required Use Cases]:

  • When user requests "database list", "show databases", "available databases"

  • When exploring server structure

get_table_listA

[Tool Purpose]: List all tables in specified database or all databases

[Exact Functionality]:

  • If database_name provided: Show tables in that specific database

  • If database_name empty: Show tables from all user databases with database names

  • Display table type (BASE TABLE, VIEW), engine, rows count, and size information

  • Show creation and update timestamps

  • Filter by table type if specified

[Required Use Cases]:

  • When user requests "table list", "show tables", "database tables"

  • When exploring database structure

get_table_schema_infoA

[Tool Purpose]: Get detailed schema information for a specific table or entire database

[Exact Functionality]:

  • If table_name provided: Show all columns, indexes, foreign keys for that table

  • If table_name empty: Show overview of all tables in the database

  • Display table statistics, constraints, and engine information

  • Include column comments and default values

[Required Use Cases]:

  • When user requests "table schema", "table structure", "describe table"

  • When analyzing table design and constraints

  • When requesting database-wide schema analysis with empty table_name

get_mysql_configA

[Tool Purpose]: Get MySQL server configuration variables

[Exact Functionality]:

  • Show server configuration variables and their values

  • Filter by search term if provided

  • Display both global and session variables

  • Show variable descriptions where available

[Required Use Cases]:

  • When user requests "MySQL config", "server variables", "configuration"

  • When diagnosing configuration issues

  • When checking specific settings

get_user_listA

[Tool Purpose]: List all MySQL users and their privileges

[Exact Functionality]:

  • Show all MySQL users with their host patterns

  • Display account status and authentication info

  • Show password expiration and locking status

  • Include SSL and resource limit information

[Required Use Cases]:

  • When user requests "user list", "MySQL users", "account info"

  • When managing user access and security

  • When auditing user accounts

get_server_statusA

[Tool Purpose]: Get MySQL server status variables and performance counters

[Exact Functionality]:

  • Show server status variables with current values

  • Display performance counters and operational metrics

  • Filter by search term if provided

  • Include connection, query, and resource statistics

[Required Use Cases]:

  • When user requests "server status", "MySQL status", "performance metrics"

  • When monitoring server health and performance

  • When diagnosing operational issues

get_table_size_infoA

[Tool Purpose]: Get table size information and storage analysis

[Exact Functionality]:

  • Show table sizes with data and index breakdown

  • Display size ratios and storage efficiency

  • Order by total size (largest first)

  • Include row counts and average row sizes

[Required Use Cases]:

  • When user requests "table sizes", "largest tables", "storage analysis"

  • When planning database optimization

  • When monitoring storage usage

get_database_size_infoA

[Tool Purpose]: Get database size information and storage distribution

[Exact Functionality]:

  • Show database sizes with table counts

  • Display total, data, and index size breakdown

  • Compare databases by storage usage

  • Include average table sizes

[Required Use Cases]:

  • When user requests "database sizes", "storage usage", "database capacity"

  • When planning database resources

  • When monitoring growth trends

get_index_usage_statsA

[Tool Purpose]: Get index usage statistics and efficiency analysis

[Exact Functionality]:

  • Show index information with cardinality and selectivity

  • Display index types and usage patterns

  • Identify potentially unused or inefficient indexes

  • Order by cardinality and selectivity metrics

[Required Use Cases]:

  • When user requests "index stats", "index analysis", "index optimization"

  • When optimizing query performance

  • When identifying redundant indexes

get_connection_infoA

[Tool Purpose]: Get current connection and process information

[Exact Functionality]:

  • Show active connections with detailed process information

  • Display connection duration, state, and current operations

  • Include user, host, and database context for each connection

  • Filter out system processes for clarity

[Required Use Cases]:

  • When user requests "connection info", "active processes", "session details"

  • When monitoring database activity and user sessions

  • When diagnosing connection issues

get_slow_queriesA

[Tool Purpose]: Get slow queries from Performance Schema

[Exact Functionality]:

  • Show slowest queries with execution statistics

  • Display query text, execution count, and timing information

  • Show rows examined and returned

  • Order by total execution time

[Required Use Cases]:

  • When user requests "slow queries", "performance analysis", "query optimization"

  • When diagnosing performance issues

  • When identifying problematic queries

get_table_io_statsA

[Tool Purpose]: Get table I/O statistics from Performance Schema

[Exact Functionality]:

  • Show I/O statistics for tables including reads, writes, and timing

  • Display fetch, insert, update, delete operations

  • Order by total I/O time

  • Show both request counts and timing information

[Required Use Cases]:

  • When user requests "table I/O", "table performance", "I/O statistics"

  • When analyzing table access patterns

  • When identifying heavily used tables

get_lock_monitoringA

[Tool Purpose]: Monitor current locks in MySQL

[Exact Functionality]:

  • Show current lock information from Performance Schema

  • Display lock types, modes, and status

  • Show which sessions are holding or waiting for locks

  • Include query information for lock holders

[Required Use Cases]:

  • When user requests "lock monitoring", "deadlock check", "blocked sessions"

  • When diagnosing locking issues

  • When checking for lock contention

get_current_database_infoA

[Tool Purpose]: Get information about the currently connected or specified database

[Exact Functionality]:

  • Show database name, character set, and collation

  • Display database size and table count

  • Show creation time if available

  • Include storage engine distribution

[Required Use Cases]:

  • When user requests "current database", "database info", "database details"

  • When getting context about the working database

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A3.7/5.0

Scored across 16 tools

Disambiguation3/5

Most tools have distinct monitoring purposes, but get_active_connections and get_connection_info are nearly identical in scope, and get_table_list/get_table_schema_info plus get_database_list/get_current_database_info overlap at their boundaries. The descriptions help somewhat, but the duplicate connection tooling creates real selection ambiguity.

Naming Consistency5/5

All 16 tools consistently use the get_ prefix followed by a descriptive noun phrase. There are no mixed naming conventions or vague verbs.

Tool Count4/5

Sixteen tools is slightly above the ideal 3-15 range, but the breadth of MySQL monitoring areas justifies most of them. The set is broad without feeling excessive.

Completeness4/5

The read-only diagnostic surface covers server info, connections, databases, tables, schemas, users, sizes, indexes, slow queries, I/O, and locks comprehensively. Gaps remain around replication status and operational actions such as killing queries or executing SQL, but core monitoring workflows are well covered.

Maintenance

ActivityActive
ResponsivenessNo recent community issues