postgres-mcp
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., "@postgres-mcpshow me the first 5 rows from the orders table"
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.
Getting started
Setup
Create .env file with your postgres db vars
"DB_HOST": "localhost",
"DB_PORT": "5432",
"DB_NAME": "<table>",
"DB_USER": "<user>",
"DB_PASSWORD": "<password>"npm inpm run buildEnsure your server script is executable:
chmod +x ./dist/server.js
Ensure the shebang line at the top of your compiled server.js:
#!/usr/bin/env node
Setup cursor mcp server:
In cursor go to: Settings > MCP Servers
{
"mcpServers": {
"postgres": {
"command": "node",
"args": ["./dist/server.js"],
"env": {
"DB_HOST": "localhost",
"DB_PORT": "5432",
"DB_NAME": "<db_name>",
"DB_USER": "<db_user>",
"DB_PASSWORD": "<password>"
}
}
}
}To test run in terminal:
echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/list", "params": {}}' | node dist/server.jsOnce you add it in cursor settings, restart cursor and then reopen and make sure it loads
To chat
Start a new chat and tell it to use your MCP server
Give me the first record in the table
Do not read my local code files - use the database MCP server instead.
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 Servers
- AlicenseAqualityAmaintenanceQuery and manage PostgreSQL databases from Claude Code, Cursor, and any MCP client, with read-only by default and built-in schema introspection, EXPLAIN, and performance diagnostics.Last updated211,2063MIT

pgEdge Postgres MCP Serverofficial
Alicense-qualityAmaintenanceEnables SQL queries against PostgreSQL databases through MCP-compatible clients and includes a natural language agent for forming SQL queries from natural language.Last updated210PostgreSQL- Alicense-qualityBmaintenanceEnables natural language interaction with PostgreSQL databases through MCP tools, with GitHub OAuth authentication and role-based access control.Last updatedMIT
- AlicenseAqualityDmaintenanceSupports CRUD and DDL operations on PostgreSQL databases via MCP, enabling query, insert, update, delete, and schema changes through natural language.Last updated610MIT
Related MCP Connectors
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
Analytical memory for AI agents: a real Postgres queried in plain English over MCP. One command.
GibsonAI MCP server: manage your databases with natural language
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/mattcat10/postgres-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server