Inspect database schemas and run read-only queries on PostgreSQL databases through MCP server.
PostgreSQL MCP enables Cursor to communicate with PostgreSQL's API directly through the Model Context Protocol. This integration lets AI assistants in Cursor access and manage PostgreSQL resources without requiring you to switch contexts.
Open Cursor and navigate to Settings → Features → MCP section to manage your Model Context Protocol connections.
Click the “+ Add New MCP Server” button and fill in the configuration details for PostgreSQL.
Enter the following information:
After adding the server, it should appear in your MCP servers list. Click the refresh button to confirm the tools are available.
Once you've set up the PostgreSQL MCP connection, Cursor can interact with PostgreSQL services directly. Here's how to use it:
Here are some ways you can leverage the PostgreSQL MCP integration:
Note:
MCP tools may not be compatible with all AI models in Cursor. For best results, use with Claude models which have the strongest MCP support.
Modal for searching tools