# Azure Cosmos DB Container MCP for AI Agents AI Agent Connect

> Azure Cosmos DB Container MCP lets your AI agent manage documents in a single, specific Azure Cosmos DB Container. It handles queries, inserts, and updates without exposing your entire cloud infrastructure. It's the fastest way to give your agent a dedicated, scalable NoSQL data store for things like chat history or application state without the security headache of broad permissions.

## Overview
- **Category:** industry-titans
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_sR5SFdydHWMVwBi2kmwRkK1Y9eFVwnJ0PxFJe5pj/ai-agent-connect
- **Tags:** nosql, document-database, data-storage, scoped-access, cloud-database, json-storage

## Description

This Connector gives your agent a direct line to a specific Azure Cosmos DB container. Instead of dealing with complex IAM roles or broad database permissions that put your whole cloud environment at risk, you can give your agent surgical access to just one bucket of data. It's built for people who need to store structured information, like user profiles, session logs, or long-term memory for a chatbot, without opening the floodgates to their entire production environment. You can ask your agent to pull specific records using SQL queries, add new entries, or clean up old data. Because it's scoped so tightly, you don't have to worry about the agent accidentally dropping a table or snooping through your finance records. It's a plug-and-play way to add a production-grade NoSQL backend to your AI workflows. You can find this and thousands of other specialized connectors in the Vinkius catalog to build out your agent's capabilities quickly.

## Tools

### query_documents
Run SQL queries against the container to find specific data based on your criteria. This is useful for filtering logs or finding specific user states.

### create_document
Insert new JSON documents into the container while handling partition keys automatically. Use this to save new user data or session info.

### delete_document
Remove specific documents from the container to keep your data clean. This helps the agent clear out old test entries or expired sessions.

### get_document
Pull a single document by its unique ID for quick lookups. This is the fastest way for your agent to grab a specific record it needs right now.

## Prompt Examples

**Prompt:** 
```
Look for any orders that are still marked as 'shipped' but haven't been 'delivered'.
```

**Response:** 
```
I've checked the container for you.

| **Pending Shipments** |
| --- | --- |
| Order #992 | Shipped |
| Order #1042 | Shipped |

**Total:** 2 orders found.
```

**Prompt:** 
```
Save a new user profile for 'Alex Smith' with ID 'user_789' and set his preference to 'dark mode'.
```

**Response:** 
```
Done. I've created a new document for Alex Smith in the Cosmos DB container.
```

**Prompt:** 
```
Delete the record for the old test user 'test_99'.
```

**Response:** 
```
I've successfully removed the document for 'test_99' from the database.
```

## Capabilities

### Query specific records
Find data using SQL-like queries to filter for specific statuses or properties.

### Add new JSON documents
Insert new records into your container with custom IDs and partition keys.

### Remove specific documents
Delete old or unnecessary records from the container to keep your data clean.

### Fetch single records
Retrieve a specific document by its unique ID for immediate use.

### Manage partition keys
Handle the specific keys required to keep your NoSQL data scalable.

## Use Cases

### Chatbot Memory
A user wants their bot to remember their name. The agent uses create_document to save the name and get_document to recall it later.

### Status Tracking
An ops lead asks for all 'pending' orders. The agent runs query_documents to find and summarize the list.

### Data Cleanup
A developer needs to wipe old test data. The agent uses delete_document to clear out specific IDs.

### User Profiles
A customer support agent fetches a user's last 5 interactions by querying the container for recent activity.

## Benefits

- You get strict security because the agent is locked into one container and can't touch your other databases.
- You can use native SQL queries with query_documents to find exactly what you need without extra processing.
- You get scalable storage that grows with your app, making it perfect for high-volume chat histories.
- You save time on permissions because you don't have to set up complex cloud roles for the agent.
- You can store complex JSON objects directly using create_document for flexible data modeling.

## How It Works

The bottom line is you get a secure, scoped NoSQL database that your agent can use as its own private memory or data store.

1. Connect your AI client to the Connector using your Azure credentials.
2. Specify the name of the single container you want the agent to access.
3. Start asking your agent to read, write, or delete data within that container.

## Frequently Asked Questions

**Can the Azure Cosmos DB Container MCP access my whole database?**
No, it's restricted to one specific container. This keeps your other data safe while letting the agent work.

**What kind of data can I store?**
You can store any structured JSON data, including user profiles, logs, or chat histories.

**Does this work with my existing Azure account?**
Yes, it connects to your existing Cosmos DB container using the permissions you provide.

**How does the AI find specific records?**
It uses SQL-like queries to filter and find the exact documents you're looking for.

**Is this good for giving my AI agent a long-term memory?**
Yes, it's one of the best ways to give an agent a scalable way to remember information across different sessions.

**Can I delete data with this Connector?**
Yes, your agent can remove specific documents using their unique IDs.

**Why limit the agent to a single Cosmos Container?**
To enforce zero-trust security. An autonomous AI agent should not have the ability to read or delete data across your entire Cosmos DB Account (which might include user passwords, financial records, etc.). By scoping it to a single container, you eliminate the risk of catastrophic data loss.

**How do I write Cosmos SQL queries here?**
You don't need to specify the database or container in the query. Just use the standard alias `c`. For example: `SELECT * FROM c WHERE c.isComplete = false`. You can also pass parameters securely.

**Do I need to handle Partition Keys?**
The query tool automatically enables cross-partition queries to simplify AI workflows. However, for getting, creating, or deleting specific documents, you should provide the `partitionKey` if your container is configured to require one.