Skip to main content
Glama
shubham4038

postgres-mcp-js

by shubham4038

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
ACCESS_MODENoAccess mode: restricted (read-only, 30s timeout) or unrestricted (full read/write). Default: restrictedrestricted
DB_PRIMARY_URLYesPostgreSQL connection URL for the primary database (required). Example: postgresql://user:password@localhost:5432/mydb
DB_REPLICA_URLNoPostgreSQL connection URL for a secondary database (optional)
DB_PRIMARY_NAMENoAlias for the primary database (default: primary)primary
DB_REPLICA_NAMENoAlias for the replica database (default: replica)replica

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
list_databasesA

List configured database aliases. Use the returned names in the "database" parameter of other tools.

list_schemasA

List all schemas in the database.

list_objectsB

List tables, views, sequences, or extensions in a schema.

get_object_detailsC

Get columns, constraints, and indexes for a table or view.

execute_sqlA

Execute a read-only SQL query (SELECT, EXPLAIN, SHOW, WITH). Write operations are blocked. Max execution time: 30 seconds.

explain_queryA

Get the query execution plan. Supports hypothetical index simulation (requires hypopg extension).

get_top_queriesB

Report the slowest or most resource-intensive queries using pg_stat_statements.

analyze_db_healthB

Run comprehensive database health checks across multiple dimensions.

analyze_workload_indexesB

Analyze query workload from pg_stat_statements and recommend missing indexes.

analyze_query_indexesA

Analyze specific SQL queries and identify missing indexes. Maximum 10 queries.

detect_index_missesB

Detect tables likely suffering from missing indexes: seq-scan dominance, FK columns without indexes, under-indexed hot tables.

analyze_locksB

Detect lock contention: blocking chains, long-running queries, idle-in-transaction sessions.

analyze_table_bloatB

Detect table and index bloat from dead tuples. Returns vacuum recommendations.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

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/shubham4038/postgres-mcp-js'

If you have feedback or need assistance with the MCP directory API, please join our Discord server