The credential and the private database route
- PostgreSQL password and connection string
- Local socket or private database endpoint
- The agent's read-only or read-write ceiling
Local Agent Tunnel / private PostgreSQL
Run the official @datamcp/agent beside PostgreSQL on EC2, a VPS, or Docker. It connects outbound and turns that private database into a scoped hosted MCP link. The password stays on your machine. SQL and results pass through datamcp cloud.
npx @datamcp/agent ro "$DATABASE_URL" \\--connection-id "conn_••••••"Connected to datamcp cloud
PostgreSQL schema synchronized
Read-only ceiling enabled
The actual boundary
Local Agent changes how datamcp reaches PostgreSQL. It does not turn the hosted service into an on-premises data plane.
Run it where PostgreSQL already lives
The agent only needs two routes: one to PostgreSQL and one outbound connection to datamcp.
Run the agent on the application or database host, or on another instance that can reach PostgreSQL through the VPC.
Private subnet + outbound HTTPSKeep PostgreSQL bound to localhost or a private interface while the agent maintains the remote datamcp session.
localhost:5432 + system serviceRun the public npm package in a small container beside PostgreSQL and provide its connection settings through environment variables.
Host network or private Docker networkFrom private database to MCP link
Choose Local Agent in the datamcp dashboard and save the generated connection ID and one-time token.
Start the public npm package on EC2, a VPS, or Docker with a local database URL and the generated credentials.
Wait for the agent to come online, sync the schema, then create a scoped hosted MCP link for the client.
DATAMCP_AGENT_TOKEN="••••••••" npx @datamcp/agent ro \
"$DATABASE_URL" \
--connection-id "conn_••••••"agent connected
schema ready
MCP link available
ro and a SELECT-only PostgreSQL role. Add write access only when every permission layer is ready.Choose the right connection path
Both produce a hosted HTTPS MCP link. The difference is how datamcp reaches PostgreSQL and where the database password is stored.
In both paths, SQL requests and query results pass through datamcp cloud.
Before you install
No vague private-cloud promises. These are the boundaries that matter before PostgreSQL handles a remote AI request.
Local Agent Tunnel connects a private PostgreSQL database to the hosted datamcp service. You create a Local Agent connection, run @datamcp/agent on a machine that can reach PostgreSQL, sync the schema, and create a normal hosted MCP link for compatible AI clients.
No. The agent initiates the connection outbound to datamcp, so the database does not need a public IP or an inbound internet rule. The agent machine must be able to reach PostgreSQL and make outbound HTTPS connections.
No. The PostgreSQL password stays on the agent machine, but SQL requests and query results pass through the datamcp cloud so the hosted MCP endpoint can serve the connected AI client.
No. The current tunnel supports PostgreSQL only. Use the standard hosted connection paths for MySQL and OpenAPI sources.
Yes. Run the agent in read-only mode and use a PostgreSQL role with SELECT-only grants. For a write to succeed, the agent mode, MCP-link policy, datamcp user permissions, and PostgreSQL role must all allow it.
Run it on a machine that can reach the database, including an EC2 instance, Linux VPS, or Docker host. Private EC2 can connect outbound through a NAT gateway or approved proxy without a public IP.
There is no separate tunnel add-on fee. Local Agent is available on Starter, Pro, and Enterprise. Its connection uses one normal source slot, and its MCP link uses one normal MCP-link slot.
Start with one link
Local Agent is available on Starter, Pro, and Enterprise. It uses the standard source and MCP-link capacity in your plan, with no separate tunnel add-on fee.