# Firestore Collection MCP

> Google Firestore Collection MCP gives your AI agent a secure, dedicated NoSQL database for structured data storage. It lets your client perform precise operations like querying, creating new records, and updating existing documents within one specific Google Firestore collection. This is perfect for giving agents a safe place to track chat histories or process project states without touching critical cloud databases.

## Overview
- **Category:** industry-titans
- **Price:** Free
- **Tags:** nosql, document-database, data-persistence, structured-data, cloud-database

## Description

Your AI agent suddenly gets a dedicated memory bank. Instead of forcing it to store complex data in messy text blocks, this MCP gives your client the ability to manage structured information directly inside one Firestore collection. Think of it as a single, protected filing cabinet for all your project's temporary or persistent data.

It strips away dangerous global database permissions, giving your agent only surgical access to that specific spot. Your AI can safely read documents, write new ones, and modify fields in place—all without the risk of damaging other parts of your cloud setup. This controlled environment is huge for building reliable agents. When you connect this MCP via Vinkius, you get instant, contained database power for anything from storing chat threads to running complex workflow results.

It’s a simple, scalable NoSQL connection that lets your agent behave like it has its own internal memory and state machine.

## Tools

### delete_document
This tool removes an entire document from the specified Firestore collection by its ID.

### get_document
It retrieves all the field data associated with a specific document ID within the configured collection.

### set_document
This tool creates a new document or updates an existing one in the collection, allowing you to write structured JSON data.

## Prompt Examples

**Prompt:** 
```
Get the document with ID 'task-99'.
```

**Response:** 
```
I've retrieved document 'task-99'. The fields indicate its status is currently 'in-progress'.
```

**Prompt:** 
```
Save this workflow result to a new document 'result-123': {"status": "done", "score": 95}.
```

**Response:** 
```
I've successfully written the JSON data to the document 'result-123' in the collection.
```

**Prompt:** 
```
Delete the temporary 'draft-01' document.
```

**Response:** 
```
The document 'draft-01' has been deleted successfully.
```

## Capabilities

### Read data records
Your AI client reads an entire document or specific fields from the configured Firestore collection.

### Write new documents
The agent creates a brand-new record in the collection, assigning it all necessary structured information.

### Update existing records
Your AI client modifies specific fields within an already existing document without affecting other data points.

### Remove old documents
The agent deletes a targeted record from the collection when it's no longer needed.

## Use Cases

### Building multi-step forms
A user fills out a complex application over several days. Instead of losing the progress, the agent uses `set_document` to save the current draft state every time the user leaves a page, allowing for seamless pick-up later.

### Tracking customer service chats
The agent handles a conversation. After it's resolved, it uses `set_document` to write a summary and resolution code into the collection, making that record immediately available for future support agents to review.

### Managing project task boards
A team leader asks the agent to check the status of 'Task Alpha'. The agent uses `get_document` to pull the latest state from the document, confirming it's moved from 'In Review' to 'Complete'.

### Cleaning up temporary data
After a background job runs and generates millions of log entries, the agent uses `delete_document` to purge old or temporary records that are no longer needed for analysis.

## Benefits

- Safe Data Storage: The system locks the agent to one collection. It can’t accidentally query or mess with other, more critical production databases.
- Full CRUD Operations: You gain full read, write, update, and delete capabilities (CRUD) using tools like `get_document`, ensuring your agent can manage data lifecycle completely.
- Context Persistence: Agents can reliably save complex workflow results—like a long-form report's score or status—using `set_document` so the next user session starts with accurate context.
- Structured Memory: Instead of dumping everything into one giant prompt, you store structured memories in Firestore. This keeps the data clean and easily searchable via `get_document`.
- Clean Cleanup: When a document or chat history is finished, use `delete_document` to remove it completely, preventing unnecessary bloat and keeping your collection tidy.

## How It Works

The bottom line is you give your agent one controlled, secure endpoint where it can read, write, and modify specific records without any risk of collateral damage across your main databases.

1. You connect your AI client to this MCP via Vinkius, designating which specific Firestore collection the agent can interact with.
2. Your agent decides it needs data—maybe it needs a user's last five interactions or a project's current status. It calls the relevant tool (like getting or setting a document).
3. The MCP executes that call securely against the designated single collection, returning the structured data back to your AI client for immediate use.

## Frequently Asked Questions

**Does Google Firestore Collection MCP support complex SQL joins?**
No, it is designed for NoSQL document operations. It manages individual records within one collection using tools like `get_document` and `set_document`, not relational joins.

**Is my data secure when I use the Google Firestore Collection MCP?**
Yes, security is paramount. This MCP limits your agent's access to a single collection only, preventing it from touching other sensitive parts of your cloud infrastructure.

**How do I delete old chat logs using the Google Firestore Collection MCP?**
You use the `delete_document` tool. You simply provide the unique document ID for the chat session, and the agent removes that entire record from the collection.

**Can this MCP store structured JSON data?**
Absolutely. The primary function of the MCP is to allow you to write rich, structured data—like workflow results or user profiles—using `set_document` into the NoSQL format.

**What if I need to update only one field in a document?**
You use the `set_document` tool. This allows you to target and modify specific fields within an existing record without overwriting all the other data points.