MCP Server — tonycai/mcp-mysql-server

MySQL Database Integration using Python script with configurable access controls and schema inspection, using stdio mode to suitable local deployment.

Local serverstdioPython

What is the MCP Server?

MySQL Database Integration using Python script with configurable access controls and schema inspection, using stdio mode to suitable local deployment.

The short version

A simple Python script for interacting with a local MySQL database via standard input/output (stdio), based on FastMCP.

mcp-mysql-server provides a command-line interface for querying and inspecting the schema of a local MySQL database. It is designed for ease of use in local development environments where a lightweight, script-based interaction is preferred. The script utilizes standard input and output for commands and results, making it easy to integrate with other command-line tools and workflows.

  • Query Execution: — Execute SQL SELECT statements and view the results in a simple, readable format
  • Data Manipulation: — Insert data into tables with the write_table tool
  • Schema Inspection: — Retrieve information about the database schema, including:
  • Listing all tables with the list_tables tool
  • Displaying the columns and their data types for a specific table with get_table_schema
  • Connection Testing: — Test database connectivity and get server information

What it needs from you

  • Python 3.x installed on your system. * A local MySQL server instance running. * Required Python libraries (install using the requirements.txt file):

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
test_connectionTests the connection to the database and returns server information.
list_tablesLists all tables in the current database.
read_tableReads and returns all data from a specified table.
write_tableInserts a new row of data into a specified table.
get_table_schemaReturns the schema (column definitions) for a specified table.
execute_sqlExecutes a custom SQL query and returns the results.

Configuration

  • Python 3.x installed on your system. * A local MySQL server instance running. * Required Python libraries (install using the requirements.txt file):

Example prompts to try

  • “Use MCP to test connection.”
  • “Use MCP to list tables.”
  • “Use MCP to read table.”

Frequently asked questions

Create a `config.ini` file in the same directory (or specify its path with `--config`) containing `[mysql]` section with `host`, `user`, `password`, `database`, and optionally `port` (defaults to 3306).