PgSQL MCP Server
@twn39
About PgSQL MCP Server
🔧 A powerful tool server based on the Model Context Protocol (MCP), enabling interaction with PostgreSQL databases via MCP calls.
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"pgsql-mcp-server-twn39": {
"command": "uv",
"args": [
"tool",
"install",
"pgsql-mcp-server"
]
}
}
}Tools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is PgSQL MCP Server?
PgSQL MCP Server is a tool built on the Model Context Protocol (MCP) that enables interaction with PostgreSQL databases via MCP calls. It is designed for developers who need to query, manage, and explore PostgreSQL schemas and data through MCP-enabled clients.
How to use PgSQL MCP Server?
Install with uv tool install pgsql-mcp-server or pip install pgsql-mcp-server. Run using pgsql-mcp-server --dsn "postgresql://user:password@localhost:5432/db", or execute directly without installation via uvx pgsql-mcp-server --dsn "...".
Key features of PgSQL MCP Server
- Asynchronous and efficient using asyncio and asyncpg.
- Transactional safety with error handling and rollback.
- Easy deployment via a simple command-line interface.
- Provides DQL, DML, DDL, and DCL query execution tools.
- Supports schema, table, column, index, and foreign key introspection.
Use cases of PgSQL MCP Server
- Run SQL queries (SELECT, INSERT, UPDATE, DELETE) through MCP.
- Execute transactional DDL and DCL operations via MCP calls.
- Explore database metadata (schemas, tables, columns, indexes, foreign keys).
- Debug and test MCP database interactions using the MCP Inspector.
FAQ from PgSQL MCP Server
What Python version is required?
Python 3.10 or higher is required.
How do I install the server?
Install using uv tool install pgsql-mcp-server or pip install pgsql-mcp-server. You can also run directly with uvx pgsql-mcp-server.
What tools does the server provide?
It offers nine tools: get_schema_names, get_tables, get_columns, get_indexes, get_foreign_keys, run_dql_query, run_dml_query, run_ddl_query, and run_dcl_query.
How can I test or debug the server?
Use the MCP Inspector: run npx @modelcontextprotocol/inspector uvx pgsql-mcp-server --dsn "..." to visually inspect and test tools.
Are DDL and DML operations transactional?
Yes, DDL, DML, and DCL operations are executed within transactions with error handling and rollback mechanisms.
Frequently asked questions
What Python version is required?
Python 3.10 or higher is required.
How do I install the server?
Install using `uv tool install pgsql-mcp-server` or `pip install pgsql-mcp-server`. You can also run directly with `uvx pgsql-mcp-server`.
What tools does the server provide?
It offers nine tools: get_schema_names, get_tables, get_columns, get_indexes, get_foreign_keys, run_dql_query, run_dml_query, run_ddl_query, and run_dcl_query.
How can I test or debug the server?
Use the MCP Inspector: run `npx @modelcontextprotocol/inspector uvx pgsql-mcp-server --dsn "..."` to visually inspect and test tools.
Are DDL and DML operations transactional?
Yes, DDL, DML, and DCL operations are executed within transactions with error handling and rollback mechanisms.
Basic information
More Other MCP servers
MCP Toolbox for Databases
googleapisMCP Toolbox for Databases is an open source MCP server for databases.
Activepieces
activepiecesAI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

Sequential Thinking
modelcontextprotocolModel Context Protocol Servers

Glasswarp
GlasswarpSee and control a real Windows PC you own — from any MCP client, locally or remotely. Observe (UIA + screenshots), click/type/drag/scroll, launch apps, owner Live View. BYOH: your machine, your key.

Lemon.io
lemon-ioRequest dedicated senior developers to work on your project, write job descriptions, and prep technical interviews — all without leaving your Claude chat. Just describe what you need, and Lemon.io MCP does the rest. 1–3
Comments