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

@kingsnow129/database-mcp

v0.4.6

Published

Database MCP server for SQL Server, PostgreSQL, and MySQL with profile-based auto resolution

Readme

Database MCP

Database MCP is an MCP server for SQL Server, PostgreSQL, and MySQL.

It provides tools for:

  • connect
  • health_check
  • list_schemas
  • list_tables
  • describe_table
  • query (single SELECT only)

Release

Current release:

What Is New In 0.4.6

  • Fixed SQL Server integrated-auth instance routing bug: when the configured port can connect but resolves to a different SQL instance, MCP now verifies @@SERVERNAME, closes the wrong connection, and continues probing candidate ports until it matches the requested server\\instance.

What Is New In 0.4.5

  • Added SQL Server integrated-auth instance fallback logic: when host uses server\\instance and direct connect fails, MCP probes candidate ports and validates @@SERVERNAME to resolve the expected instance.
  • Added DB_INSTANCE_PROBE_PORTS environment variable for custom probe port lists.

What Is New In 0.4.4

  • Fixed SQL Server integratedAuth connection handling by building explicit ODBC connection strings for msnodesqlv8.
  • Added optional database parameter on query to support dynamic database switching in one call.
  • Updated VSIX helper to auto-install MCP runtime on startup activation.

What Is New In 0.4.3

  • Removed legacy naming references to sqlserver-mcp.
  • MCP registration now keeps only the databaseMcp server key.

What Was New In 0.4.2

  • Added SQL Server Windows integrated auth support with integratedAuth.
  • Added --integratedAuth CLI override handling in connect flow.
  • Added optional dependency msnodesqlv8 for integrated auth SQL Server driver.

What Was Introduced In 0.4.0

  • Multi-database profile model (servers + databases) is now the primary config.
  • Automatic profile resolution during connect:
    • by alias
    • by serverName
    • by host
    • fallback to currentServer, defaultServer, then legacy alias
  • User install directory moved to:
    • ${userHome}/.mcp-servers/database-mcp
  • VS Code helper command set simplified and includes:
    • Database MCP: Manage Databases
    • Database MCP: Open MCP Server List
    • Database MCP: Uninstall (User)
  • Only databaseMcp key is written to MCP config.

Quick Start (MCP Config)

Example user/workspace MCP config:

{
  "servers": {
    "databaseMcp": {
      "type": "stdio",
      "command": "node",
      "args": [
        "${userHome}/.mcp-servers/database-mcp/node_modules/@kingsnow129/database-mcp/dist/server.js",
        "--profilesFile",
        "${userHome}/.mcp-servers/database-mcp/profiles.json"
      ]
    }
  }
}

You can also run directly with NPX:

{
  "mcpServers": {
    "database-mcp": {
      "command": "npx",
      "args": ["-y", "@kingsnow129/database-mcp"]
    }
  }
}

User-Level Install (Windows)

Run:

powershell -ExecutionPolicy Bypass -File .\scripts\install-user.ps1

This installs to ${HOME}\\.mcp-servers\\database-mcp and updates %APPDATA%\\Code\\User\\mcp.json.

Profiles Format

profiles.json now uses server-level config with database entries:

{
  "defaultServer": "local-server",
  "currentServer": "local-server",
  "currentDatabase": "master",
  "servers": {
    "local-server": {
      "engine": "sqlserver",
      "host": "localhost",
      "port": 1433,
      "integratedAuth": false,
      "user": "sa",
      "password": "",
      "encrypt": true,
      "trustServerCertificate": true,
      "databases": [
        { "name": "master", "readOnly": true, "maxRows": 200 }
      ]
    }
  }
}

VSIX Helper Extension

Build and install locally:

cd vscode-extension
npm install
npm run package
code --install-extension database-mcp-helper-0.4.6.vsix --force

Safety Defaults

  • Read-only mode is hard-enforced (connect.readOnly overrides are ignored)
  • Query tool only accepts one SELECT statement
  • Semicolons are blocked
  • Stored procedure execution (exec, execute, sp_*, xp_*) is blocked
  • Function-call style execution patterns like schema.fn(...) are blocked
  • Returned rows are capped (default 200)

Development

npm install
npm run build
npm run dev

Publish

NPM publish flow:

npm run build
npm publish --access public

VSIX package flow:

cd vscode-extension
npm run package