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

@johnroshan/universal-db-mcp

v1.0.3

Published

MCP server for PostgreSQL and MySQL databases - enables Claude to query your databases

Readme

Universal Database MCP Server

Model Context Protocol server for PostgreSQL and MySQL databases. Enables Claude to query and manage your databases.

Installation

npm install -g @johnroshan/universal-db-mcp

Configuration

Edit Claude Desktop config file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

PostgreSQL

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["-y", "@johnroshan/universal-db-mcp"],
      "env": {
        "DB_TYPE": "postgres",
        "DATABASE_URL": "postgresql://user:password@localhost:5432/mydb"
      }
    }
  }
}

Or use individual parameters:

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["-y", "@johnroshan/universal-db-mcp"],
      "env": {
        "DB_TYPE": "postgres",
        "DB_HOST": "localhost",
        "DB_PORT": "5432",
        "DB_NAME": "mydb",
        "DB_USER": "postgres",
        "DB_PASSWORD": "your_password"
      }
    }
  }
}

MySQL

{
  "mcpServers": {
    "mysql": {
      "command": "npx",
      "args": ["-y", "@johnroshan/universal-db-mcp"],
      "env": {
        "DB_TYPE": "mysql",
        "DATABASE_URL": "mysql://user:password@localhost:3306/mydb"
      }
    }
  }
}

Available Tools

  • query - Execute SQL queries
  • list_tables - List all tables
  • describe_table - Get table schema
  • list_databases - List databases
  • table_row_count - Count rows in table
  • search_table - Search records with pattern matching

Usage Examples

After configuration, ask Claude:

  • "Show me all tables in my database"
  • "What is the schema of the users table"
  • "How many rows are in the orders table"
  • "Find all users with gmail addresses"
  • "Show me the last 10 orders"

Environment Variables

| Variable | Required | Description | |----------|----------|-------------| | DB_TYPE | Yes | postgres or mysql | | DATABASE_URL | No | Full connection string | | DB_HOST | No | Database host | | DB_PORT | No | Database port | | DB_NAME | No | Database name | | DB_USER | No | Database user | | DB_PASSWORD | No | Database password |

Either DATABASE_URL or DB_NAME + DB_USER is required.

Security

This server runs locally on your machine. Database credentials remain on your device.

Consider creating a read-only database user:

PostgreSQL:

CREATE USER claude_readonly WITH PASSWORD 'password';
GRANT CONNECT ON DATABASE mydb TO claude_readonly;
GRANT USAGE ON SCHEMA public TO claude_readonly;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO claude_readonly;

MySQL:

CREATE USER 'claude_readonly'@'localhost' IDENTIFIED BY 'password';
GRANT SELECT ON mydb.* TO 'claude_readonly'@'localhost';
FLUSH PRIVILEGES;

Troubleshooting

Connection refused:

  • Verify database is running
  • Check host and port
  • Check firewall settings

Authentication failed:

  • Verify credentials
  • Check user permissions
  • For PostgreSQL check pg_hba.conf

Claude does not see server:

  • Restart Claude Desktop
  • Check config file syntax
  • Check logs at ~/Library/Logs/Claude/mcp*.log

License

MIT