
Postgres Schema Mcp
Read-only Postgres schema retrieval and query tools that return only the relevant table slice.
- tools
- 4
- transport
- STDIO
- last updated
- Nov 20, 2026
What it does
- Reads schema with
search_schema, which ranks tables by question and returns a slice, anddescribe_tablefor named tables - Runs queries with
explain_queryandrun_query, where an AST guard rejects anything but a single read-only SELECT - Connects to Postgres through a
SELECT-only role, so writes are blocked at the database layer rather than by annotation - Designed for analysts and agents querying wide schemas where dumping the full DDL wastes context
Tools
4 toolsPublic tool metadata for what this MCP can expose to an agent.
search_schemaRetrieves the relevant slice of the schema for a natural-language question, rather than dumping the whole schema.
Retrieves the relevant slice of the schema for a natural-language question, rather than dumping the whole schema.
No parameter schema in public metadata yet.
describe_table
No parameter schema in public metadata yet.
explain_query
No parameter schema in public metadata yet.
run_query
No parameter schema in public metadata yet.
Readme
postgres-schema-mcp
Schema access for an agent is a retrieval problem, not a dump.
An MCP server that gives an AI agent the relevant slice of a wide Postgres schema instead of all of it, and enforces read-only in three layers rather than annotating it.
Terminal demo: one question retrieves a small slice of the schema, and the read-only guard blocks a DELETE hidden inside a CTE.
The number
Measured on the seeded AdventureWorks database in this repo: 68 tables across 5 schemas, over the 26 questions in evals/questions.yaml.
Details
- Repository
- github.com/akshayyswami/postgres-schema-mcp
- Categories
- Databases, Data & Analytics
- Package
postgres-schema-mcp- Transport
- STDIO
- Registry
- MCP registry, active
Similar to Postgres Schema Mcp
More Databases
Postgres MCP ProMCP servercrystaldba3.5K starsConnects to PostgreSQL databases for schema browsing, SQL execution, query tuning, and health checks.
MCP Alchemy ServerMCP serverrunekaagaard421 starsRead-only schema and query access to relational databases: SQLite, PostgreSQL, MySQL, and more.
Sakila MCPMCP serverpantoniadesRead-only MySQL access with a fail-closed SQL classifier and structured query results.
MCP Toolbox for DatabasesMCP servergoogleapis16.9K starsConnects agents to enterprise databases for schema exploration and SQL execution across many engines.
postgresSkillsanjay3290/ai-skills660 installsRead-only PostgreSQL query skill that targets the right database by description and blocks writes.
MySQL MCP ServerMCP servermusaddiq-devRead-only MySQL access for listing databases, tables, and schemas, plus bounded SELECT queries.