inspect_schemaRead only · schemaCursor finds the real column and index names before editing the code.
Cursor / PostgreSQL / remote MCP
Give Cursor your live schema and approved database tools through a hosted MCP link. Keep PostgreSQL credentials out of mcp.json, choose read-only or custom access, and see every query Cursor runs.
18 const renewal = await db
19 .from("subscriptions")
20 .where(eq(status, "past_due"));
21
22 return renewal;
Check the production schema and fix this query without changing data.
The table uses billing_status, not status. I'll update the filter and keep the query read-only.
What the editor actually gets
Cursor calls one project-scoped MCP link. datamcp discovers the live schema, checks every requested tool, and returns only the approved result.
datamcp discovers tables, columns, relationships, indexes, and available query tools.
Choose read-only, read-write, or custom table permissions for this codebase.
Place the remote server in the project or global MCP configuration.
Cursor can inspect the real schema before it writes or explains SQL.
Work with the real system
The agent can inspect only the tools and data exposed by the MCP link assigned to this project.
inspect_schemaRead only · schemaCursor finds the real column and index names before editing the code.
query_databaseRead only · 64 rowsThe agent compares application changes with approved live query results.
insert_rowsWrite allowed · 1 rowThe write runs only when the link, PostgreSQL role, and table policy all allow it.
Set up Cursor
Use project configuration when the database belongs to one repository. Use a user-level server only when the same boundary genuinely applies everywhere.
Open the complete setup guide →Use a dedicated database role with the minimum permissions the project needs.
Choose the permission preset and copy the generated remote configuration.
Prefer `.cursor/mcp.json` for repository-specific access and verify the tools in Cursor settings.
Confirm the useful query works and an operation outside policy fails.
Project context, not blanket access
The editor configuration points to an MCP endpoint. It does not need the PostgreSQL password to discover the schema or run approved tools.
Hosted or local
A local server is valid for one machine. A hosted link matters when the same controlled connection must survive beyond that laptop.
Before you connect
Configuration, credentials, permissions, hosting, and the limits that matter in a real project.
Cursor connects to a remote datamcp endpoint using its MCP configuration. datamcp authenticates the link, provides schema tools, validates query permissions, runs approved SQL against PostgreSQL, and returns the result to Cursor.
Add the remote MCP server to .cursor/mcp.json for a project-specific connection or to ~/.cursor/mcp.json for a global connection. Project configuration is usually safer for database access because it keeps the connection scoped to the relevant codebase.
No. Cursor receives the hosted MCP endpoint and its authentication details. The PostgreSQL connection string remains encrypted on datamcp and is never written into Cursor's MCP configuration.
Yes. Create a read-only MCP link to allow SELECT queries while blocking writes and DDL. Custom table-level permissions can narrow different parts of the schema to specific operations.
No. Cursor supports remote HTTP MCP servers, so datamcp runs the server and transport. Cursor connects to the hosted HTTPS endpoint directly.
Yes. Free includes one PostgreSQL connection and one MCP link forever, enough to verify schema discovery and permissions without a paid subscription.
Start with one link
Connect one PostgreSQL database and create one hosted Cursor MCP link free forever. Upgrade only when you need more sources or links.