Fast Neon Postgres operations via FGP daemon. Query databases, manage branches, and explore schemas without MCP cold-start overhead.
git clone https://github.com/fast-gateway-protocol/neon.git
cd fgp-neon
cargo build --releaseRequirements:
- Rust 1.70+
- Neon API key (
NEON_API_KEYenv var) - Neon org ID (
NEON_ORG_IDenv var)
# Set your Neon credentials
export NEON_API_KEY="neon_api_xxxxx"
export NEON_ORG_ID="org-xxxxx"
# Start the daemon
./target/release/fgp-neon start
# List projects
fgp call neon.projects
# List branches
fgp call neon.branches '{"project_id": "proj-xxxxx"}'
# Run SQL query
fgp call neon.sql '{"project_id": "proj-xxxxx", "branch_id": "br-xxxxx", "query": "SELECT * FROM users LIMIT 5"}'
# Stop daemon
./target/release/fgp-neon stop| Method | Params | Description |
|---|---|---|
neon.projects |
limit (default: 10) |
List all projects |
neon.project |
project_id (required) |
Get project details |
neon.branches |
project_id (required) |
List branches for a project |
neon.databases |
project_id, branch_id (required) |
List databases |
neon.tables |
project_id, branch_id, database |
List tables |
neon.schema |
project_id, branch_id, database, table |
Get table schema |
neon.sql |
project_id, branch_id, database, query |
Run SQL query |
neon.user |
- | Get current user info |
Socket: ~/.fgp/services/neon/daemon.sock
Request:
{"id": "uuid", "v": 1, "method": "neon.sql", "params": {"project_id": "proj-xxx", "branch_id": "br-xxx", "query": "SELECT 1"}}Response:
{"id": "uuid", "ok": true, "result": {"rows": [{"?column?": 1}]}}| Operation | FGP Daemon | MCP stdio | Speedup |
|---|---|---|---|
| List projects | ~180ms | ~2,400ms | 13x |
| Run SQL | ~120ms | ~2,400ms | 20x |
FGP keeps the API connection warm and reuses auth tokens.
- AI agents: Fast database queries for RAG pipelines
- Schema exploration: Quick table/column lookups
- Branch management: Create/switch branches programmatically
- Data validation: Run checks without connection overhead
Symptom: Requests fail with 401 or "unauthorized"
Solutions:
- Verify key is set:
echo $NEON_API_KEY - Check key format: should start with
neon_api_ - Generate new key at https://console.neon.tech/app/settings/api-keys
Symptom: "Project not found" for existing project
Check:
- Project ID is correct (format:
proj-xxxxx) - API key has access to the project
- List projects first:
fgp call neon.projects
Symptom: "Branch not found" when querying
Check:
- Branch ID format:
br-xxxxx - Branch belongs to specified project
- List branches:
fgp call neon.branches '{"project_id": "proj-xxx"}'
Symptom: Queries fail with syntax or permission errors
Check:
- SQL syntax is valid for Postgres
- Table/column names are correct
- User has SELECT permissions on target tables
- Database name is specified if not using default
Symptom: Queries hang or timeout
Solutions:
- Neon databases auto-suspend after inactivity
- First query may take 1-2s to wake the database
- Check Neon status: https://neon.tech/status
- Verify branch is not suspended in console
Symptom: Queries return empty when data exists
Check:
- Correct database specified (default is
neondb) - Schema is correct (default is
public) - Table has data:
SELECT COUNT(*) FROM table_name
Symptom: "Connection refused" when calling daemon
Solution:
# Check daemon is running
pgrep -f fgp-neon
# Restart daemon
./target/release/fgp-neon stop
export NEON_API_KEY="neon_api_xxxxx"
./target/release/fgp-neon start
# Verify socket
ls ~/.fgp/services/neon/daemon.sockSymptom: 429 errors on bulk operations
Solutions:
- Neon has API rate limits
- Add delays between rapid queries
- Use connection pooling for high-frequency access
MIT