RathodDarshil_mcp-postgres-query-server

RathodDarshil_mcp-postgres-query-server

0

The MCP Postgres Query Server is a secure, read-only server tailored for PostgreSQL databases, ensuring efficient integration with Claude Desktop through the MCP protocol. It supports SQL query validation and timeout protection, providing structured JSON responses for queries.

MCP Postgres Query Server

A Model Context Protocol (MCP) server implementation designed for querying a PostgreSQL database in read-only mode. It ensures secure access and integrates with Claude Desktop. The server features:

  • Read-Only Database Access for security
  • Query Validation to prevent harmful SQL operations
  • Timeout Protection to automatically terminate long queries over 10 seconds
  • MCP Protocol Support for complete integration
  • JSON Response Formatting for structured data output

Prerequisites

  • Node.js v14 or later
  • npm
  • PostgreSQL database

Installation

Clone the repository, install dependencies, and build the project using npm.

Connecting to Claude Desktop

Configure Claude Desktop to automatically launch and connect to the server by editing the configuration file to include the server details.

Features

Detailed features include read-only access, query validation, and response formatting in JSON.

API

A tool named query-postgres is available to execute SQL SELECT queries.

Development

Guidelines for modifying server behavior, including query validation and timeout configurations.

Security Considerations

Read-only query validation, SSL connections, query timeouts, and no file-stored credentials ensure security.