Works with the AI Agents you already use
remote postgres mcp
Deploy a PHP PostgreSQL MCP tunnel and connect Cursor or Claude Code to a remote database over HTTPS.
$10
remote postgres mcp
Example session with this skill installed
I need to connect Cursor to my remote Postgres database on a shared HostGator server. It only supports PHP. The URL will be https://myapp.com/db-bridge/.
- Read your context and instructions
- Compiled the remote postgres mcp
I will help you deploy the PHP tunnel and configure Cursor to access your remote PostgreSQL database.
Status
- Done: Identified environment (Shared Hosting/PHP)
- Blocked: Pending file upload and config
- Next: Upload tunnel files and create
config.php
PHP Tunnel Configuration
First, upload pg_mcp_tunnel.php to your server. Then, create a config.php file in the same directory with the following content. I have generated a secure 32-character token for you.
<?php
// config.php - Keep this file private
return [
'token' => 'b7f9a2e3c5d8e1f4a0b2c4d6e8f0a2b4',
'db' => [
'host' => '127.0.0.1',
'port' => 5432,
'dbname' => 'your_database_name',
'user' => 'your_username',
'password' => 'your_password',
],
'access_mode' => 'readonly', // Options: readonly, readwrite, full
'max_rows' => 1000,
'statement_timeout_ms' => 10000,
];
Cursor MCP Setup
Once the files are uploaded, open your Cursor settings, go to the MCP section, and add a new server with these settings:
{
"mcpServers": {
"remote-postgres": {
"command": "npx",
"args": ["-y", "pg-mcp-bridge"],
"env": {
"PG_MCP_TUNNEL_URL": "https://myapp.com/db-bridge/pg_mcp_tunnel.php",
"PG_MCP_TOKEN": "b7f9a2e3c5d8e1f4a0b2c4d6e8f0a2b4"
}
}
}
}
Next steps
- Upload the PHP files and
.htaccessto your server. - Run a connectivity test using:
curl -X POST https://myapp.com/db-bridge/pg_mcp_tunnel.php -H "Authorization: Bearer b7f9a2e3c5d8e1f4a0b2c4d6e8f0a2b4" -d '{"action":"ping"}' - Restart Cursor and run the
list_tablestool to verify access.
Connects securely to your tools. The creator never sees your data.
About this skill
Connecting an AI agent to a remote database often fails due to firewall restrictions or lack of Node.js support on shared hosting. This skill provides a secure bridge between Cursor or Claude Code and PostgreSQL using a PHP-based HTTP tunnel.
What it does
- Deploy tunnel architecture by setting up the
pg-mcp-bridgePHP component on any Apache/PHP server to act as a secure gateway. - Configure access levels by defining granular
readonly,readwrite, orfullpermissions to protect your data. - Automate client setup by generating the precise JSON or CLI configurations for Cursor and Claude Code.
- Verify connectivity using built-in ping and diagnostic tools to ensure the HTTPS bridge and bearer auth are functional.
- Enforce security hardening with
.htaccessrules and token-based authentication to prevent unauthorized database access.
How it works
- Environment Check: The skill verifies your server has the
pgsqlextension and HTTPS enabled. - Tunnel Deployment: You receive the necessary
pg_mcp_tunnel.phpandconfig.phptemplates for your server. - Verification: A Python or curl-based ping test validates the tunnel is active and the token is valid.
- Client Integration: The skill provides the
npxcommand and environment variables for your specific IDE or CLI tool.
Frameworks & tools
This skill utilizes PHP and Apache for the server-side tunnel. It integrates with the pg-mcp-bridge NPM package and is compatible with PostgreSQL databases. It supports Cursor and Claude Code via the Model Context Protocol (MCP).
Why this beats prompting it yourself
Manual setup often leads to broken environment variables or insecure configuration files. This skill follows a strict security checklist and architecture pattern that ensures your database credentials never leak into your git history or chat logs.
Use cases
- Querying a production or staging database directly from your AI code editor.
- Connecting AI agents to databases hosted on PHP-only shared hosting environments.
- Developing database-driven features with real-time schema awareness in Claude Code.
- Securely exposing a remote Postgres instance to local MCP clients over HTTPS.
Known limitations
The tunnel enforces a limit of one SQL statement per query call. You must have the PHP pgsql extension installed on your hosting provider.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 11 days ago
- Software
- Pg Bridge MCP
Node.js
Permissions
Allowed Hosts
What's inside
Frequently Asked Questions
New in LLM Ops
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.