MCP server for PostgreSQL. Read-only by default, row caps, timeouts, secrets never logged.
registry version 0.5.0
npm
npx -y @database-mcp/postgresnpm
npx -y @database-mcp/postgres@0.5.0Python
uvx database-mcp-postgresPython
uvx database-mcp-postgres@0.5.0cargo
database-mcp-rs-postgres
Pick your client — the config below is generated for this server (local stdio). Copy respects the “Pin version” switch above.
claude_desktop_config.json
{
"mcpServers": {
"database-mcp-postgres": {
"command": "npx",
"args": [
"-y",
"@database-mcp/postgres"
],
"env": {
"POSTGRES_HOST": "<YOUR_POSTGRES_HOST>",
"POSTGRES_USER": "<YOUR_POSTGRES_USER>",
"POSTGRES_PASSWORD": "<YOUR_POSTGRES_PASSWORD>",
"POSTGRES_DATABASE": "<YOUR_POSTGRES_DATABASE>"
}
}
}
}{
"mcpServers": {
"database-mcp-postgres": {
"command": "npx",
"args": [
"-y",
"@database-mcp/postgres@0.5.0"
],
"env": {
"POSTGRES_HOST": "<YOUR_POSTGRES_HOST>",
"POSTGRES_USER": "<YOUR_POSTGRES_USER>",
"POSTGRES_PASSWORD": "<YOUR_POSTGRES_PASSWORD>",
"POSTGRES_DATABASE": "<YOUR_POSTGRES_DATABASE>"
}
}
}
}Format verified against the official Claude Desktop docs ↗.
terminal
claude mcp add --env POSTGRES_HOST=<YOUR_POSTGRES_HOST> --env POSTGRES_USER=<YOUR_POSTGRES_USER> --env POSTGRES_PASSWORD=<YOUR_POSTGRES_PASSWORD> --env POSTGRES_DATABASE=<YOUR_POSTGRES_DATABASE> database-mcp-postgres -- npx -y @database-mcp/postgres
claude mcp add --env POSTGRES_HOST=<YOUR_POSTGRES_HOST> --env POSTGRES_USER=<YOUR_POSTGRES_USER> --env POSTGRES_PASSWORD=<YOUR_POSTGRES_PASSWORD> --env POSTGRES_DATABASE=<YOUR_POSTGRES_DATABASE> database-mcp-postgres -- npx -y @database-mcp/postgres@0.5.0
Format verified against the official Claude Code docs ↗.
.cursor/mcp.json
{
"mcpServers": {
"database-mcp-postgres": {
"command": "npx",
"args": [
"-y",
"@database-mcp/postgres"
],
"env": {
"POSTGRES_HOST": "<YOUR_POSTGRES_HOST>",
"POSTGRES_USER": "<YOUR_POSTGRES_USER>",
"POSTGRES_PASSWORD": "<YOUR_POSTGRES_PASSWORD>",
"POSTGRES_DATABASE": "<YOUR_POSTGRES_DATABASE>"
}
}
}
}{
"mcpServers": {
"database-mcp-postgres": {
"command": "npx",
"args": [
"-y",
"@database-mcp/postgres@0.5.0"
],
"env": {
"POSTGRES_HOST": "<YOUR_POSTGRES_HOST>",
"POSTGRES_USER": "<YOUR_POSTGRES_USER>",
"POSTGRES_PASSWORD": "<YOUR_POSTGRES_PASSWORD>",
"POSTGRES_DATABASE": "<YOUR_POSTGRES_DATABASE>"
}
}
}
}Format verified against the official Cursor docs ↗.
.vscode/mcp.json
{
"servers": {
"database-mcp-postgres": {
"command": "npx",
"args": [
"-y",
"@database-mcp/postgres"
],
"env": {
"POSTGRES_HOST": "<YOUR_POSTGRES_HOST>",
"POSTGRES_USER": "<YOUR_POSTGRES_USER>",
"POSTGRES_PASSWORD": "<YOUR_POSTGRES_PASSWORD>",
"POSTGRES_DATABASE": "<YOUR_POSTGRES_DATABASE>"
}
}
}
}{
"servers": {
"database-mcp-postgres": {
"command": "npx",
"args": [
"-y",
"@database-mcp/postgres@0.5.0"
],
"env": {
"POSTGRES_HOST": "<YOUR_POSTGRES_HOST>",
"POSTGRES_USER": "<YOUR_POSTGRES_USER>",
"POSTGRES_PASSWORD": "<YOUR_POSTGRES_PASSWORD>",
"POSTGRES_DATABASE": "<YOUR_POSTGRES_DATABASE>"
}
}
}
}Format verified against the official VS Code docs ↗.
mcp_config.json
{
"mcpServers": {
"database-mcp-postgres": {
"command": "npx",
"args": [
"-y",
"@database-mcp/postgres"
],
"env": {
"POSTGRES_HOST": "<YOUR_POSTGRES_HOST>",
"POSTGRES_USER": "<YOUR_POSTGRES_USER>",
"POSTGRES_PASSWORD": "<YOUR_POSTGRES_PASSWORD>",
"POSTGRES_DATABASE": "<YOUR_POSTGRES_DATABASE>"
}
}
}
}{
"mcpServers": {
"database-mcp-postgres": {
"command": "npx",
"args": [
"-y",
"@database-mcp/postgres@0.5.0"
],
"env": {
"POSTGRES_HOST": "<YOUR_POSTGRES_HOST>",
"POSTGRES_USER": "<YOUR_POSTGRES_USER>",
"POSTGRES_PASSWORD": "<YOUR_POSTGRES_PASSWORD>",
"POSTGRES_DATABASE": "<YOUR_POSTGRES_DATABASE>"
}
}
}
}Format verified against the official Windsurf docs ↗.
Defined in the server's official registry manifest. Required secrets are shown as <YOUR_…> placeholders in the configs above.
POSTGRES_HOST required — Database hostPOSTGRES_USER required — Database user (a read-only user is recommended)POSTGRES_PASSWORD secret — Database password (or use POSTGRES_PASSWORD_FILE)POSTGRES_DATABASE required — Database name⭐ 5 stars · 最近更新于 53 天前 · MIT license
These star and push figures are for the shared repository — 5 listings on this site point at the same repository.
database mcp MCP servers that give AI clients safe, structured access to SQL databases. One installable package per database engine, in TypeScript (npm) and Python (PyPI). Every package exposes the same minimal two tool surface, execute sql and search objects , with guardrails on by default: read on…
Summary from the project README — github.com/arifulislamat/database-mcp
Distributed as npm, Python, cargo, listed under Databases. Review our MCP security guide before granting access to real data.
database mcp MCP servers that give AI clients safe, structured access to SQL databases. One installable package per database engine, in TypeScript (npm) and Python (PyPI). Every package exposes the same minimal two tool surface, execute sql and search objects , with guardrails on by default: read on
Run the install command shown above, then paste the config for your client (Claude Desktop, Claude Code, Cursor, VS Code or Windsurf) into its MCP settings and restart the client.
The MCP server itself is free to install. The source is public on https://github.com/arifulislamat/database-mcp. Any third-party service it calls may require its own API key and account.
Any MCP-compatible client can use it, including Claude Desktop, Claude Code, Cursor, VS Code, Windsurf and custom agents.
Publish this server? Link back with a badge on your README or site — copy either snippet.
Markdown
[](https://mcpnav.net/server/database-mcp-postgres/)
HTML
<a href="https://mcpnav.net/server/database-mcp-postgres/"><img src="https://mcpnav.net/badge/database-mcp-postgres.svg" alt="Listed on MCPNav" height="20"></a>