Skip to content
GitHub (opens in a new tab)

Databases · Integration guide

How to connect Azure Cosmos DB to any AI IDE (Claude/Codex/Cursor/VS Code/Antigravity)

Before you start, install GateRook and connect it to your AI development environment: Claude Desktop, Codex, Cursor, Antigravity or VS Code.

Connect your AI app

Databases, containers, SQL queries and items. Changes wait for approval.

The screenshots show GateRook 2.0.0: the Azure Cosmos DB form, the endpoint selector, and this connector’s actual tool preview. The form and preview have not been saved. Select a screenshot to open it at full size.

1. Create a connection and enter the settings

In GateRook, open Connections, select Add connection, search for Azure Cosmos DB, choose its card and select Continue to configure.

Use this connector for an Azure Cosmos DB account with the NoSQL API. For an account’s MongoDB-compatible interface, choose the separate MongoDB-compatible service instead.

Copy the account URI and prepare a read-only account key or an Entra service principal with the appropriate Cosmos DB data-plane role.

Enter a Name, for example cosmosdb-demo. Your AI app uses this name to choose the connection.

Enter Account endpoint from the account’s Keys page. Restrict Databases and Containers; a container can be named as database/container.

For Account key, select the actual kind of key in Key and paste Account key. GateRook cannot determine whether a key is read-only without attempting a write, so this choice must match the key you provide.

For Microsoft Entra ID (service principal), enter Directory (tenant) ID, Application (client) ID and the Client secret value. Review Read consistency and leave Cross-partition queries off when queries should always name a partition key.

Choose Development, Staging or Production to match the service. Review the connector’s limit and access settings before continuing.

GateRook 2.0.0 Configure Azure Cosmos DB form before saving.
The Azure Cosmos DB configuration form. Enter your own connection settings before testing.

2. Test the connection and add it to an endpoint

Select Continue to test. GateRook checks the settings from your computer. Review the result and resolve any connection, certificate or permission error before continuing.

Check the account’s network access rules and the selected key or data-plane role. A management-plane Reader role alone does not grant document access. For partition errors, supply the container’s correct partition-key value.

After the test passes, select Continue to add to an endpoint. Choose the endpoint your AI app uses, review its tool modes, then select Save connection. GateRook offers default as the starter endpoint.

GateRook endpoint selector with default selected; no connector tool list is shown.
Choose the endpoint your AI app uses. This selector is shared across connector types; the next screenshot shows this connector’s own tools.

3. Use the connection from your AI IDE

After saving Azure Cosmos DB on the endpoint and passing its connection test, ask your AI app to use cosmosdb-demo, or the name you chose. If its tools are missing, confirm the endpoint assignment and refresh the MCP connection or start a new chat.

The preview below shows this connector’s default tools before saving. The table explains what each tool can do; connection settings, credentials and endpoint policies can restrict access further.

Azure Cosmos DB connector tool names and default modes in the GateRook 2.0.0 endpoint preview.
Azure Cosmos DB tools in the Development endpoint preview. This is an unsaved preview, not a successful service call.

Start with a small read request. Replace example resource names with existing resources your connection may access. Open Activity after the call to inspect its connection, tool, arguments, policy decision and result metadata.

Ask your AI, for example

  • “List the containers in the app database on cosmosdb-demo.”
  • “Describe the partition key of app/orders on cosmosdb-demo.”
  • “Using cosmosdb-demo, read order-123 in app/orders with its known partition-key value.”
Tools your AI gets
ToolWhat it doesStarts as
cosmosdb_list_databasesIDs of the databases agents may use in the account.Read only
cosmosdb_list_containersContainers of one database that agents may use, with their partition key paths.Read only
cosmosdb_describe_containerPartition key, indexing policy, default time to live, unique keys and, when the credentials may read it, the throughput of one container.Read only
cosmosdb_queryOne Cosmos DB SQL SELECT on one container, with @name parameters. Give partitionKey to read one partition; without it the query fans out over every partition, where Cosmos DB's gateway refuses TOP, ORDER BY, OFFSET LIMIT, DISTINCT, GROUP BY and aggregates. Pages with nextCursor and reports the request units used.Read only
cosmosdb_read_itemOne item by its id and partition key value, with its _etag for a later change.Read only
cosmosdb_executeOne create, upsert, replace, patch or delete of one item in one container. You approve the exact request.Approval

You can change each tool’s mode on the endpoint. Every call your AI makes appears in Activity.

Service documentation

Keep exploring

PostgreSQL

Connect PostgreSQL to Claude, Codex, Cursor, VS Code or Antigravity in three steps. Your AI runs read queries; changes wait for your approval.

MySQL

Connect MySQL to Claude, Codex, Cursor, VS Code or Antigravity in three steps. GateRook keeps the password; your AI reads data and asks before changes.

MariaDB

Connect MariaDB to Claude, Codex, Cursor, VS Code or Antigravity in three steps with GateRook’s MySQL connector. Changes wait for your approval.

Browse all integration guides

Your local MCP gateway and firewall.

Connect Azure Cosmos DB to your AI IDE.

Choose a connector. Start with read-only access. Approve changes and inspect the audit trail.

Read the getting started guide

Get GateRook

Download GateRook 2.0.0 for your Mac, or get the Windows app from Microsoft Store.

macOS

Version 2.0.0 for Apple Silicon (arm64). This download does not support Intel Macs.

Open the DMG and drag GateRook to Applications.

Windows

Available for free from Microsoft Store. Install GateRook and receive updates through the Store.

macOS release notes and checksums (opens in a new tab)