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

@mseep/mcp-server-mysql

v0.1.0

Published

MCP server for MySQL database interaction and business intelligence

Downloads

18

Readme

zaj-MySQL-MCP

A Model Context Protocol (MCP) server implementation that provides database interaction and business intelligence capabilities through MySQL. This server enables running SQL queries, analyzing business data, and automatically generating business insight memos.

Features

  • Execute SQL queries against a MySQL database
  • Create and manage database tables
  • Analyze database schema
  • Generate and store business insights
  • Access a continuously updated business insights memo

Tools

Query Tools

  • read_query: Execute SELECT queries to read data from the database

    • Input: query (string) - The SELECT SQL query to execute
    • Returns: Query results as array of objects
  • write_query: Execute INSERT, UPDATE, or DELETE queries

    • Input: query (string) - The SQL modification query
    • Returns: { affected_rows: number }
  • create_table: Create new tables in the database

    • Input: query (string) - CREATE TABLE SQL statement
    • Returns: Confirmation of table creation

Schema Tools

  • list_tables: Get a list of all tables in the database

    • No input required
    • Returns: Array of table names
  • describe_table: View schema information for a specific table

    • Input: table_name (string) - Name of table to describe
    • Returns: Array of column definitions with names and types

Analysis Tools

  • append_insight: Add new business insights to the memo resource
    • Input: insight (string) - Business insight discovered from data analysis
    • Returns: Confirmation of insight addition
    • Triggers update of memo://insights resource

Resources

The server exposes a single resource:

  • memo://insights: A continuously updated business insights memo that aggregates discovered insights during analysis
    • Auto-updates as new insights are discovered via the append-insight tool

Implementation Details

This MCP server implements the Model Context Protocol directly, without relying on external SDK dependencies. It uses:

  • mysql2: For MySQL database connectivity
  • yargs: For command-line argument parsing
  • readline: For handling stdin/stdout communication

The server follows the JSON-RPC 2.0 protocol for communication with Claude, handling requests for tool listings, resource listings, and tool execution.

Configuration

The MySQL MCP server uses environment variables for configuration. Create a .env file in the root directory with the following variables:

# Database Connection
DB_CONNECTION=mysql

# Database Host
DB_HOST=localhost

# Database Port
DB_PORT=3306

# Database Username (required)
DB_USER=your_mysql_username

# Database Password (required)
DB_PASSWORD=your_mysql_password

# Database Name (required)
DB_NAME=your_database_name

A .env.example file is provided as a template. Copy it to .env and update the values:

cp .env.example .env
# Then edit .env with your database credentials

Usage with Claude Desktop

Add the server to your cline_mcp_settings.json:

"mcpServers": {
  "mysql": {
    "command": "node",
    "args": [
      "/path/to/zaj_MySQL_MCP/build/index.js"
    ],
    "disabled": false,
    "autoApprove": []
  }
}

Note that database credentials are now configured through the .env file, not through command line arguments.

Building and Running

  1. Clone the repository:
git clone https://github.com/zajTools/zaj-MySQL-MCP.git
cd zaj-MySQL-MCP
  1. Create and configure your .env file:
cp .env.example .env
# Edit .env with your database credentials
  1. Install dependencies:
npm install
  1. Build the server:
npm run build
  1. Run the server:
node build/index.js

Demo and Examples

We've included example materials to help you get started with the MySQL MCP server:

  • Sample Database: A complete e-commerce database schema with customers, products, orders, and sales data
  • Example Queries: Pre-written queries demonstrating various capabilities of the MCP server
  • Usage Scenarios: Examples of how Claude can interact with your MySQL database

To try the demo:

  1. Check out the Demo Guide for step-by-step instructions
  2. Run the Setup SQL Script to create the sample database
  3. Configure the MCP server to connect to the demo database
  4. Start asking Claude questions about your data!

These examples are designed to show the potential of using Claude with MySQL databases, but the MCP server works with any MySQL database you have access to.

License

This MCP server is licensed under the MIT License.