Basic information
About MCP Postgres Query Server
# MCP Postgres Query Server
MCP Postgres Query Server is a MCP server in the Databases category listed in the AddMCP.net directory, published by RathodDarshil. Supported transport: stdio. Runtime: node. Source code is hosted on github.com.
Setup
{
"mcpServers": {
"postgres-query": {
"command": "node",
"args": [
"/path/to/your/mcp-postgres-query-server/dist/index.js",
"postgresql://username:password@hostname:port/database"
]
}
}
}
{
"mcpServers": {
"postgres-query": {
"command": "node",
"args": [
"/path/to/your/mcp-postgres-query-server/dist/index.js",
"postgresql://username:password@hostname:port/database"
]
}
}
}
{
"servers": {
"postgres-query": {
"command": "node",
"args": [
"/path/to/your/mcp-postgres-query-server/dist/index.js",
"postgresql://username:password@hostname:port/database"
]
}
}
}
MCP Postgres Query Server config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"postgres-query": {
"command": "node",
"args": [
"/path/to/your/mcp-postgres-query-server/dist/index.js",
"postgresql://username:password@hostname:port/database"
]
}
}
}
MCP Postgres Query Server tools
Tool list not available yet
This listing does not currently have a tool list to display. This does not mean the server has no tools; check its documentation for supported capabilities.
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is MCP Postgres Query Server?
MCP Postgres Query Server is a Model Context Protocol server that provides a secure, read-only interface to a PostgreSQL database. It is designed for use with Claude Desktop and other MCP clients, allowing users to execute SELECT queries safely.
How to use MCP Postgres Query Server?
Clone the repository, install dependencies (npm install), and build (npm run build). Configure Claude Desktop by adding the server to claude_desktop_config.json with the command node and an argument pointing to the built dist/index.js followed by your PostgreSQL connection string. Then restart Claude Desktop.
Key features of MCP Postgres Query Server
- Read-only database access (SELECT queries only)
- Query validation to block non-SELECT SQL
- Automatic 10-second query timeout
- Full MCP protocol implementation
- Structured JSON query results
Use cases of MCP Postgres Query Server
- Query a PostgreSQL database securely through Claude Desktop
- Generate read-only database reports using natural language
- Explore database schemas and data without write permissions
- Integrate PostgreSQL data into MCP-based AI workflows
Frequently asked questions
1 What queries are allowed?
Only SQL SELECT queries are permitted; all other SQL statements are rejected by the validation logic.
2 What runtime dependencies are required?
Node.js v14 or later, npm, and a PostgreSQL database with connection credentials.
3 How do I connect the server to Claude Desktop?
Edit the claude_desktop_config.json file (accessible from Settings > Developer > Edit Config) and add a postgres-query entry with the correct path to the built server and your PostgreSQL connection string.
4 Does the server support write operations?
No, the server is strictly read-only. Query validation ensures only SELECT queries can execute.
5 How are database credentials handled?
Credentials are passed directly as a command-line argument (the connection string) and are not stored in configuration files.
Comments
No comments yet
Be the first to share feedback about this listing. Sign in to leave a comment.
Sign In