The Azure Cosmos DB plugin for Cursor gives Cursor the tools and skills needed to work effectively with Azure Cosmos DB projects.
- MCP Server — Connection to the Azure Cosmos DB MCP Toolkit for database operations, queries, vector search, and schema discovery
- Rules — 10 categorized rule sets (Supabase-style
my-rule/RULE.mdformat) covering data modeling, partition key design, query optimization, SDK patterns, indexing, throughput, global distribution, monitoring, design patterns, and vector search — sourced from the cosmosdb-agent-kit - Saved Prompt — A regeneration prompt (
.cursor/prompts/generate-rules.md) to update rules when the upstream agent-kit changes
Once connected to the MCP Toolkit, the following tools are available:
| Tool | Description |
|---|---|
list_databases |
List all databases in the Cosmos DB account |
list_collections |
List all containers in a database |
get_approximate_schema |
Sample documents to infer schema (top-level properties) |
get_recent_documents |
Get N most recent documents ordered by timestamp |
find_document_by_id |
Find a document by its id |
text_search |
Search for documents where a property contains a search phrase |
vector_search |
Perform vector search using Azure OpenAI embeddings |
To use the MCP server features, you need:
- Azure Cosmos DB account — Create one
- Deployed MCP Toolkit — Follow the MCPToolKit deployment guide
- JWT Bearer Token — For authentication (see setup below)
The skills and rules work without any setup — they provide best practices guidance regardless of MCP server configuration.
Follow the Azure Cosmos DB MCP Toolkit Quick Start:
git clone https://github.com/AzureCosmosDB/MCPToolKit.git
cd MCPToolKit
# Deploy infrastructure (choose one method)
# Option A: Deploy to Azure button in the MCPToolKit README
# Option B: Azure Developer CLI
azd up
# Deploy the MCP server application
.\scripts\Deploy-Cosmos-MCP-Toolkit.ps1 -ResourceGroup "YOUR-RESOURCE-GROUP"After the plugin is installed, set these environment variables so the MCP server can connect:
# Your deployed MCP Toolkit URL (from deployment-info.json)
COSMOSDB_MCP_SERVER_URL=https://YOUR-CONTAINER-APP.azurecontainerapps.io
# JWT token for authentication
COSMOSDB_MCP_JWT_TOKEN=<your-bearer-token># Login to Azure
az login
# Get the Entra App Client ID (from deployment-info.json)
az account get-access-token --resource YOUR-ENTRA-APP-CLIENT-ID --query accessToken -o tsvNote: JWT tokens expire after ~1 hour. Refresh by re-running the command above.
In Cursor, open a chat and try:
List all databases in my Cosmos DB account
cosmosdb-cursor-plugin/
├── .cursor/
│ └── prompts/
│ └── generate-rules.md # Saved prompt to regenerate rules
├── .cursor-plugin/
│ └── plugin.json # Plugin manifest
├── .mcp.json # MCP server configuration
├── assets/
│ └── logo.svg # Plugin logo
├── rules/
│ ├── RULE.md # Index rule (points to sub-rules)
│ ├── data-modeling/RULE.md
│ ├── design-patterns/RULE.md
│ ├── global-distribution/RULE.md
│ ├── indexing/RULE.md
│ ├── monitoring/RULE.md
│ ├── partition-key/RULE.md
│ ├── query-optimization/RULE.md
│ ├── sdk-patterns/RULE.md
│ ├── throughput/RULE.md
│ └── vector-search/RULE.md
├── LICENSE
└── README.md
Rules are derived from the AzureCosmosDB/cosmosdb-agent-kit skills.
To regenerate rules after the upstream agent-kit updates:
- Open
.cursor/prompts/generate-rules.mdin Cursor - Run the saved prompt — it fetches the latest skills from the agent-kit repo and regenerates all
rules/*/RULE.mdfiles
- "List all databases in my Cosmos DB account"
- "Show me the schema of the
userscontainer in themydbdatabase" - "Get the latest 10 documents from the
orderscontainer" - "Search for documents where the name contains 'Azure'"
- "Find the document with id 'user-001' in the
userscontainer"
- "Review my Cosmos DB data model for this application"
- "What partition key should I use for a multi-tenant SaaS app?"
- "Optimize this Cosmos DB query for lower RU cost"
- "Should I embed or reference this related data?"
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch:
git checkout -b feature/my-feature - Commit your changes:
git commit -m 'feat: add my feature' - Push to the branch:
git push origin feature/my-feature - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.