Verified

PostgreSQL MCP Server (Vitaly Ostanin)

PostgreSQL database interaction, schema management, and query execution for AI agents.

Data last scanned today · Reviewed today

452 dangerous tools8 tools0TypeScriptMIT

Overview

This TypeScript-based MCP server enables comprehensive interaction with PostgreSQL databases directly from AI assistants. It supports listing databases, tables, views, and functions, alongside performing CRUD operations including SELECT, INSERT, UPDATE, and DELETE. The server also provides monitoring capabilities to retrieve database statistics and performance metrics. Designed with flexibility in mind, the server offers streaming file export for large datasets and configurable output directory whitelisting for security. Users can switch between standard modes and a read-only mode to prevent accidental data modifications during analysis or exploration tasks.

Our verdict

This server carries a high-risk rating of 35/100. It is a personal project not maintained by an official vendor, and critical security aspects like its authentication method and read-only mode implementation have not yet been editorially reviewed. Given the lack of community vetting and the broad capabilities including schema modification and data deletion, it is best reserved for isolated development or testing environments where database integrity is not critical.

  • Supports streaming file exports for handling large datasets.
  • Features a configurable read-only mode for safer data exploration.
  • Compact architecture with only 7 direct dependencies.
  • High security risk due to lack of independent editorial review.
  • Personal project status with no official vendor maintenance guarantee.
  • No community adoption or external contributors as of now.

Setup

Claude Desktop
{
  "mcpServers": {
    "vitalyostanin-postgres-mcp": {
      "args": [
        "-y",
        "@vitalyostanin/postgres-mcp"
      ],
      "command": "npx"
    }
  }
}

Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows), then restart Claude Desktop. Some servers require API keys or tokens as environment variables — check the project's README and add an "env" object if needed.

  • No read-only mode — running this grants full read/write access.
  • No built-in authentication — anyone with access to this config can invoke every tool it exposes.

Tools

ToolDescriptionRisk
service-infoGet PostgreSQL service information and current connection status.low
connectEstablish a connection using POSTGRES_MCP_CONNECTION_STRING.medium
disconnectClose the pool and clear connection state.low
list-schemasList user schemas (excludes information_schema, pg_catalog, pg_toast).low
list-objectsList tables, views, or functions in a schema.low
show-objectShow detailed information about a single table, view, or function.low
execute-sqlRun a SELECT/WITH/VALUES query (read-only mode rejects data-modifying statements with PostgreSQL error 25006).high
index-operationManage database indexes via create, drop, or list operations.high

Compatibility

ClientLocalDockerRemoteRead-only
ChatGPT
Claude Desktop
Cursor
VS Code
Windsurf

Frequently asked questions

What are the system requirements for this server?

This server requires Node.js version 22 or higher.

How do I enable write operations?

By default, the server starts in read-only mode. You must explicitly pass the --no-read-only flag in your MCP client configuration to enable data modifications.

How can I configure where the server saves exported files?

You can use the POSTGRES_MCP_OUTPUT_DIRS environment variable to define a colon-separated whitelist of directories allowed for file exports. The server defaults to using only the OS temporary directory if this is not specified.

Can I adjust the connection pool size?

Yes, you can control the connection pool size using the --pool-size CLI flag. This cannot be configured via environment variables.

How do I configure the timezone for date operations?

You can set the POSTGRES_MCP_TIMEZONE environment variable to any valid IANA timezone identifier, such as America/New_York or Asia/Tokyo. The default timezone is Europe/Moscow.

Alternatives

Changelog

Badge

PostgreSQL MCP Server (Vitaly Ostanin) security score, rated on RepoAI

Maintain this server? Add the live badge to your README.