Basic information
About PostgreSQL MCP Server
# PostgreSQL
PostgreSQL is a MCP server in the Databases category listed in the AddMCP.net directory, published by divyanshu-vashu. Supported transport: stdio. Runtime: node. License: MIT. Source code is hosted on github.com. Related topics: math-assistant, math-solver, mathgpt.
Setup
{
"mcpServers": {
"MCP-SERVER-PG": {
"command": "docker",
"args": [
"build",
"-t",
"mcp/postgres",
"-f",
"src/postgres/Dockerfile",
"."
]
}
}
}
{
"mcpServers": {
"MCP-SERVER-PG": {
"command": "docker",
"args": [
"build",
"-t",
"mcp/postgres",
"-f",
"src/postgres/Dockerfile",
"."
]
}
}
}
{
"servers": {
"MCP-SERVER-PG": {
"command": "docker",
"args": [
"build",
"-t",
"mcp/postgres",
"-f",
"src/postgres/Dockerfile",
"."
]
}
}
}
PostgreSQL MCP Server — by divyanshu-vashu config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"MCP-SERVER-PG": {
"command": "docker",
"args": [
"build",
"-t",
"mcp/postgres",
"-f",
"src/postgres/Dockerfile",
"."
]
}
}
}
PostgreSQL MCP Server — by divyanshu-vashu 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 PostgreSQL?
A Model Context Protocol server that provides read‑only access to PostgreSQL databases. It enables LLMs to inspect database schemas and execute read‑only SQL queries against a connected PostgreSQL instance.
How to use PostgreSQL?
Configure the server in the mcpServers section of claude_desktop_config.json. Use either Docker (docker run -i --rm mcp/postgres postgresql://...) or NPX (npx -y @modelcontextprotocol/server-postgres). Provide a PostgreSQL connection URL, optionally including username and password.
Key features of PostgreSQL
- Execute read‑only SQL queries via the
querytool. - Automatically discover and expose JSON table schemas.
- Schemas include column names and data types.
- All queries run inside a READ ONLY transaction.
- Supports Docker and NPX deployment.
- MIT licensed.
Use cases of PostgreSQL
- Let an LLM explore a live PostgreSQL database schema.
- Run safe, read‑only analytical queries from a chat interface.
- Allow users to ask natural‑language questions about database content.
- Provide schema context to AI agents for generating accurate SQL.
Frequently asked questions
1 What type of queries does this server support?
Only read‑only SQL queries. All executions are wrapped in a READ ONLY transaction to prevent modifications.
2 How do I connect to a PostgreSQL database running on my local machine?
When using Docker on macOS, use host.docker.internal as the host in the connection URL. For example: postgresql://host.docker.internal:5432/mydb. Replace /mydb with your database name.
3 Can I include credentials in the connection URL?
Yes. Use the full PostgreSQL URI format: postgresql://user:password@host:port/db‑name.
4 What information does the server expose as resources?
For each table, a JSON schema resource (postgres://<host>/<table>/schema) is provided, containing column names and data types, automatically discovered from database metadata.
5 How do I run the server without Docker?
Use the NPX method: set the command to npx with arguments -y @modelcontextprotocol/server-postgres followed by your connection string.
Comments
No comments yet
Be the first to share feedback about this listing. Sign in to leave a comment.
Sign In