MySQL

Medium
  • python

3

GitHub Stars

python

Language

6 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "vedantparmar12-mcp-procuction_mysql": {
      "command": "python",
      "args": [
        "src/server.py"
      ],
      "env": {
        "MYSQL_HOST": "localhost",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "your_username",
        "SECRET_KEY": "your-secret-key-here",
        "SENTRY_DSN": "your_sentry_dsn",
        "MYSQL_DATABASE": "your_database",
        "MYSQL_PASSWORD": "your_password",
        "GITHUB_CLIENT_ID": "your_github_client_id",
        "ALLOWED_OPERATIONS": "SELECT,INSERT,UPDATE,DELETE",
        "GITHUB_CLIENT_SECRET": "your_github_client_secret"
      }
    }
  }
}

You can securely access and manage your MySQL database through a dedicated MCP server. It provides authenticated, monitored, and controlled SQL operations so you can perform queries, fetch metadata, and modify data safely from your MCP client.

How to use

Use the MCP client to connect to the MySQL MCP server and perform the following common tasks: list all tables in your database, inspect a table's structure, run SELECT queries to retrieve data, and execute INSERT, UPDATE, or DELETE statements to modify data. You can also create new tables as needed. Rely on the server’s built-in security features to validate inputs and restrict operations to allowed SQL commands.

How to install

# Prerequisites
- Python 3.8+
- MySQL database server
- Claude Desktop application
- Git

# Step 1: Clone the project and navigate to it
# (adjust the path to your environment)
cd C:\Users\MCP-Procuction_MySQL

# Step 2: Install dependencies
pip install -r requirements.txt

# Step 3: Create and configure environment variables
# Example .env contents
MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_USER=your_username
MYSQL_PASSWORD=your_password
MYSQL_DATABASE=your_database
SECRET_KEY=your-secret-key-here
ALLOWED_OPERATIONS=SELECT,INSERT,UPDATE,DELETE
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret
SENTRY_DSN=your_sentry_dsn

# Step 4: Run the MCP server
# Primary method
python -m src.main

# Alternative methods
# Using run script
python run_server.py

# Standalone mode
python mcp_standalone.py

Claude Desktop integration

You can integrate the MCP server with Claude Desktop by adding a configuration entry that points to the local runtime. The MCP server is exposed as a local process started with Python and the server script.

{
  "mcpServers": {
    "mysql_mcp": {
      "command": "python",
      "args": ["src/server.py"],
      "cwd": "/path/to/your/MYSQL-Production"
    }
  }
}

Configuration notes

Fill in your actual credentials and paths. Replace your_username, your_password, and similar placeholders with real values. Ensure Python is available in your system PATH and the working directory matches your installation. The server will be identified as mysql-mcp in Claude Desktop.

Testing and validation

After configuring Claude Desktop, restart the client and verify the connection by asking Claude to list database tables or to describe a specific table’s structure. Validate that queries return expected results and that write operations modify data as intended within the security constraints.

Security and best practices

  • Use parameterized queries to prevent SQL injection
  • Enforce authentication and session management
  • Limit operations with ALLOWED_OPERATIONS and monitor activity
  • Regularly rotate credentials and keep dependencies up to date
  • Use SSL/TLS for database connections when possible

Troubleshooting

Common issues include connection errors due to incorrect MySQL credentials or host settings, permission errors if the user lacks required rights, and performance concerns related to the connection pool or long-running queries. Check that the MySQL server is running, verify values in the .env file, and review logs for error messages.

Development and testing notes

The server supports a suite of MCP tools for common operations, such as querying data, listing tables, describing table schemas, and performing data modifications. A built-in test suite can be run to ensure connectivity and basic functionality.

Available tools

mysql-mcp:query_database

Execute SELECT queries against the configured MySQL database.

mysql-mcp:list_tables

List all tables in the current database.

mysql-mcp:describe_table

Retrieve the schema for a specific table.

mysql-mcp:execute_sql

Execute INSERT, UPDATE, or DELETE statements.

mysql-mcp:create_table

Create new tables in the database.

mysql-mcp:transaction

Manage transactions to ensure data integrity.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
MySQL MCP Server - vedantparmar12/mcp-procuction_mysql | VeilStrat