burakdirin_mysqldb_mcp_server

burakdirin_mysqldb_mcp_server

by burakdirin
An MCP server implementation that enables Claude AI to interact with MySQL databases.

MySQL Database Integration for Claude AI

Overview

The MySQL Database Integration for Claude AI is an MCP server implementation that enables Claude AI to interact with MySQL databases. This project allows users to connect to MySQL databases, execute queries, and retrieve results directly through Claude AI.

Installation

You can install the package using uv or pip:

uv pip install mysqldb-mcp-server
pip install mysqldb-mcp-server

Components

Tools

The server provides two main tools:

  • connect_database: Connects to a specific MySQL database.
  • database parameter: Name of the database to connect to (string).
  • Returns a confirmation message when the connection is successful.

  • execute_query: Executes MySQL queries.

  • query parameter: SQL query/queries to execute (string).
  • Returns query results in JSON format.
  • Multiple queries can be sent separated by semicolons.

Configuration

The server uses the following environment variables:

  • MYSQL_HOST: MySQL server address (default: "localhost").
  • MYSQL_USER: MySQL username (default: "root").
  • MYSQL_PASSWORD: MySQL password (default: "").
  • MYSQL_DATABASE: Initial database (optional).
  • MYSQL_READONLY: Read-only mode (set to 1/true to enable, default: false).

Quickstart

Installation

Claude Desktop

For MacOS and Windows, configure the claude_desktop_config.json file:

{
  "mcpServers": {
    "mysqldb-mcp-server": {
      "command": "uv",
      "args": [
        "--directory",
        "/Users/burakdirin/Projects/mysqldb-mcp-server",
        "run",
        "mysqldb-mcp-server"
      ],
      "env": {
        "MYSQL_HOST": "localhost",
        "MYSQL_USER": "root",
        "MYSQL_PASSWORD": "password",
        "MYSQL_DATABASE": "[optional]",
        "MYSQL_READONLY": "true"
      }
    }
  }
}

For published servers:

{
  "mcpServers": {
    "mysqldb-mcp-server": {
      "command": "uvx",
      "args": [
        "mysqldb-mcp-server"
      ],
      "env": {
        "MYSQL_HOST": "localhost",
        "MYSQL_USER": "root",
        "MYSQL_PASSWORD": "password",
        "MYSQL_DATABASE": "[optional]",
        "MYSQL_READONLY": "true"
      }
    }
  }
}

Installing via Smithery

To install the MySQL Database Integration Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @burakdirin/mysqldb-mcp-server --client claude

Development

Building and Publishing

To prepare the package for distribution:

  1. Sync dependencies and update the lockfile:
uv sync
  1. Build package distributions:
uv build
  1. Publish to PyPI:
uv publish

Debugging

For debugging, use the MCP Inspector:

npx @modelcontextprotocol/inspector uv --directory /Users/burakdirin/Projects/mysqldb-mcp-server run mysqldb-mcp-server

About

This project is an MCP server implementation that enables Claude AI to interact with MySQL databases.

Resources

License

MIT license

Activity

Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks

Releases

Releases

Contributors

Languages

  • Python 92.6%
  • Dockerfile 7.4%

Features & Capabilities

Categories
mcp_server model_context_protocol python docker mysql claude api_integration database

Implementation Details

Stats

0 Views
0 Favorites
1 GitHub Stars

Repository Info

burakdirin Organization

Similar Servers

continuedev_continue by continuedev
0
0
0

Recently Viewed