# Fauna MCP

> Fauna (Serverless DB) connects your AI agent directly to a Fauna serverless database. Use this MCP to run complex FQL queries, letting you read, write, or modify data collections and indexes entirely through natural conversation. Forget switching tabs; manage your entire data infrastructure right where you're already working.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Tags:** fauna, fql, serverless-database, nosql, database-management

## Description

Connecting your AI client to Fauna changes how developers interact with their databases. Instead of opening the dashboard and writing complex API calls manually, you talk to your agent and it handles the backend work using powerful FQL queries. You can tell your agent exactly what data you need—whether it's fetching a specific user profile or listing every collection in the database. It’s like having an expert developer sitting next to you who remembers all your table names and query structures. This ability means you never lose context, keeping your focus on the logic of your application, not the plumbing of your data layer. When you subscribe through Vinkius, you gain instant access to this powerful database management tool alongside thousands of others, making it a central piece of your development stack. You can pass complex JSON structures safely into queries and even inspect your schema without writing boilerplate code.

## Tools

### execute_fql
Runs any Fauna Query Language (FQL) command to read, create, update, or delete data in the database.

## Prompt Examples

**Prompt:** 
```
List all documents in the 'Products' collection using FQL.
```

**Response:** 
```
I'll execute `Products.all()` to fetch your documents. [Agent returns list of product documents from Fauna]
```

**Prompt:** 
```
Find a user document where the email is 'dev@example.com'.
```

**Response:** 
```
Running FQL query: `Users.byEmail('dev@example.com')`. I found one document with ID 3849201...
```

**Prompt:** 
```
Create a new entry in the 'Logs' collection with the message 'System started'.
```

**Response:** 
```
Executing `Logs.create({ message: 'System started' })`. The document has been successfully created with a new timestamp.
```

## Capabilities

### Execute data modifications
Run FQL commands to create new records, update existing ones, or delete specific entries in the database.

### Retrieve structured documents
Query indexes and collections to fetch specific user profiles or product details by criteria you define.

### Manage data structure metadata
List available collections and inspect the current schema of your database using standard FQL commands.

## Use Cases

### A user needs to find all products marked 'out of stock.'
Instead of building a complex search query in a separate tool, the user asks their agent: 'Find all documents in Products where inventory is zero.' The agent uses `execute_fql` to run the precise query and returns a list of IDs. Problem solved.

### A data engineer needs to log an unusual system event.
The engineer simply prompts: 'Create a new Log entry for 'System maintenance started' with timestamp.' The agent executes `execute_fql` and logs the record instantly, without touching any CLI or web form.

### A product team wants to verify user sign-up data.
The PM asks: 'Show me all user records created yesterday with a premium status.' The agent runs `execute_fql`, pulling the exact, filtered dataset needed for their report.

### A developer needs to test an update query before deployment.
The developer prompts: 'Pretend I'm updating user 456’s email. Run a dry-run check.' The agent runs `execute_fql` and returns the expected data structure without actually changing anything.

## Benefits

- Eliminate context switching. You manage your collections and indices directly within your AI agent, eliminating the need to jump between chat windows and the Fauna dashboard.
- Run full CRUD operations using natural language prompts. The `execute_fql` tool lets you read, write, update, or delete data without manually structuring complex API calls every time.
- Quickly validate logic for developers. Test FQL queries on live data to verify state changes immediately, making debugging much faster than running local scripts.
- Handle complex data inputs safely. You can pass structured JSON arguments into your queries using the tool's parameters field, ensuring clean and predictable execution.
- Inspect the whole system easily. Use the MCP to list collections or query indexes, giving you a real-time understanding of your database structure right from the chat.

## How It Works

The bottom line is you stop using the Fauna dashboard for quick checks; your AI client does the heavy lifting for you.

1. Subscribe to this MCP on Vinkius and provide your Fauna secret credentials.
2. Select this connection in your AI client, allowing it to authenticate against your database.
3. Ask your agent a question like 'List all records in the Orders collection' or 'Update user 123’s status,' and it executes the necessary FQL query.

## Frequently Asked Questions

**How does Fauna (Serverless DB) MCP work with my existing code?**
The MCP acts as a wrapper. Instead of your code having to make direct, complex API calls to the database, you tell your agent what action is needed, and it uses `execute_fql` to run the query for you.

**Can I only use this MCP for reading data?**
No. The `execute_fql` tool supports full CRUD capabilities. You can read documents, but you can also create new records or update existing ones with simple instructions.

**What kind of language does the execute_fql tool use?**
The tool executes Fauna Query Language (FQL). This is the standard query language for Fauna's serverless database, designed to handle complex data relationships efficiently.

**Is this MCP only for developers?**
Not necessarily. While built for developers, anyone who needs reliable access to structured business data—like product managers or analysts—can use it via natural language prompts.

**Does using Fauna (Serverless DB) MCP require changing my database structure?**
No. The MCP allows you to inspect and manage the schema, but the queries themselves are designed to read and write based on your existing definitions.