Developer Tools

Azure Cosmos DB MCP Server

Connect your account, then chat with AI to run tools.

List Cosmos databases and containers, profile document counts, run SQL queries, export large result sets with automatic spillover, and create or update documents.

Try this workflow

Container profiling

List databases, pick the production database, list containers, then return document count and partition key path for the orders container.

Managed
14 tools
Agent guide included

Opens MCPBundles Studio with this server selected. After sign-in, chat and run tools from the same thread.

Browse all tools

What you can do with Azure Cosmos DB

Built for

Developers and data engineers building on Azure Cosmos DB SQL API

Example workflows

Container profiling

Uses list databases, list containers, and get container stats.

Try this

List databases, pick the production database, list containers, then return document count and partition key path for the orders container.

Export matching documents

Query to download paginates and spills large JSON automatically.

Try this

Run SELECT * FROM c WHERE c.status = 'active' on my items container and return all matches up to one thousand documents.

Context to know first

How do large Cosmos query results return?

Query to download fetches up to your max_documents cap across pages. When the serialized JSON exceeds the inline threshold, the platform uploads the payload to S3 and returns a presigned download URL in the tool response.

AI Skill
SKILL.md

Domain knowledge for Azure Cosmos DB — workflow patterns, data models, and gotchas for your AI agent.

Azure Cosmos DB

Cosmos DB is a document database. Applications store JSON documents in containers grouped by database, usually partitioned for scale and query cost control.

First moves

  1. List databases when the target database id is unknown.
  2. List containers in the chosen database when container names are unknown.
  3. Describe container — partition key path, indexing policy, and throughput settings before heavy work.
  4. Container stats — document count and storage footprint for a quick health check.
  5. Count items or infer schema — profile shape and volume before wide queries.
  6. Query documents — run read-only Cosmos SQL with partition-aware filters when possible.
  7. Export matches — paginated query with automatic spill to a download link when result sets are large.
  8. Read one document by id and partition key when you already know both.

Data model

Account → Database → Container → Document. Each container declares a partition key path; every document carries that key value. Queries that filter on the partition key cost less than cross-partition scans.

Operational order

  1. Resolve database and container ids from list calls — do not guess names when multiple environments share an account.
  2. Read container metadata before bulk export or writes so partition key path and indexing behavior are clear.
  3. Keep first queries small (top N rows, selective WHERE) to estimate result size and request charge.
  4. Paginate with continuation tokens from prior query responses when more pages exist.
  5. For large extracts, use the export query path so oversized JSON spills to a download URL instead of inline payloads.
  6. Document writes need the partition key value matching the container path; deletes require confirm_write after user approval.

Query and exploration

Use count and schema inference for discovery on unfamiliar containers. Cross-partition queries are valid but consume more request units — enable only when the question truly spans partitions. Read-only SELECT queries are the default exploration pattern; avoid mutating statements in query slots meant for reads.

Document lifecycle

Create inserts a new document with id and partition key. Upsert inserts or replaces by id. Replace updates an existing document and can carry an etag from a prior read for optimistic concurrency. Delete removes one document by id and partition key. Container creation is available when the connected account has control-plane permission on the target database.

Gotchas

  • Partition key required — point reads and writes fail without the correct partition key value even when document id is known.
  • Request units — cross-partition scans and large page sizes burn RU/s; start with modest page limits.
  • Continuation tokens — treat tokens as opaque; pass through exactly as returned to fetch the next page.
  • Export spillover — very large query exports return a download link rather than inline JSON; follow the link in the same session.
  • Default database — when configured on the credential, tools may assume that database id; still list when the user names a different database.
  • Writes need confirmation — document delete is destructive; expect confirm_write on delete actions.

Tools in this Server (14)

Azure Cosmos Count Items

Return document count for a container via SELECT VALUE COUNT(1) FROM c.

Azure Cosmos Create Container

Create a Cosmos DB SQL API container in a database using the account master key. Requires control-plane permission on the saved credential.

Azure Cosmos Create Document

Create a new document in a Cosmos DB container. Describe the container first to learn the partition key path.

Azure Cosmos Delete Document

Delete one Cosmos DB document by id and partition key. Set confirm_write=true after a point read confirms the target document.

Azure Cosmos Describe Container

Return partition key, indexing policy, and throughput metadata for one container.

Azure Cosmos Get Container Stats

Return document count plus partition key and indexing metadata for one container. Combines a container read with a COUNT query.

Azure Cosmos Get Document

Point-read one document by id and partition key.

Azure Cosmos Infer Schema

Sample documents and infer top-level field types for schema discovery.

Azure Cosmos List Containers

List containers in an Azure Cosmos DB SQL API database.

Azure Cosmos List Databases

List databases in the Azure Cosmos DB account.

Azure Cosmos Query SQL

Run a Cosmos DB SQL API query against one container. Use describe_container first when partition key filters are required.

Azure Cosmos Query To Download

Run a Cosmos DB SELECT query and return all matching documents up to max_documents. Large result sets spill to a presigned download_url via platform p...

Azure Cosmos Replace Document

Replace an existing Cosmos DB document by id. Pass if_match_etag from a prior read when you need optimistic concurrency.

Azure Cosmos Upsert Document

Create or replace a Cosmos DB document by id using the upsert path.

Frequently Asked Questions

How do large Cosmos query results return?

Query to download fetches up to your max_documents cap across pages. When the serialized JSON exceeds the inline threshold, the platform uploads the payload to S3 and returns a presigned download URL in the tool response.

How do I connect Azure Cosmos DB to my AI agent?

Add the MCPBundles server URL to your MCP client configuration (Claude Desktop, Cursor, VS Code, etc.). The URL format is: https://mcp.mcpbundles.com/bundle/azure-cosmos-db. Authentication is handled automatically.

How many tools does Azure Cosmos DB provide?

Azure Cosmos DB provides 14 tools that can be called by AI agents, along with a SKILL.md that gives your AI agent domain knowledge about when and how to use them.

What authentication does Azure Cosmos DB require?

Azure Cosmos DB uses API Key. Azure Cosmos DB requires credentials. Connect via MCPBundles and authentication is handled automatically.

Setup Instructions

Connect Azure Cosmos DB to any MCP client in minutes

MCP URL
https://mcp.mcpbundles.com/bundle/azure-cosmos-db

One-click install:

The link prefills the Add custom connector dialog — you still review the values and click Add, then Connect to complete OAuth.

Or add manually

  1. Open claude.ai → Settings → Connectors.
  2. Click the + button and choose Add custom connector.
  3. Set Name to Azure Cosmos DB and paste the MCP URL into Remote MCP server URL.
  4. Click Add. Azure Cosmos DB will appear under Not connected — select it and click Connect to complete OAuth.
Name: Azure Cosmos DB
Remote MCP server URL: https://mcp.mcpbundles.com/bundle/azure-cosmos-db
Authentication: OAuth

Custom connectors at claude.ai require a paid Claude plan (Pro, Max, Team, or Enterprise).

Ready to use Azure Cosmos DB?

Sign in to connect your credentials and start running tools from the chat.

Azure Cosmos DB MCP Server & Skill