npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@saturninoadrales/mysql-mcp

v1.0.0

Published

MySQL MCP Server - Model Context Protocol server for readonly MySQL database operations in Claude Desktop

Readme

MySQL MCP Server

A Model Context Protocol (MCP) server that provides readonly MySQL database operations for AI agents with support for multiple database servers.

Features

  • list_servers: Show all configured MySQL servers
  • list_tables: List all tables in the database
  • describe_table: Show table structure and column information
  • query: Execute SELECT queries (readonly only)
  • show_databases: List available databases
  • use_database: Switch to a different database on a server

Installation

For detailed installation instructions, see INSTALLATION.md

From npm (once published)

npm install -g @saturninoadrales/mysql-mcp

From source

git clone <repository-url>
cd mysql-mcp
npm install

Configuration

Option 1: Multiple Servers (Recommended)

Configure multiple MySQL servers using a JSON environment variable MYSQL_SERVERS:

{
  "production": {
    "host": "prod.example.com",
    "port": 3306,
    "user": "prod_user",
    "password": "prod_password",
    "database": "prod_db"
  },
  "staging": {
    "host": "staging.example.com",
    "port": 3306,
    "user": "staging_user",
    "password": "staging_password",
    "database": "staging_db"
  },
  "local": {
    "host": "localhost",
    "port": 3306,
    "user": "root",
    "password": "local_password",
    "database": "test_db"
  }
}

Option 2: Single Server (Backward Compatible)

Copy .env.example to .env and configure your MySQL connection:

cp .env.example .env

Set the following environment variables:

  • MYSQL_HOST: MySQL server host (default: localhost)
  • MYSQL_PORT: MySQL server port (default: 3306)
  • MYSQL_USER: MySQL username (default: root)
  • MYSQL_PASSWORD: MySQL password
  • MYSQL_DATABASE: Database name to connect to

Usage with Claude Desktop

Multiple Servers Configuration

If installed from npm:

{
  "mcpServers": {
    "mysql": {
      "command": "mysql-mcp",
      "env": {
        "MYSQL_SERVERS": "{\"production\":{\"host\":\"prod.example.com\",\"port\":3306,\"user\":\"prod_user\",\"password\":\"prod_password\",\"database\":\"prod_db\"},\"staging\":{\"host\":\"staging.example.com\",\"port\":3306,\"user\":\"staging_user\",\"password\":\"staging_password\",\"database\":\"staging_db\"}}"
      }
    }
  }
}

If running from source:

{
  "mcpServers": {
    "mysql": {
      "command": "node",
      "args": ["path/to/mysql-mcp/server.js"],
      "env": {
        "MYSQL_SERVERS": "{\"production\":{\"host\":\"prod.example.com\",\"port\":3306,\"user\":\"prod_user\",\"password\":\"prod_password\",\"database\":\"prod_db\"},\"staging\":{\"host\":\"staging.example.com\",\"port\":3306,\"user\":\"staging_user\",\"password\":\"staging_password\",\"database\":\"staging_db\"}}"
      }
    }
  }
}

Single Server Configuration

{
  "mcpServers": {
    "mysql": {
      "command": "node",
      "args": ["path/to/mysql-mcp/server.js"],
      "env": {
        "MYSQL_HOST": "localhost",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "your_username",
        "MYSQL_PASSWORD": "your_password",
        "MYSQL_DATABASE": "your_database"
      }
    }
  }
}

Using Multiple Servers

When multiple servers are configured, all tools accept an optional server parameter:

// List tables from production server
await list_tables({ server: "production" })

// Query staging server
await query({ 
  sql: "SELECT * FROM users LIMIT 10",
  server: "staging"
})

// Describe table on local server
await describe_table({ 
  table_name: "products",
  server: "local"
})

// If no server is specified, "default" is used
await list_tables() // Uses "default" server

Security

This server only allows readonly operations (SELECT, SHOW, DESCRIBE) for safety. All other SQL operations are blocked.