MySQL Database Access MCP Server logo

MySQL Database Access MCP Server

by dpflucas

This MCP server provides read-only access to MySQL databases, allowing you to list databases, tables, schemas, and execute read-only SQL queries. It is designed with security in mind, preventing data modification and SQL injection.

View on GitHub

Last updated: N/A

What is MySQL Database Access MCP Server?

The MySQL Database Access MCP Server is a tool that provides a secure, read-only interface to MySQL databases. It enables listing databases and tables, describing table schemas, and executing SELECT, SHOW, DESCRIBE, and EXPLAIN queries without the risk of data modification.

How to use MySQL Database Access MCP Server?

To use the server, install it via NPM or build from source. Configure environment variables for MySQL connection details. Add the server configuration to your MCP settings file. Then, use the available tools (list_databases, list_tables, describe_table, execute_query) with appropriate parameters as shown in the examples.

Key features of MySQL Database Access MCP Server

  • Read-only access

  • Query validation

  • Query timeout

  • Row limit

Use cases of MySQL Database Access MCP Server

  • Data analysis

  • Reporting

  • Schema discovery

  • Read-only data access for applications

FAQ from MySQL Database Access MCP Server

What types of SQL queries are allowed?

Only SELECT, SHOW, DESCRIBE, and EXPLAIN statements are allowed.

How do I prevent long-running queries?

The server has a query timeout feature to prevent long-running queries from consuming resources.

How do I install the server?

You can install it globally or locally using NPM, or build it from source.

What environment variables are required?

MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASSWORD, and optionally MYSQL_DATABASE.

How do I test the server?

The server includes test scripts that create a test database and verify the functionality of the MCP tools. Use the command npm test to run all tests.