Serverless document database
## Fauna MCP Server: Serverless Document Database The **Fauna MCP Server** integrates Fauna into Google Antigravity, enabling serverless database operations with ACID transactions, GraphQL, and global distribution directly from your development environment. ### Why Fauna MCP? - **Serverless**: No infrastructure to manage - **Global**: Multi-region with strong consistency - **ACID Transactions**: True transactions across documents - **GraphQL Native**: Built-in GraphQL support - **Flexible Schema**: Document and relational capabilities ### Key Features #### 1. FQL Queries ```python # Query documents result = await mcp.query(""" users.where(.status == "active") .order(.created_at, "desc") .take(10) .map(user => { id: user.id, name: user.name, email: user.email }) """) for user in result["data"]: print(f"User: {user['name']}") ``` #### 2. Document Operations ```python # Create document doc = await mcp.query(""" users.create({ name: "John Doe", email: "john@example.com", status: "active", created_at: Time.now() }) """) # Update document await mcp.query(""" users.byId("123456").update({ status: "premium", upgraded_at: Time.now() }) """) # Delete document await mcp.query("""users.byId("123456").delete()""") ``` #### 3. Transactions ```python # Multi-document transaction result = await mcp.query(""" let sender = accounts.byId("acc_sender") let receiver = accounts.byId("acc_receiver") if (sender.balance >= 100) { sender.update({ balance: sender.balance - 100 }) receiver.update({ balance: receiver.balance + 100 }) transfers.create({ from: sender.id, to: receiver.id, amount: 100, timestamp: Time.now() }) } else { abort("Insufficient funds") } """) ``` #### 4. Index Operations ```python # Create index await mcp.query(""" Collection.create({ name: "users", indexes: { byEmail: { terms: [{ field: ".email" }], unique: true }, byStatus: { terms: [{ field: ".status" }], values: [{ field: ".created_at", order: "desc" }] } } }) """) # Query with index result = await mcp.query(""" users.byEmail("john@example.com") """) ``` ### Configuration ```json { "mcpServers": { "fauna": { "command": "npx", "args": ["-y", "@anthropic/mcp-fauna"], "env": { "FAUNA_SECRET": "your-fauna-secret", "FAUNA_ENDPOINT": "https://db.fauna.com" } } } } ``` ### Use Cases **Serverless Apps**: Database for serverless and edge functions. **Global Apps**: Multi-region apps with consistency. **E-commerce**: Shopping carts with ACID transactions. **Real-Time Apps**: Event-driven applications with streams. The Fauna MCP enables serverless database operations within your development environment.
{
"mcpServers": {
"fauna": {
"mcpServers": {
"fauna": {
"env": {
"FAUNA_SECRET": "your-fauna-secret"
},
"args": [
"-y",
"fauna-mcp-server"
],
"command": "npx"
}
}
}
}
}