sql-mcp
Provides a query tool to run parameterized SQL statements against a PostgreSQL database, returning command, rowCount, and rows as JSON.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@sql-mcpSELECT * FROM users"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
sql-mcp
Local MCP server exposed over HTTP that runs inside Docker and provides a single query tool against a PostgreSQL database supplied via DATABASE_URL.
Configure
cp .env.example .env
# edit .env and set DATABASE_URLRelated MCP server: Postgres MCP Server
Run with Docker
docker compose up --buildThe MCP endpoint is then available at http://localhost:3000/mcp.
Run locally (without Docker)
npm install
npm run build
npm start
# or, for hot reload:
npm run devRegister with an MCP client
Point your MCP-compatible client at the streamable HTTP endpoint:
http://localhost:3000/mcpThe transport is streamable-http. Initialize the session with a standard MCP initialize request; subsequent requests must include the mcp-session-id header returned by the server.
Tool
query({ sql: string, params?: unknown[] })— runs a parameterized SQL statement and returns{ command, rowCount, rows }as JSON. Use$1,$2, ... insqland pass values inparams.
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted MCP server for PostgreSQL diagnostics: slow queries, missing indexes, connection pressure.
Paid remote MCP for governed database query review, SQL simulation, approvals, and audits.
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables secure querying of PostgreSQL databases through MCP-compatible clients. Supports read-only SQL execution, table exploration, and connection management with built-in security validation.330 npm9MIT
- FlicenseNot gradedqualityCmaintenanceEnables querying and modifying PostgreSQL databases through MCP tools with read/write operations, schema inspection, and write-safety constraints that limit modifications to the mcp schema.1-
- AlicenseNot gradedqualityFmaintenanceEnables interaction with PostgreSQL databases through MCP, supporting queries, DDL, DML, and schema inspection.6MIT
- FlicenseNot gradedqualityCmaintenanceEnables querying PostgreSQL databases via MCP, with multi-database routing, credential isolation, and truncated results plus full CSV export.-