Connect to AI
Database Bearer Token

Azure Cosmos DB REST API

Globally distributed, multi-model database service REST API

Azure Cosmos DB is Microsoft's globally distributed, multi-model database service designed for mission-critical applications. The REST API provides programmatic access to manage databases, containers, documents, and perform CRUD operations across multiple consistency models. Developers use it to build highly responsive, always-on applications with automatic scaling and multi-region replication.

Base URL https://{account-name}.documents.azure.com

API Endpoints

MethodEndpointDescription
GET/dbsList all databases in the Cosmos DB account, returning database IDs and resource URLs.
POST/dbsCreate a new database with a specified ID. Returns the database resource object including self-link.
GET/dbs/{db-id}Get details of a specific database including resource metadata and provisioned throughput settings.
DELETE/dbs/{db-id}Delete a database and all its child resources. Requires the database ID in the path.
GET/dbs/{db-id}/collsList all containers in a database, returning container IDs and partition key definitions.
POST/dbs/{db-id}/collsCreate a new container with partition key configuration
GET/dbs/{db-id}/colls/{coll-id}Get container properties and metadata
DELETE/dbs/{db-id}/colls/{coll-id}Delete a container and all its documents. Requires database ID and container ID in path.
GET/dbs/{db-id}/colls/{coll-id}/docsQuery documents in a container using SQL syntax. Returns array of matching documents.
POST/dbs/{db-id}/colls/{coll-id}/docsCreate a new document in a container. Requires partition key value in request headers.
GET/dbs/{db-id}/colls/{coll-id}/docs/{doc-id}Retrieve a specific document by ID and partition key
PUT/dbs/{db-id}/colls/{coll-id}/docs/{doc-id}Replace an existing document with new content. Requires partition key in headers and full document body.
PATCH/dbs/{db-id}/colls/{coll-id}/docs/{doc-id}Partially update a document with patch operations
DELETE/dbs/{db-id}/colls/{coll-id}/docs/{doc-id}Delete a document from a container. Requires partition key value in request headers.
POST/dbs/{db-id}/colls/{coll-id}/sprocs/{sproc-id}Execute a stored procedure with optional input parameters. Returns procedure output.

Code Examples

curl -X GET \
  'https://mycosmosaccount.documents.azure.com/dbs' \
  -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGc...' \
  -H 'x-ms-date: Thu, 27 Apr 2024 00:00:00 GMT' \
  -H 'x-ms-version: 2018-12-31' \
  -H 'Content-Type: application/json'

Use Azure Cosmos DB from Claude / Cursor / ChatGPT

Get a hosted MCP endpoint for Azure Cosmos DB. Paste your Azure Cosmos DB API key, copy back one URL, drop it into Claude Desktop, Cursor, or any AI client that supports remote MCP. Your AI calls Azure Cosmos DB directly with your credentials — no local install, works on mobile.

cosmos_query_documents Execute SQL-like queries across Cosmos DB containers with support for cross-partition queries and aggregations
cosmos_create_document Create new documents in Cosmos DB containers with automatic partition key assignment and indexing
cosmos_update_document Update existing documents using PATCH operations for efficient partial updates without full document replacement
cosmos_manage_containers Create, configure, and manage Cosmos DB containers including partition key strategies and throughput settings
cosmos_execute_sproc Execute stored procedures for server-side transaction processing and complex business logic within Cosmos DB

Connect in 60 seconds

Paste your Azure Cosmos DB key → get an MCP URL → paste into Claude/Cursor. Hosted by IOX, encrypted at rest.

Connect Azure Cosmos DB to your AI →

Related APIs