Serverless Postgres database
## Neon MCP Server: Serverless Postgres The **Neon MCP Server** integrates Neon serverless Postgres into Google Antigravity, enabling database operations with branching, autoscaling, and instant provisioning directly from your development environment. ### Why Neon MCP? - **Serverless**: Scale to zero, pay for what you use - **Branching**: Git-like database branching - **Instant Start**: Sub-second cold starts - **Postgres Compatible**: Full PostgreSQL compatibility - **Autoscaling**: Automatic compute scaling ### Key Features #### 1. SQL Queries ```python # Execute query result = await mcp.query(""" SELECT id, name, email, created_at FROM users WHERE status = $1 ORDER BY created_at DESC LIMIT 50 """, params=["active"]) for row in result["rows"]: print(f"User: {row['name']} ({row['email']})") ``` #### 2. Branch Operations ```python # Create branch branch = await mcp.create_branch( parent_id="main", name="feature-user-auth" ) print(f"Branch created: {branch['id']}") print(f"Connection string: {branch['connection_string']}") # List branches branches = await mcp.list_branches() for b in branches: print(f"Branch: {b['name']} ({b['state']})") # Delete branch await mcp.delete_branch(branch_id=branch["id"]) ``` #### 3. Project Management ```python # Get project info project = await mcp.get_project() print(f"Project: {project['name']}") print(f"Region: {project['region_id']}") # Get endpoints endpoints = await mcp.list_endpoints() for ep in endpoints: print(f"Endpoint: {ep['host']} ({ep['type']})") # Get consumption usage = await mcp.get_consumption() print(f"Compute: {usage['compute_seconds']}s") print(f"Storage: {usage['storage_bytes'] / 1024 / 1024}MB") ``` #### 4. Database Operations ```python # Create database await mcp.create_database(name="myapp_staging") # List databases databases = await mcp.list_databases() for db in databases: print(f"Database: {db['name']}") # Create role await mcp.create_role( name="readonly", password="secure-password" ) ``` ### Configuration ```json { "mcpServers": { "neon": { "command": "npx", "args": ["-y", "@anthropic/mcp-neon"], "env": { "NEON_API_KEY": "your-api-key", "NEON_PROJECT_ID": "your-project-id", "DATABASE_URL": "postgres://user:pass@host/db" } } } } ``` ### Use Cases **Development Branches**: Create database branches for features. **CI/CD**: Spin up test databases for pipelines. **Serverless Apps**: Database for serverless functions. **Cost Optimization**: Pay only for actual usage. The Neon MCP enables serverless Postgres within your development environment.
{
"mcpServers": {
"neon": {
"mcpServers": {
"neon": {
"env": {
"NEON_API_KEY": "your-neon-api-key"
},
"args": [
"-y",
"@neondatabase/mcp-server-neon"
],
"command": "npx"
}
}
}
}
}