drio
Open app

MySQL MCP Server

Source

A Model Context Protocol (MCP) server that enables secure interaction with MySQL databases

Catalog onlyCatalog onlySTDIO

Overview

MySQL MCP Server is a Model Context Protocol (MCP) server designed to enable secure interactions with MySQL databases. It provides a structured interface for AI assistants to interact with databases safely, allowing for database exploration and analysis.

To use MySQL MCP Server, install it via pip and configure the required environment variables for your MySQL instance. You can run it standalone or integrate it with applications like Claude Desktop.

  • Lists available MySQL tables as resources - Reads table contents securely - Executes SQL queries with error handling - Configurable access through environment variables - Logs database operations comprehensively
  1. Creating secure database interfaces for AI applications
  2. Enabling structured exploration of MySQL databases
  3. Logging and monitoring database queries for audit purposes

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": {
    "mysql-mcp-server-designcomputer": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mysql-mcp-server-designcomputer"
      ]
    }
  }
}

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": {
    "mysql-mcp-server-designcomputer": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mysql-mcp-server-designcomputer"
      ]
    }
  }
}

Claude Code

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

.mcp.json (project root)

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

VS Code (Copilot)

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

.vscode/mcp.json

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

Windsurf

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

~/.codeium/windsurf/mcp_config.json

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

Cline

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

Cline MCP Settings (via UI)

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

FAQ

How do I install MySQL MCP Server?

Use the command `pip install mysql-mcp-server` to install it.

Can I run it as a standalone server?

Yes! You can run it independently by following the provided usage instructions.

Are there security practices I should follow?

Yes! It's advised to create a dedicated MySQL user with minimal permissions and enable logging for all database operations.