MCP MCP 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 MCP server?

MySQL Database Integration using Python script with configurable access controls and schema inspection, using stdio mode to suitable local deployment. That is what the mcp mcp server brings to an AI assistant: the same capability, reachable through the Model Context Protocol rather than a separate app or dashboard.

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

Getting it running

Setup follows the usual MCP pattern — install or clone the server, register it in your client's configuration file, restart the client.

The tools it exposes

The server publishes 10 tools. What each one is for:

  • test_connection — Tests the connection to the database and returns server information
  • list_tables — Lists all tables in the current database
  • read_table — Reads and returns all data from a specified table
  • write_table — Inserts a new row of data into a specified table
  • get_table_schema — Returns the schema (column definitions) for a specified table
  • execute_sql — Executes a custom SQL query and returns the results
  • Prerequisites — The Prerequisites tool exposed by this server
  • Installation — The Installation tool exposed by this server
  • Configuration — 1. Create a configuration file (e.g., config.ini) in the same directory as the script or specify the path when running the script. The configuration
  • Usage — Run the script with the following command, specifying the path to your configuration file:

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):

Things to watch

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 10 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch MCP.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

How it compares

Plenty of database access servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. MCP's toolset — test_connection, list_tables, read_table and 7 more — is a fair guide to whether it matches your workflow. It is maintained by tonycai; worth a glance at recent repository activity before you build anything load-bearing on it.

SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.

Available tools

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.
PrerequisitesThe Prerequisites tool exposed by this server.
InstallationThe Installation tool exposed by this server.
Configuration1. Create a configuration file (e.g., config.ini) in the same directory as the script or specify the path when running the script. The configuration file should have the following format:
UsageRun the script with the following command, specifying the path to your configuration file:

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).