Outbound connection
The agent initiates the tunnel to datamcp, so PostgreSQL does not need public inbound access.
Local Agent Tunnel / private PostgreSQL
Run @datamcp/agent beside PostgreSQL on EC2, a VPS, or Docker. The agent connects outbound to datamcp, then your AI clients use a scoped hosted MCP link. The database password stays on the agent machine; SQL requests and results pass through datamcp cloud.
Direct answer
Create a Local Agent connection in datamcp, run @datamcp/agent on a machine with private PostgreSQL access, sync the schema, and create a scoped hosted MCP link. The agent initiates the network connection outbound.
The production path
Direct hosted PostgreSQL connections require datamcp cloud to reach the database. Local Agent Tunnel changes that network direction: @datamcp/agent runs inside the environment that already reaches PostgreSQL and establishes the connection outbound. You do not add a public PostgreSQL rule or expose port 5432 to datamcp.
This does not make the datamcp data plane local. The agent executes approved operations near the database, but the SQL request and returned rows travel through datamcp cloud to the hosted MCP client. Use it when keeping the database credential and inbound network path local solves your architecture requirement. Do not use it when query data is prohibited from traversing a hosted service.
For ordinary public or allowlisted PostgreSQL endpoints, use the standard hosted PostgreSQL connection. For the broader control-layer model, review the hosted MCP gateway.
What you get
The agent initiates the tunnel to datamcp, so PostgreSQL does not need public inbound access.
Keep the PostgreSQL password in the agent environment instead of storing it in every AI client or the cloud connection.
Use the same stable HTTPS MCP workflow in compatible remote clients after the agent comes online.
Writes require the agent, MCP link, datamcp user, and PostgreSQL role to permit the operation.
Sync the PostgreSQL schema through the connected agent before creating and testing the MCP link.
Local Agent uses the normal source and MCP-link allowances. There is no tunnel add-on price.
Source to controlled MCP link
Connect the source once. datamcp handles discovery, hosted transport, client authentication, and link policy.
Read the setup guideIn the datamcp dashboard, choose New Connection, then Local Agent. Save the generated connection ID and one-time agent token.
Install the npm package on EC2, a VPS, or Docker, provide the local PostgreSQL URL, and choose read-only or read-write mode.
Wait for the agent to come online, sync the schema, create a scoped MCP link, and add that HTTPS endpoint to the AI client.
Build or use datamcp
See what stays on your engineering backlog when the MCP runtime and control layer are managed for you.
Reachable from datamcp cloud
Provider allowlist or public endpoint may be required
Stored encrypted in the datamcp connection
Pass through datamcp cloud
PostgreSQL or MySQL through their standard flows
Hosted HTTPS MCP link
Frequently asked questions
Clear answers about architecture, access, credentials, and supported clients.
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.
No. A Local Agent connection uses one normal source slot, and the MCP link it creates uses one normal MCP-link slot. Starter includes one source and one link, Pro includes three sources and five links, and Enterprise includes fifteen sources and fifty links.
Keep exploring
Follow the product flow from connection creation through schema sync and MCP-link setup.
GUIDECompare direct hosted PostgreSQL access with the private-network agent path.
GUIDEUnderstand client authentication, link policy, credentials, revocation, and activity evidence.
GUIDEKeep database-side authorization as an independent boundary beneath the MCP link.
GUIDEReview least privilege, credentials, logging, revocation, and incident handling.
GUIDESee how Local Agent consumes standard source and MCP-link slots across Starter, Pro, and Enterprise.
Start with one link
Start a 14-day Starter or Pro trial after adding a payment method. Local Agent uses one normal source slot, and its MCP endpoint uses one normal link slot.