mysqldb-mcp-server logo

mysqldb-mcp-server

by burakdirin

A MySQL database MCP server project. It allows you to connect to and execute queries on a MySQL database.

View on GitHub

Last updated: N/A

What is mysqldb-mcp-server?

The mysqldb-mcp-server is an MCP (Model Context Protocol) server that enables interaction with a MySQL database. It provides tools to connect to a database and execute SQL queries, returning results in JSON format.

How to use mysqldb-mcp-server?

  1. Install the server using uv pip install mysqldb-mcp-server or pip install mysqldb-mcp-server. 2. Configure the server by setting environment variables such as MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE, and MYSQL_READONLY. 3. Integrate the server into your application or use it with tools like Claude Desktop by configuring the claude_desktop_config.json file. 4. Use the provided tools (connect_database and execute_query) to interact with the database.

Key features of mysqldb-mcp-server

  • Connects to MySQL databases

  • Executes SQL queries

  • Returns query results in JSON format

  • Supports multiple queries separated by semicolons

  • Configurable via environment variables

  • Supports read-only mode

Use cases of mysqldb-mcp-server

  • Integrating MySQL databases with applications

  • Querying databases from within applications

  • Automating database tasks

  • Providing a database interface for AI models

  • Data extraction and transformation

FAQ from mysqldb-mcp-server

What is an MCP server?

MCP stands for Model Context Protocol. An MCP server allows an application to interact with external resources.

How do I configure the MySQL connection?

You configure the connection using environment variables like MYSQL_HOST, MYSQL_USER, and MYSQL_PASSWORD.

Can I execute multiple queries at once?

Yes, you can execute multiple queries by separating them with semicolons in the query parameter of the execute_query tool.

How do I enable read-only mode?

Set the MYSQL_READONLY environment variable to 1 or true.

How do I debug the server?

The README recommends using the MCP Inspector for debugging.