MCP PostgreSQL Explorer
Provides tools for exploring a PostgreSQL database schema and running read-only queries, including listing tables, describing table columns and constraints, executing SELECT queries, and retrieving foreign key relationships.
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., "@MCP PostgreSQL Explorerlist all tables in the public schema"
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 PostgreSQL Explorer
MCP PostgreSQL Explorer is a TypeScript MCP server that lets AI clients explore a PostgreSQL database schema and run read-only queries.
This is my first project of this kind. I am a computer science student building it to learn how MCP servers, TypeScript, PostgreSQL introspection, and database tooling work together.
Features
Lists base tables in a PostgreSQL schema.
Describes table columns, data types, defaults, nullability, and constraints.
Runs
SELECT-only queries.Lists foreign key relationships between tables.
Uses
publicas the default schema, with an optional schema override.
Related MCP server: MCP PostgreSQL Server
Tools
list_tables
Lists base tables in a schema.
Default:
{
"schema": "public"
}describe_table
Describes a table in a schema.
{
"schema": "public",
"table": "users"
}execute_query
Runs a read-only PostgreSQL query.
{
"query": "SELECT * FROM users LIMIT 10",
"params": []
}The tool rejects mutations, semicolons, and non-SELECT statements.
get_relationships
Lists foreign key relationships for tables in a schema.
{
"schema": "public"
}Tech Stack
TypeScript
Node.js
@modelcontextprotocol/sdkpgPostgreSQL system catalogs and
information_schema
Setup
Install dependencies:
npm installSet your database connection string:
export DATABASE_URL="postgres://user:password@localhost:5432/database_name"On Windows PowerShell:
$env:DATABASE_URL="postgres://user:password@localhost:5432/database_name"Run
npx tsx src/index.tsType Check
npx tsc --noEmitTool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
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 Connectors
Generate, fix, explain and run read-only SQL on PostgreSQL, MySQL and SQL Server
1Query 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.
Deterministic safety, correctness & cost gate that vets Postgres SQL before your AI agent runs it.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to safely interact with PostgreSQL databases through read-only operations, providing schema discovery, table inspection, and query execution capabilities with structured context awareness.MIT
- AlicenseNot gradedqualityCmaintenanceEnables secure read-only access to PostgreSQL databases, allowing users to list tables, query schemas, execute SELECT statements, and inspect table structures through natural language interactions.7514MIT
- FlicenseAqualityDmaintenanceEnables AI agents to inspect and query PostgreSQL databases safely, with features like listing tables, retrieving schemas, and running read-only SQL queries.3-
- FlicenseNot gradedqualityDmaintenanceEnables querying and inspecting a PostgreSQL database, including executing SQL queries, listing schemas and tables, and describing table columns.-
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/arseniytech/MCPPostgreSQLExplorer'
If you have feedback or need assistance with the MCP directory API, please join our Discord server