Back to Home
neverinfamous icon

postgresql-mcp

Verified Safe

by neverinfamous

Overview

Enabling AI agents to programmatically interact with PostgreSQL databases through a rich set of specialized tools and a sandboxed code execution environment.

Installation

Run Command
node dist/cli.js --transport stdio --postgres postgres://user:password@localhost:5432/database

Environment Variables

  • POSTGRES_HOST
  • POSTGRES_PORT
  • POSTGRES_USER
  • POSTGRES_PASSWORD
  • POSTGRES_DATABASE
  • LOG_LEVEL
  • POSTGRES_TOOL_FILTER
  • MCP_TOOL_FILTER
  • TOOL_FILTER
  • MCP_TRANSPORT
  • PORT
  • HOST
  • OAUTH_ENABLED
  • OAUTH_ISSUER
  • OAUTH_AUDIENCE
  • OAUTH_JWKS_URI
  • CODEMODE_ISOLATION

Security Notes

The `codemode` module implements robust sandboxing using Node.js `vm` or `worker_threads`, explicitly blocking access to dangerous Node.js globals (like `require`, `process`, `eval`, filesystem, and networking modules). It uses regex patterns to detect and prevent common malicious code injection attempts. The `HttpTransport` also enforces strong network security measures including rate limiting, maximum request body size, HTTP Strict Transport Security (HSTS), Content Security Policy (CSP), and other security headers. OAuth 2.1 is supported for external authentication and authorization. While these layers provide strong protection, inherent theoretical limitations exist for any in-process sandbox compared to full containerization.

Similar Servers

Stats

Interest Score30
Security Score9
Cost ClassMedium
Avg Tokens75
Stars1
Forks1
Last Update2026-01-19

Tags

PostgreSQLAI AgentsDatabase ManagementModel Context ProtocolCode Execution