Provides secure, read-only access to MySQL databases for exploring schemas and executing SELECT queries with built-in safeguards against SQL injection, query timeouts, and row limits.
Obtain your MySQL database connection details
- You will need the following information for your MySQL database:
- Host (the server address where MySQL is running, e.g.,
localhost
or an IP/domain)
- Port (the MySQL server port, usually 3306 unless changed)
- Username (a valid MySQL user with read access)
- Password (the password for the MySQL user)
- Default Database (the name of the default database to connect to — optional, but helpful)
(Optional) Prepare advanced connection settings
- If needed, also have values for:
MYSQL_CONNECTION_LIMIT
(number of allowed connections, default: 10)
MYSQL_QUEUE_LIMIT
(request queue length, default: 0/unlimited)
MYSQL_CONNECT_TIMEOUT
(timeout in ms, default: 10000)
MYSQL_IDLE_TIMEOUT
(idle time in ms, default: 60000)
MYSQL_MAX_IDLE
(max idle connections, default: 10)
- These are rarely needed unless instructed by your database administrator.
Go to the FastMCP connection interface
- Click the "Install Now" button for the MySQL connector/server.
Fill in the required ENV values in the FastMCP interface
- Enter the details you collected for each of the following fields:
MYSQL_HOST
MYSQL_PORT
MYSQL_USER
MYSQL_PASSWORD
(recommended, but can be left empty for unsecured/public setups or if using other authentication)
MYSQL_DATABASE
(can be left blank if not using a default database)
- If using any additional/advanced parameters (from Step 2), add them as well.
Save and connect
- Confirm and save your configuration in FastMCP.
Test the connection
- Use the MCP tools (such as
list_databases
or list_tables
) through FastMCP to verify access and correct setup.
Note: If you do not know your database credentials, contact your MySQL database administrator. The MCP server is read-only and will not modify your data.