postgres
v1.0.8MCP server for interacting with PostgreSQL databases
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
pg-query
This tool executes SQL queries in a READ ONLY session connected to a PostgreSQL database. If no active connection exists, it uses MCP server registration argument and environment variables PG_USER and PG_PASSWORD. You should: Execute the provided SQL query. Return the results in Toon format. Args: sql: The SQL query to execute. The `model` argument should specify only the name and version of the LLM (Large Language Model) you are using, with no additional information. The `mcp_client` argument should specify only the name of the MCP (Model Context Protocol) client you are using, with…
| Parameter | Type | Description |
|---|---|---|
mcp_client * | string | Specify the name and version of the MCP client implementation being used (e.g. Copilot, Claude, Cline...) |
model * | string | The name (and version) of the language model being used by the MCP client to process requests (e.g. gpt-4.1, claude-sonnet-4, llama4...) |
sql * | string | The SQL query to execute |
pg-stats
Get comprehensive statistics for a specific PostgreSQL table. This tool retrieves detailed information including row counts, table size, index information, column statistics, and other metadata that can help optimize queries and understand data distribution. Args: name: The name of the table to get statistics for. The `model` argument should specify only the name and version of the LLM (Large Language Model) you are using, with no additional information. The `mcp_client` argument should specify only the name of the MCP (Model Context Protocol) client you are using, with no additional info…
| Parameter | Type | Description |
|---|---|---|
name * | string | The name of the table to get statistics for |
mcp_client | string | Specify the name and version of the MCP client implementation being used (e.g. Copilot, Claude, Cline...) |
model | string | The name (and version) of the language model being used by the MCP client to process requests (e.g. gpt-4.1, claude-sonnet-4, llama4...) |
pg-explain
Generate and display the execution plan for a given SQL query using PostgreSQL's EXPLAIN command. This tool helps you understand how PostgreSQL will execute your query, including information about table scans, joins, indexes used, and estimated costs. Args: sql: The SQL query to explain. The `model` argument should specify only the name and version of the LLM (Large Language Model) you are using, with no additional information. The `mcp_client` argument should specify only the name of the MCP (Model Context Protocol) client you are using, with no additional information. Returns: Detail…
| Parameter | Type | Description |
|---|---|---|
mcp_client * | string | Specify the name and version of the MCP client implementation being used (e.g. Copilot, Claude, Cline...) |
model * | string | The name (and version) of the language model being used by the MCP client to process requests (e.g. gpt-4.1, claude-sonnet-4, llama4...) |
sql * | string | The SQL query to explain |
pg-connect
Provides an interface to connect to a specified PostgreSQL database. If a database connection is already active, the tool will close the existing connection before establishing a new one. This tool accepts three required parameters: connectionString: The PostgreSQL connection string without embedded credentials (e.g., postgresql://host:port/dbname or host:port/dbname). To enable encryption (SSL), append ?sslmode=require to the connection string. user: The PostgreSQL username password: The PostgreSQL password The credentials are stored in environment variables PG_USER and PG_PASSWORD for…
| Parameter | Type | Description |
|---|---|---|
connectionString * | string | The PostgreSQL connection string (e.g. postgresql://host:port/dbname or host:port/dbname) |
password * | string | The PostgreSQL password |
user * | string | The PostgreSQL user (e.g. postgres) |
mcp_client | string | Specify the name and version of the MCP client implementation being used (e.g. Copilot, Claude, Cline...) |
model | string | The name (and version) of the language model being used by the MCP client to process requests (e.g. gpt-4.1, claude-sonnet-4, llama4...) |
pg-awr
Generate a PostgreSQL performance report similar to Oracle AWR. Includes database statistics, top queries (requires pg_stat_statements extension), table/index statistics, connection info, and optimization recommendations.
| Parameter | Type | Description |
|---|---|---|
mcp_client | string | Specify the name and version of the MCP client implementation being used (e.g. Copilot, Claude, Cline...) |
model | string | The name (and version) of the language model being used by the MCP client to process requests (e.g. gpt-4.1, claude-sonnet-4, llama4...) |