Cursor / PostgreSQL / remote MCP

Connect Cursor to PostgreSQL.
Keep production access controlled.

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.

1 database + 1 link freeRemote HTTP MCPProject-scoped configuration
LIVE ROUTEACCESS POLICY / ENFORCED
SOURCEPostgreSQLschema discovered
GATEWAYdatamcpauth · policy · route
CLIENTCursorhosted MCP link
REQUESTtools/call → productionPOLICY CHECKED
AUTHOAuth 2.0
ACCESSScoped
SECRETSEncrypted
ROUTEHosted

The production path

Real database context inside Cursor

Cursor writes better SQL when it can inspect the real schema instead of guessing table names, columns, and relationships from application code. DataMCP exposes schema discovery and query tools through Cursor's native MCP support.

Unlike a local PostgreSQL MCP process, the hosted connection keeps the database password outside the developer machine. Create a separate MCP link for the project, define what it may do, and revoke it without rotating the underlying PostgreSQL credentials.

Looking for the exact configuration file and setup sequence? Start with the complete Cursor MCP setup guide, then follow the Cursor PostgreSQL tutorial for the database workflow.

What you get

Production access.
Without production guesswork.

01 / CAPABILITY
LI

Live schema context

Cursor can inspect tables, columns, relationships, indexes, and generated descriptions before writing SQL.

02 / CAPABILITY
RE

Remote MCP transport

Connect with one HTTPS endpoint instead of starting Node.js, Docker, or another local server process.

03 / CAPABILITY
SC

Scoped query access

Use read-only, read-write, full, or custom table-level permissions for the link assigned to Cursor.

04 / CAPABILITY
CR

Credential isolation

The PostgreSQL password stays encrypted server-side and never appears in .cursor/mcp.json.

05 / CAPABILITY
SE

Separate project links

Give each codebase or environment a distinct MCP link with its own policy and revocation path.

06 / CAPABILITY
PO

PostgreSQL query activity

Review executed SQL, timing, row count, status, connection, and permission denials in one activity view.

Source to controlled MCP link

One. Two.
Three.

Connect the source once. DataMCP handles discovery, hosted transport, client authentication, and link policy.

Read the setup guide
  1. 01
    Connect PostgreSQL

    Add the database once and let DataMCP discover its schema, relationships, and available tools.

  2. 02
    Create a Cursor link

    Choose the database permissions and copy the generated remote MCP configuration.

  3. 03
    Add it to Cursor

    Place the server entry in project or global mcp.json and verify the tools in Cursor settings.

Build or use datamcp

Hosted Cursor MCP vs. a local PostgreSQL server

See what stays on your engineering backlog when the MCP runtime and control layer are managed for you.

CAPABILITYDATAMCPLocal PostgreSQL MCP
Cursor setupOne remote HTTPS URL

Command, package, runtime, and arguments

Database secretEncrypted outside mcp.json

Local config or environment variable

Access policySeparate policy per Cursor link

Usually one PostgreSQL role

Team revocationDisable a user or link

Rotate shared credentials

Query activityCentral PostgreSQL activity view

Build from local and database logs

Frequently asked questions

Questions before
you connect.

Clear answers about architecture, access, credentials, and supported clients.

01

How does Cursor connect to PostgreSQL through MCP?

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.

02

Where do I add the DataMCP URL in 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.

03

Does Cursor receive my PostgreSQL password?

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.

04

Can Cursor be limited to read-only queries?

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.

05

Is a local Node.js or Docker process required?

No. Cursor supports remote HTTP MCP servers, so DataMCP runs the server and transport. Cursor connects to the hosted HTTPS endpoint directly.

06

Can I try Cursor PostgreSQL MCP for free?

Yes. The DataMCP Free plan includes one PostgreSQL connection and one MCP link, enough to verify schema discovery, an allowed read-only query, and a denied write before expanding the setup.

Start with one link

Give Cursor the schema, not the password

Connect one PostgreSQL database and create one hosted Cursor MCP link for free. No local server and no credit card.