PostgreSQL MCP Server
Provides tools for accessing PostgreSQL database metadata, including listing tables and other database objects.
Click on "Install 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., "@PostgreSQL MCP Serverlist all tables and show the schema for users"
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.
Postgres MCP server
An FastMCP-based MCP server for PostgreSQL metadata (table lists, etc.). Default transport is stdio (for Cursor/IDE); with HTTP transport, GET /health is available.
Requirements: Python 3.14+, uv, and a running PostgreSQL instance.
List of available tools
get_all_tables - list all tables in the DB;
get_table_columns - list all columns in the specified table;
get_table_primary_key - list table primary key;
get_table_foreign_keys - list table foreign key.
Related MCP server: PostgreSQL MCP Server
Install
git clone <url> mccp && cd mccp
uv syncDatabase configuration
Init file
By default, env/local.ini is read (path is relative to the repo root, not the current working directory). Copy the example and set your values:
db_host=localhost
db_port=5432
db_name=your_db
db_user=postgres
db_password=secretEnv variables
The same settings can be passed via environment variables DB_HOST, DB_PORT, DB_NAME, DB_USER, DB_PASSWORD
CLI flags
Or use CLI flags --db_host, --db_port, etc. (see python src/main.py --help).
Run the server
uv run python src/main.py -t stdioOther FastMCP transports: -t http, -t sse, and so on. Logs go to a file (default logs/mccp.log); override with --log_file.
For quick DB checks without MCP, use uv run python src/r.py — it uses the same config and calls the tools directly.
Tests
uv run python -m unittest src.tests.process_stdio -vThese integration tests spawn src/main.py as a stdio subprocess; you need a reachable database configured in env/local.ini.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityFmaintenanceA Model Context Protocol server providing dual transport (HTTP and Stdio) access to PostgreSQL databases, allowing AI assistants to query databases and fetch schema information through natural language.Last updated9131MIT
- AlicenseBqualityDmaintenanceProvides access to PostgreSQL database schemas and metadata, allowing MCP-compatible tools like Cursor to explore database structure, inspect table schemas, and understand relationships.Last updated553ISC
- Alicense-qualityCmaintenanceAn open-source MCP server for PostgreSQL schema introspection and guarded read-only queries. It enables MCP clients to discover schemas, tables, columns, indexes, relationships, and safe queryable data from a configured PostgreSQL database.Last updated30MIT
- Alicense-qualityDmaintenanceMCP server for PostgreSQL that enables Cursor and other MCP clients to execute SQL queries, list tables, and explore database schemas via HTTP.Last updated853MIT
Related MCP Connectors
MCP server for managing Prisma Postgres.
MCP server for interacting with the Supabase platform
Analytical memory for AI agents: a real Postgres queried in plain English over MCP. One command.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/PhySci/mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server