MySQL MCP Server

MySQL MCP Server

Enables AI agents to interact with a MySQL database using natural language, automating SQL tasks like querying, inserting, updating, and deleting data.

Category
Visit Server

README

🐬 MySQL MCP Server (FastMCP-Powered)

Leverage the power of AI to automate your MySQL workflows with FastMCP.
This tool enables AI agents like Claude, OpenAI, or DeepSeek to interact with your MySQL database using natural language, making database management seamless and intelligent.

Whether you're generating synthetic data, querying your tables, or performing updates, this MCP server allows AI to operate on your database through standardized interfaces — all from your local machine.

šŸ”Ž Best use for generating synthetic data for testing your apis.

šŸ’” Key Features

  • Automates SQL tasks via AI (Claude, OpenAI, DeepSeek, etc.)
  • Works over Stdio, ideal for local desktop integration
  • Generates synthetic data based on your schema and recent values
  • No manual SQL knowledge required
  • Highly useful for test environments and data prototyping

šŸ› ļø Supported Tools

Tool Description
get_column_names(table_name) Retrieve all column names of a table
get_all_table_names() List all table names in the database
select(...) Fetch records from any table
insert(...) Insert data into a table
update(...) Update records with conditions
delete(...) Delete records based on criteria

These are internally used by the AI to understand and manipulate your database efficiently.


āš™ļø Configuration & Setup

šŸ“‹ Prerequisites

  • Python 3.10+
  • MySQL (running locally or remotely)
  • Anthropic Claude Desktop app (or Cursor)
  • UV (Python package manager), install with curl -LsSf https://astral.sh/uv/install.sh | sh

Steps

  1. Clone this repository

    git clone https://github.com/Ashutosh-rajput/mysql-mcp.git
    cd mysql-mcp
    uv pip install -r requirements.txt
    
  2. Fill the .env

    MYSQL_HOST=localhost
    MYSQL_PORT=3306
    MYSQL_USER=root
    MYSQL_PASSWORD=yourpassword
    MYSQL_DATABASE=yourdatabase
    
  3. Connect to the MCP server

    Copy the below json with the appropriate {{PATH}} values:

        {
       "mcpServers": {
         "Mysql": {
           "command": "[path to uv]/uv",
           "args": [
             "run",
             "--with", "fastmcp",
             "--with", "mysql-connector-python",
             "--with", "python-dotenv",
             "fastmcp",
             "run",
             "[path to your main.py]/main.py"
           ]
         }
       }
     }
    

    For Claude, save this as claude_desktop_config.json in your Claude Desktop configuration directory at:

    ~/Library/Application Support/Claude/claude_desktop_config.json
    

    For Cursor, save this as mcp.json in your Cursor configuration directory at:

    ~/.cursor/mcp.json
    
  4. Restart Claude Desktop / Cursor

    Open Claude Desktop and you should now see WhatsApp as an available integration.

    Or restart Cursor.

🧠 Tip

Use this project as a backbone to build intelligent, event-driven Mysql bots, agents.


šŸ“œ License

MIT License. Feel free to use and modify as per your needs.


šŸ‘¤ Author: Ashutosh Rajput
🌐 Project: MySql-MCP

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured