Azure Cosmos DB MCP Server
Used for configuration of Azure Cosmos DB credentials through environment variables in a .env file.
Required runtime environment for the MCP server, with version 14 or higher needed to run the Azure Cosmos DB integration.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Azure Cosmos DB MCP Server show me the top 5 products by sales this week"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Azure Cosmos DB MCP Server
What is this? 🤔
This is a server that lets your LLMs (like Claude) talk directly to your Azure Cosmos DB data! Think of it as a friendly translator that sits between your AI assistant and your database, making sure they can chat securely and efficiently.
Quick Example
You: "What were our top 10 customers last month?"
Claude: *queries your Azure Cosmos DB database and gives you the answer in plain English*Related MCP server: Couchbase MCP Server
How Does It Work? 🛠️
This server leverages the Model Context Protocol (MCP), a versatile framework that acts as a universal translator between AI models and databases. Although MCP is built to support any AI model, it is currently accessible as a developer preview in Claude Desktop.
Here's all you need to do:
Set up project (see below)
Add your project details to Claude Desktop's config file
Start chatting with your Azure Cosmos DB data naturally!
What Can It Do? 📊
Run Azure Cosmos DB queries by just asking questions in plain English
Quick Start 🚀
Prerequisites
Node.js 14 or higher
Azure Cosmos DB NOSQL account or Azure Cosmos DB Emulator
Claude Desktop
Set up project
Obtain Azure Cosmos DB NOSQL account URI and the KEY from the keys section and create an '.env' file with the below key and replace the values
COSMOSDB_URI=
COSMOSDB_KEY= Getting Started
Install Dependencies
Run the following command in the root folder to install all necessary dependencies:npm installBuild the Project
Compile the project by running:npm run buildStart the Server
Navigate to thedistfolder and start the server:npm startConfirmation Message
You should see the following message:Azure Cosmos DB Server running on stdio
Add your project details to Claude Destkop's config file
Open Claude Desktop and Navigate to File -> Settings -> Developer -> Edit Config and open the claude_desktop_config file and replace with the values below,
{
"mcpServers": {
"cosmosdb": {
"command": "node",
"args": [ "C:/Cosmos/azure-cosmos-mcp/dist/index.js" ] // Your Path for the Azure Cosmos DB MCP server file,
"env": {
"COSMOSDB_URI": "Your Cosmos DB Account URI",
"COSMOSDB_KEY": "Your Cosmos DB KEY"
}
}
}
}
You should now have successfully configured the MCP server for Azure Cosmos DB with Claude Desktop. This setup allows you to seamlessly interact with Azure Cosmos DB through the MCP server as shown below.
https://github.com/user-attachments/assets/ae3a14f3-9ca1-415d-8645-1c8367fd6943
Contributing
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
Trademarks
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.
Available Tools
4 toolsget_itemC
Retrieves an item from a Azure Cosmos DB container by its ID
Inputs: containerName (required), id (required).
put_itemC
Inserts or replaces an item in a Azure Cosmos DB container
Inputs: containerName (required), item (required).
query_containerC
Queries a Azure Cosmos DB container using SQL-like syntax
Inputs: containerName (required), query (required), parameters.
update_itemC
Updates specific attributes of an item in a Azure Cosmos DB container
Inputs: containerName (required), id (required), updates (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose: get_item retrieves, put_item inserts/replaces, query_container queries, and update_item modifies attributes. There is no overlap in functionality, making tool selection straightforward for an agent.
All tools follow a consistent verb_noun pattern (get_item, put_item, query_container, update_item) with clear actions and targets. The naming is uniform and predictable throughout the set.
Four tools is reasonable for a database server, covering core operations (CRUD and querying). However, it feels slightly thin as it lacks tools for container/collection management (e.g., create_container, list_containers), which are common in database APIs.
The tools provide good coverage for item-level operations (create, read, update, query), but there are minor gaps in container-level management (e.g., creating or listing containers) and deletion operations (no delete_item). Agents can work around this by using put_item with deletions or querying, but it's not ideal.
Maintenance
Related MCP Connectors
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
Hosted SQL Server MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
The Ramp MCP server enables users to securely connect Ramp with AI assistants like ChatGPT and Claude to query financial data and take actions using natural language. It transforms Ramp's developer API into a SQL interface that LLMs can query, allowing admins to analyze spend trends, identify cost savings, and run complex SQL analyses on comprehensive datasets (transactions, purchase orders, vendors, users), while all users can manage cards, view transactions, request reimbursements, and get expense policy answers.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA server that enables interaction with PostgreSQL, MySQL, MariaDB, or SQLite databases through Claude Desktop using natural language queries.1-
- AlicenseNot gradedqualityDmaintenanceA server that enables natural language interactions with Couchbase databases through the Model Context Protocol, allowing users to perform SQL++ queries on Couchbase Capella clusters using conversational commands.1MIT
- AlicenseBqualityDmaintenanceA server that enables LLMs like Claude to query AWS DynamoDB databases through natural language requests, supporting table management, data querying, and schema analysis.722 npm2MIT
- AlicenseNot gradedqualityDmaintenanceNode.js server that connects to Azure Cosmos DB NoSQL database, allowing users to query products and orders through an AI Assistant in a NextJS frontend application.1MIT