mcp-postgres-query-server

mcp-postgres-query-server

3.1

If you are the rightful owner of mcp-postgres-query-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

A Model Context Protocol (MCP) server implementation for querying a PostgreSQL database in read-only mode, designed to work with Claude Desktop and other MCP clients.

The MCP Postgres Query Server is a secure, read-only interface to a PostgreSQL database, designed to integrate seamlessly with Claude Desktop and other MCP clients. It ensures that only SELECT queries are executed, providing a safe environment for data retrieval. The server includes SQL query validation to prevent harmful operations and features a query timeout protection set at 10 seconds to avoid resource exhaustion. This implementation requires Node.js (v14 or later) and a PostgreSQL database, with connection details provided via command line. The server is built to support the Model Context Protocol, offering JSON-formatted query results for easy integration and use.

Features

  • Read-Only Database Access: Only SELECT queries are permitted for security.
  • Query Validation: Prevents potentially harmful SQL operations.
  • Timeout Protection: Queries running longer than 10 seconds are automatically terminated.
  • MCP Protocol Support: Complete implementation of the Model Context Protocol.
  • JSON Response Formatting: Query results are returned in structured JSON format.

Tools

  1. query-postgres

    Executes a read-only SQL query against the configured PostgreSQL database.