M

MySQL Query

Provides a secure, read-only bridge to MySQL databases, enabling natural language querying across mu...

112 views
0 installs
Updated Sep 9, 2025
Not audited
Provides a secure, read-only bridge to MySQL databases, enabling natural language querying across multiple environments with strict validation and comprehensive error handling.
  1. Gather Your MySQL Database Credentials

    • For each environment (local, development, staging, production) you want to connect, you will need the following:
      • Host (e.g., localhost, dev.example.com)
      • User (database username for the environment)
      • Password (database user password)
      • Database Name (the database you want to query)
      • (Optional) Port (default is 3306)
      • (Optional) SSL and certificate-related settings, if your DB requires secure connections
  2. Access Your Database Provider or Server for Credentials

    • If you're self-hosting MySQL: Log in to your server or hosting control panel to retrieve or set up usernames and passwords.
    • If using a managed service (e.g. AWS RDS, Azure Database, PlanetScale, Vercel, DigitalOcean):
      • Log in to the respective service dashboard.
      • Go to the database instance and find the "Connection Details" or similar section to get host, user, password, and database name.
      • For most providers, you can create new users and passwords if needed.
  3. Ensure User Has Read-Only Permissions (Recommended)

    • For security, use a user account limited to SELECT, SHOW, and DESCRIBE privileges.
    • In MySQL, you can create a read-only user with a command similar to:
      CREATE USER 'readonly_user'@'%' IDENTIFIED BY 'your_password';
      GRANT SELECT, SHOW VIEW ON your_database.* TO 'readonly_user'@'%';
      FLUSH PRIVILEGES;
      
    • Replace 'readonly_user', 'your_password', and your_database appropriately.
  4. Copy Values Into FastMCP Connection Interface

    • Open your FastMCP environment.
    • Click the “Install Now” (or equivalent) button for MySQL Query MCP.
    • In the FastMCP connection interface, fill in the required values for each environment you wish to enable:
      • LOCAL_DB_HOST, LOCAL_DB_USER, LOCAL_DB_PASS, LOCAL_DB_NAME, LOCAL_DB_PORT (default 3306)
      • DEVELOPMENT_DB_HOST, DEVELOPMENT_DB_USER, etc. (if using dev)
      • STAGING_DB_HOST, STAGING_DB_USER, etc. (if using staging)
      • PRODUCTION_DB_HOST, PRODUCTION_DB_USER, etc. (if using production)
    • Optional: Set DEBUG to true if you need extra logging.
    • Optional: Set MCP_MYSQL_SSL to true if you’re connecting to a database that requires SSL.
    • Optional: Set MCP_MYSQL_REJECT_UNAUTHORIZED to false if you encounter certificate errors (not recommended for production).
  5. Save and Test the Connection

    • Save the configuration.
    • Use the query tool or environment info features from your AI assistant to confirm connectivity and access.

Notes:

  • Do not abbreviate environment values (must use LOCAL_, DEVELOPMENT_, etc.).
  • For sensitive/production environments, manage credentials securely and rotate if compromised.
  • Only read-only operations are supported.

Quick Start

View on GitHub

More for Database

View All →

Similar MCP Servers

Report Issue

Thank you! Your issue report has been submitted successfully.