MCP PostgreSQL Server
The MCP PostgreSQL Server provides structured, AI-enabled interaction with PostgreSQL databases through a safe and validated API. You can:
Connect to Databases: Establish connections using connection details (default connections available)
Execute Queries: Run parameterized SELECT queries for safe data retrieval
Modify Data: Perform INSERT, UPDATE, and DELETE operations
Explore Schema: List all tables and describe specific table structures
Validate Operations: Ensure query safety through read-only validation
Use Templates: Access pre-built analysis templates for streamlined data analysis
Support AI Systems: Enable structured database access for AI-powered analysis
Manages configuration through environment variables using .env files for storing database credentials, server settings, and security parameters.
Supports repository cloning for installation and source code management during development.
Provides example code for API interaction, allowing clients to execute queries and interact with analysis templates.
Handles dependency management and provides scripts for installation, development, testing, and linting.
Connects to a PostgreSQL database, providing tools for schema exploration, read-only SQL query execution, relationship visualization, and data analysis through predefined templates and sample data retrieval.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP PostgreSQL Server show me the top 10 customers by total purchases"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Server Test Collection
This repository contains a collection of tests and implementations for various Model-Controller-Provider (MCP) server architectures. Each implementation focuses on different aspects of MCP pattern and database interactions.
Current Implementations
1. MCP PostgreSQL Server (mcp-psql/)
A PostgreSQL-specific implementation that:
Provides safe database access through a structured API
Enables AI systems to interact with databases
Implements read-only query validation
Includes pre-built analysis templates
Supports schema exploration and data analysis
2. MCP Figma Server (mcp-figma/)
A Figma-specific implementation that:
Enables AI systems to interact with Figma designs
Provides structured access to Figma files and components
Implements design analysis and manipulation capabilities
Supports AI-driven design suggestions and modifications
Includes pre-built design templates and patterns
Related MCP server: mcp-postgres
Purpose
This repository serves as:
A testing ground for different MCP implementations
A reference for MCP pattern best practices
A collection of database and design tool interaction patterns
A showcase of AI integration approaches with various systems
Getting Started
Each implementation in this collection has its own setup instructions and documentation. Please refer to the specific implementation's README for details.
Contributing
New MCP implementations and test cases are welcome! Please follow these guidelines:
Create a new directory for your implementation
Include comprehensive documentation
Follow the existing project structure
Add appropriate tests
License
MIT
Available Tools
6 toolsconnect_dbA
Connect to PostgreSQL database. NOTE: Default connection exists - only use when requested or if other commands fail
Inputs: database (required), host (required), password (required), user (required), +1 more.
describe_tableC
Get table structure
Inputs: table (required), schema.
executeB
Execute an INSERT, UPDATE, or DELETE query
Inputs: sql (required), params.
list_schemasA
List all schemas in the database
Inputs: no named parameters.
list_tablesC
List tables in the database
Inputs: schema.
queryC
Execute a SELECT query
Inputs: sql (required), params.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose with no ambiguity. 'execute' handles INSERT/UPDATE/DELETE, 'query' handles SELECT, 'list_tables' and 'list_schemas' are separate listing functions, 'describe_table' provides metadata, and 'connect_db' is for connection management. The separation between 'execute' and 'query' is particularly well-defined.
Most tools follow a consistent verb_noun pattern (describe_table, list_schemas, list_tables). The main deviation is 'execute' and 'query' which use single verbs without objects, and 'connect_db' uses a verb_object pattern but with abbreviated 'db' instead of 'database'. The naming is still readable and mostly predictable.
Six tools is well-scoped for a PostgreSQL server. This covers essential database operations: connection management, schema/table discovery, metadata inspection, and both read (SELECT) and write (INSERT/UPDATE/DELETE) operations. Each tool earns its place without bloat.
The toolset covers core PostgreSQL workflows well: discovery (list_schemas, list_tables), inspection (describe_table), and query execution (query, execute). Minor gaps include lack of transaction control tools (BEGIN, COMMIT, ROLLBACK) and database management operations (CREATE/DROP database/table), but agents can work around these using the existing execute tool.
Related MCP Connectors
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Query your own databases and Data Sets with read-only SQL, and build hosted dashboards.
Query your Postgres from ChatGPT or Claude without exposing the database or handing over credentials. Run npx boltschema connect next to your database and it dials out over HTTPS — no inbound firewall rule, no open port, works with localhost and VPC-private databases. Read-only is enforced by a SQL guard, a Postgres READ ONLY transaction, and a scoped role generated for you.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides read-only access to PostgreSQL databases with schema inspection, query execution in multiple formats (JSON, CSV, Markdown), and query history tracking with built-in security features.-
- AlicenseNot gradedqualityDmaintenanceRead-only PostgreSQL MCP server that enables running SELECT queries, listing tables and schemas, and describing columns, with built-in protection against writes and malicious SQL attacks.MIT
- FlicenseNot gradedqualityDmaintenanceEnables safe interaction with PostgreSQL databases through read-only queries, schema exploration, and performance analysis.-
- AlicenseAqualityDmaintenanceA secure, read-only PostgreSQL MCP server that provides safe database introspection and querying capabilities.147 npmMIT
Appeared in Searches
- A database for searching medical and scientific research articles
- PostgreSQL MCP (Multi-Version Concurrency Control or specific usage)
- Information about PostgreSQL MCP (Managed Cloud Provider or other related concepts)
- Search for information about 'rag'
- Overview and Resources for PostgreSQL Database System