Database Mcp — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Database Mcp (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
A secure, read-only Model Context Protocol (MCP) server that enables AI assistants (Claude Code, Cursor, etc.) to safely query and explore SQL Server and PostgreSQL databases.
This MCP server acts as a bridge between AI assistants and your databases. It provides safe, read-only access so AI can help you understand your database schema, query data, and discover relationships — all without risking data modification.
cd sqlserver-mcp
npm install
npm run buildAdd a .mcp.json file to the root of any project where you want database access:
PostgreSQL:
{
"mcpServers": {
"database": {
"command": "node",
"args": ["/absolute/path/to/sqlserver-mcp/build/index.js"],
"env": {
"SQLSERVER_CONNECTIONS": "{\"mydb\":{\"databaseType\":\"postgresql\",\"connectionString\":\"postgresql://user:pass@localhost:5432/dbname\"}}"
}
}
}
}SQL Server:
{
"mcpServers": {
"database": {
"command": "node",
"args": ["/absolute/path/to/sqlserver-mcp/build/index.js"],
"env": {
"SQLSERVER_CONNECTIONS": "{\"mydb\":{\"server\":\"localhost\",\"database\":\"MyDB\",\"user\":\"sa\",\"password\":\"yourpassword\",\"options\":{\"encrypt\":false,\"trustServerCertificate\":true}}}"
}
}
}
}Multiple databases:
{
"mcpServers": {
"database": {
"command": "node",
"args": ["/absolute/path/to/sqlserver-mcp/build/index.js"],
"env": {
"SQLSERVER_CONNECTIONS": "{\"pg_local\":{\"databaseType\":\"postgresql\",\"connectionString\":\"postgresql://user:pass@localhost:5432/appdb\"},\"sql_prod\":{\"server\":\"prod.server.com\",\"database\":\"ProdDB\",\"user\":\"readonly\",\"password\":\"pass\",\"options\":{\"encrypt\":true}}}"
}
}
}
}The profile name (e.g., mydb, pg_local) is what gets passed as the profile parameter to every tool call.
Instead of inline JSON, you can use a config file:
{
"mcpServers": {
"database": {
"command": "node",
"args": ["/absolute/path/to/sqlserver-mcp/build/index.js"],
"env": {
"SQLSERVER_CONFIG_FILE": "/path/to/config.json"
}
}
}
}Where config.json contains:
{
"local_pg": {
"databaseType": "postgresql",
"connectionString": "postgresql://user:pass@localhost:5432/mydb"
},
"local_sql": {
"server": "localhost",
"database": "MyDB",
"user": "sa",
"password": "yourpassword",
"options": {
"encrypt": false,
"trustServerCertificate": true
}
}
}Restart your IDE after adding or changing .mcp.json.
| Tool | Database | Description |
|---|---|---|
list-schemas | Both | List schemas with owner info and table counts |
list-tables | Both | List tables with row counts and type info |
describe-table | Both | Column details: types, nullability, PKs, defaults, identity |
get-relationships | Both | Foreign key relationships (outgoing and incoming) |
get-indexes | Both | Index details: type, columns, uniqueness, filters |
run-select-query | Both | Execute read-only SELECT queries with parameters |
explain-query | Both | Get estimated execution plan for a query |
estimate-cost | Both | Estimate query cost and row counts |
list-materialized-views | PostgreSQL | List materialized views with size and status |
list-extensions | PostgreSQL | List installed and available extensions |
list-enums | PostgreSQL | List user-defined enum types with values |
Ask your AI assistant:
{
"server": "hostname",
"database": "database_name",
"user": "username",
"password": "password",
"port": 1433,
"options": {
"encrypt": true,
"trustServerCertificate": false,
"applicationIntent": "ReadOnly",
"requestTimeout": 30000,
"connectionTimeout": 15000
}
}{
"databaseType": "postgresql",
"server": "hostname",
"database": "database_name",
"user": "username",
"password": "password",
"port": 5432,
"pgOptions": {
"ssl": true,
"statement_timeout": 30000,
"application_name": "mcp-server"
}
}{
"databaseType": "postgresql",
"connectionString": "postgresql://user:pass@host:5432/dbname?sslmode=require"
}When using connectionString, the server, database, user, and password fields are still required but can be set to placeholder values — the connection string takes precedence.
Best practice: Create a read-only database user for the MCP server.
-- PostgreSQL
CREATE USER mcp_readonly WITH PASSWORD 'secure_password';
GRANT CONNECT ON DATABASE mydb TO mcp_readonly;
GRANT USAGE ON SCHEMA public TO mcp_readonly;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO mcp_readonly;
-- SQL Server
CREATE LOGIN mcp_readonly WITH PASSWORD = 'secure_password';
CREATE USER mcp_readonly FOR LOGIN mcp_readonly;
EXEC sp_addrolemember 'db_datareader', 'mcp_readonly';npm run build # Compile TypeScript
npm run dev # Watch mode
npm test # Run all tests
npm run test:coverage # Coverage report"Unknown connection profile" — The profile name in your tool call doesn't match what's in the config. Check spelling.
"connect ECONNREFUSED" — The database isn't running or the host/port is wrong. Verify the database is accessible.
"Cannot find module" — Run npm run build first. Check the path in .mcp.json is absolute and correct.
MIT
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.