A Model Context Protocol (MCP) server that provides tools for interacting with a PostgreSQL database. It enables AI assistants to execute SQL
A Model Context Protocol (MCP) server that provides tools for interacting with a PostgreSQL database. It enables AI assistants to execute SQL queries, explain
Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.
Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.
| Tool | What it does |
|---|---|
| read_query | Executes a SELECT SQL query. |
| write_query | Executes an INSERT, UPDATE, or DELETE SQL query. |
| create_table | Executes a CREATE TABLE SQL statement. |
| list_tables | Lists all user-created tables in the database. |
| explain_query | Returns the execution plan for a given SQL query. |
| stdio | The server communicates over standard input and output. This is the default mode and is ideal for local testing or direct integration with command-line-based MCP clients. |
| streamableHttp | The server uses the Streamable HTTP transport, a more modern and flexible HTTP-based transport for MCP. |
{
"mcpServers": {
"pgsql-mcp-server": {
"command": "/path/to/pgsql-mcp-server",
"args": [],
"env": {
"DB_HOST": "localhost",
"DB_PORT": "5432",
"DB_NAME": "postgres",
"DB_USER": "your_username",
"DB_PASSWORD": "YOUR_DB_PASSWORD",
"DB_SSLMODE": "disable",
"SERVER_MODE": "stdio"
},
"disabled": false,
"autoApprove": []
}
}
}From the project documentation. Replace placeholders and example paths before connecting.
| Variable | Description | Required |
|---|---|---|
| DB_HOST | Declared in the maintainer’s client configuration. | Check documentation |
| DB_PORT | Declared in the maintainer’s client configuration. | Check documentation |
| DB_NAME | Declared in the maintainer’s client configuration. | Check documentation |
| DB_USER | Declared in the maintainer’s client configuration. | Check documentation |
| DB_PASSWORD | Declared in the maintainer’s client configuration. | Check documentation |
| DB_SSLMODE | Declared in the maintainer’s client configuration. | Check documentation |
| SERVER_MODE | Declared in the maintainer’s client configuration. | Check documentation |
Inspect PostgreSQL schemas and run read-only queries with the archived MCP reference server. Review its maintenance status before choosing it.
Connect the Notion MCP server to search workspace content and work with pages and databases through Notion’s hosted OAuth service.
Use the Supabase MCP server to inspect database schemas, query project data and retrieve docs through a project-scoped connection.
Query, modify and analyse local SQLite databases in conversation — the fastest way to chat with a data file.
Metabase ships its own MCP endpoint — search your BI content, build and run queries, and save questions and dashboards without leaving the chat.
Official MongoDB server covering data, schemas and Atlas management — from find queries to spinning up clusters.