mcp-mysql-server

mcp-mysql-server

3.2

If you are the rightful owner of mcp-mysql-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

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. The server supports executing SQL queries, inspecting database schemas, and testing connections, all through a simple stdio interface. It is optimized for local deployment and can be configured securely through a configuration file.

Features

  • 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 and displaying columns and their data types.
  • Connection Testing: Test database connectivity and get server information.
  • Configurable Access Controls: Define connection parameters through configuration, allowing secure access to the database.

Tools

  1. test_connection

    Tests the connection to the database and returns server information.

  2. list_tables

    Lists all tables in the current database.

  3. read_table

    Reads and returns all data from a specified table.

  4. write_table

    Inserts a new row of data into a specified table.

  5. get_table_schema

    Returns the schema (column definitions) for a specified table.

  6. execute_sql

    Executes a custom SQL query and returns the results.