database-mcp
Provides tools for connecting to MySQL databases, checking connection health, listing schemas and tables, describing table structures, and running single read-only SELECT queries.
Provides tools for connecting to PostgreSQL databases, checking connection health, listing schemas and tables, describing table structures, and running single read-only SELECT queries.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Database MCP
Database MCP is an MCP server for SQL Server, PostgreSQL, and MySQL.
It provides tools for:
connecthealth_checklist_schemaslist_tablesdescribe_tablequery(single SELECT only)
Release
Current release:
NPM package:
@kingsnow129/database-mcp@0.4.6MCP server name:
database-mcpVSIX helper:
database-mcp-helper@0.4.6
Related MCP server: MSSQL Database MCP Server
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 requestedserver\\instance.
What Is New In 0.4.5
Added SQL Server integrated-auth instance fallback logic: when
hostusesserver\\instanceand direct connect fails, MCP probes candidate ports and validates@@SERVERNAMEto resolve the expected instance.Added
DB_INSTANCE_PROBE_PORTSenvironment variable for custom probe port lists.
What Is New In 0.4.4
Fixed SQL Server
integratedAuthconnection handling by building explicit ODBC connection strings formsnodesqlv8.Added optional
databaseparameter onqueryto 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
databaseMcpserver key.
What Was New In 0.4.2
Added SQL Server Windows integrated auth support with
integratedAuth.Added
--integratedAuthCLI override handling inconnectflow.Added optional dependency
msnodesqlv8for 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
aliasby
serverNameby
hostfallback 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 DatabasesDatabase MCP: Open MCP Server ListDatabase MCP: Uninstall (User)
Only
databaseMcpkey 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.ps1This installs to the user profile directory and updates user MCP config.
Recommended cross-platform path notation:
In MCP JSON config:
${userHome}/.mcp-servers/database-mcp/...(preferred)In terminal commands:
%USERPROFILE%\\.mcp-servers\\database-mcp\\...(Windows cmd),$env:USERPROFILE\\.mcp-servers\\database-mcp\\...(Windows PowerShell), or$HOME/.mcp-servers/database-mcp/...(macOS/Linux)
Windows actual paths:
MCP install folder:
C:\\Users\\<your-user>\\.mcp-servers\\database-mcpProfiles file:
C:\\Users\\<your-user>\\.mcp-servers\\database-mcp\\profiles.jsonMCP config:
%APPDATA%\\Code\\User\\mcp.json
Note: ${userHome} is the preferred placeholder inside MCP config files. USERPROFILE (used as %USERPROFILE% in cmd and $env:USERPROFILE in PowerShell) and $HOME are shell environment variables for terminal usage.
User-Level Install (macOS / Linux)
install-user.ps1 is Windows-only. On macOS/Linux, install and configure manually:
mkdir -p ~/.mcp-servers/database-mcp
cd ~/.mcp-servers/database-mcp
npm init -y
npm install --save-exact @kingsnow129/database-mcp@0.4.6Create ~/.mcp-servers/database-mcp/profiles.json (example):
{
"defaultServer": "local-server",
"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 }
]
}
}
}Then register MCP in your user MCP config (for example ~/.config/Code/User/mcp.json on Linux, ~/Library/Application Support/Code/User/mcp.json on macOS):
{
"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"
]
}
}
}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 --forceSafety Defaults
Read-only mode is hard-enforced (
connect.readOnlyoverrides are ignored)Query tool only accepts one SELECT statement
Semicolons are blocked
Stored procedure execution (
exec,execute,sp_*,xp_*) is blockedFunction-call style execution patterns like
schema.fn(...)are blockedReturned rows are capped (default
200)
Development
npm install
npm run build
npm run devPublish
NPM publish flow:
npm run build
npm publish --access publicVSIX package flow:
cd vscode-extension
npm run packageTool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Query Postgres, MySQL, SQL Server, Oracle, BigQuery, ClickHouse and Redshift from your AI client.
PostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.
Query 40 databases from Claude, ChatGPT, or Cursor — on any device. Read-only, encrypted, audited.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to connect and query Microsoft SQL Server databases using natural language, executing read-only SQL queries for safe data inspection and analysis.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to securely interact with Microsoft SQL Server databases to query data, inspect schemas, and retrieve metadata with read-only operations by default and optional write capabilities.1MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to securely interact with MySQL databases, including listing tables, viewing schemas, and executing read-only SQL queries through natural language.7-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to safely query and explore SQL Server and PostgreSQL databases with read-only access, supporting schema discovery, relationship exploration, and query execution.3MIT