drio
Open app

MySQL MCP Server

Source

Catalog onlyCatalog onlySTDIO

Overview

MySQL MCP Server is a Model Context Protocol (MCP) server that facilitates secure interactions with MySQL databases, allowing AI assistants to perform database operations in a controlled manner.

To use the MySQL MCP Server, install it via pip, configure the necessary environment variables for database access, and run it either as a standalone server or integrate it with Claude Desktop.

  • Lists available MySQL tables as resources - Reads table contents - Executes SQL queries with error handling - Ensures secure database access through environment variables - Provides comprehensive logging for database operations
  1. Enabling AI assistants to explore and analyze MySQL databases securely.
  2. Facilitating structured database interactions for applications.
  3. Supporting educational projects that require database access in a safe environment.

Add to your AI client

Use these steps to connect MySQL MCP Server in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.

Cursor

Add this to your .cursor/mcp.json file in your project root, then restart Cursor.

.cursor/mcp.json

{
  "mcpServers": {
    "mcp-server-mysql-youngsu5582": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mcp-server-mysql-youngsu5582"
      ]
    }
  }
}

Claude Desktop

Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.

~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)

{
  "mcpServers": {
    "mcp-server-mysql-youngsu5582": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mcp-server-mysql-youngsu5582"
      ]
    }
  }
}

Claude Code

Add this to your project's .mcp.json file. Claude Code will detect it automatically.

.mcp.json (project root)

{
  "mcpServers": {
    "mcp-server-mysql-youngsu5582": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mcp-server-mysql-youngsu5582"
      ]
    }
  }
}

VS Code (Copilot)

Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.

.vscode/mcp.json

{
  "servers": {
    "mcp-server-mysql-youngsu5582": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mcp-server-mysql-youngsu5582"
      ]
    }
  }
}

Windsurf

Add this to your Windsurf MCP config file, then restart Windsurf.

~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "mcp-server-mysql-youngsu5582": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mcp-server-mysql-youngsu5582"
      ]
    }
  }
}

Cline

Open Cline settings, navigate to MCP Servers, and add this server configuration.

Cline MCP Settings (via UI)

{
  "mcpServers": {
    "mcp-server-mysql-youngsu5582": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mcp-server-mysql-youngsu5582"
      ]
    }
  }
}

FAQ

Is MySQL MCP Server secure?

Yes! It emphasizes security by requiring minimal permissions for database users and logging all operations.

How do I install MySQL MCP Server?

You can install it using the command `pip install mysql-mcp-server`.

Can I use MySQL MCP Server with other programming languages?

Currently, it is designed for Java environments, but contributions for other languages are welcome.7:["$","div",null,{"className":"container mx-auto flex flex-col gap-4","children":["$L26","$L27",["$","$L28",null,{"currentProject":{"id":3867,"uuid":"21b642dd-7b3d-4fdb-8a75-bb720ea7a4b2","name":"mcp-server-mysql","title":"MySQL MCP Server","description":"","avatar_url":"https://avatars.githubusercontent.com/u/98307410?v=4","created_at":"$D2025-03-22T04:38:00.424Z","updated_at":"$D2025-03-22T04:52:21.282Z","status":"created","author_name":"youngsu5582","author_avatar_url":"https://avatars.githubusercontent.com/u/98307410?v=4","tags":"[]","category":"research-and-data","is_featured":false,"sort":1,"url":"https://github.com/youngsu5582/mcp-server-mysql","target":"_self","content":"$29","summary":"$2a","img_url":"https://github.com/youngsu5582/mcp-server-mysql/actions/workflows/test.yml/badge.svg","type":null,"metadata":"{\"star\":\"1\",\"license\":\"\",\"language\":\"Java\",\"is_official\":false,\"latest_commit_time\":\"2025-03-22 15:30:49\"}","user_uuid":null,"tools":null,"sse_url":null,"sse_provider":null,"sse_params":null,"is_official":false,"server_command":null,"server_params":null,"server_config":null,"allow_call":false,"is_innovation":false,"is_dxt":false,"dxt_manifest":null,"dxt_file_url":null,"is_audit":false},"randomProjects":[],"currentServerKey":"$undefined"}]]}]