MCP cover image
See in Github
2025-04-01

Un servidor de protocolo de contexto modelo (MCP) que proporciona acceso seguro a los conjuntos de datos de Azure Cosmos DB. Permite que los modelos de idiomas grandes (LLM) consulten y analicen los datos de manera segura a través de una interfaz estandarizada.

9

Github Watches

15

Github Forks

48

Github Stars

Azure Cosmos DB MCP Server

Azure-Cosmos-MCP-server ./src/img/logo.png

What is this? 🤔

This is a server that lets your LLMs (like Claude , VSCODE ) 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*

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:

  1. Set up project (see below)
  2. Add your project details to Claude Desktop's config file
  3. 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 with the sample dataset(./dataset/vehciles) inserted
  • Claude Desktop

Set up project

Obtain the Azure Cosmos DB NoSQL account URI and KEY from the Keys section, and the Database ID and Container ID from the Data Explorer section, then create a .env file with the following keys, replacing the placeholder values with your own:

COSMOSDB_URI=
COSMOSDB_KEY=
COSMOS_DATABASE_ID=
COSMOS_CONTAINER_ID=

Getting Started

  1. Install Dependencies
    Run the following command in the root folder to install all necessary dependencies:

    npm install
    
  2. Build the Project
    Compile the project by running:

    npm run build
    
  3. Start the Server
    Navigate to the dist folder and start the server:

    npm start
    
  4. Confirmation Message
    You should see the following message:

    Azure Cosmos DB Server running on stdio
    

How to run it using VSCODE Insiders

To use the Azure MCP with VS Code Insiders with GitHub Copilot Agent Mode, follow these instructions:

  1. Install VS Code Insiders.

  2. Install the pre-release versions of the GitHub Copilot and GitHub Copilot Chat extensions in VS Code Insiders.

  3. Open a new instance of VS Code Insiders in an empty folder.

  4. Copy the mcp.json file from this repo to your new folder, and update the values to match your environment.

  5. Open GitHub Copilot and switch to Agent mode. You should see Azure Cosmos DB MCP Server in the list of tools.

  6. Try a prompt that tells the agent to use the Azure MCP server, such as "List Vehicles".

  7. The agent should be able to use the Azure Cosmos DB MCP server to complete your query.

This setup allows you to seamlessly interact with Azure Cosmos DB through the MCP server in VSCODE with Github Copilot as shown below.

https://github.com/user-attachments/assets/c56a54c1-2bd6-422c-b55f-e8a17745b7ee

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",
        "COSMOS_DATABASE_ID": "Your Database ID",
        "COSMOS_CONTAINER_ID": "Vehicles"
      }
    }
  }
}

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.

相关推荐

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • Contraband Interactive
  • Emulating Dr. Jordan B. Peterson's style in providing life advice and insights.

  • rustassistant.com
  • Your go-to expert in the Rust ecosystem, specializing in precise code interpretation, up-to-date crate version checking, and in-depth source code analysis. I offer accurate, context-aware insights for all your Rust programming questions.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • apappascs
  • Descubra la colección más completa y actualizada de servidores MCP en el mercado. Este repositorio sirve como un centro centralizado, que ofrece un extenso catálogo de servidores MCP de código abierto y propietarios, completos con características, enlaces de documentación y colaboradores.

  • ShrimpingIt
  • Manipulación basada en Micrypthon I2C del expansor GPIO de la serie MCP, derivada de AdaFruit_MCP230xx

  • Mintplex-Labs
  • La aplicación AI de escritorio todo en uno y Docker con trapo incorporado, agentes de IA, creador de agentes sin código, compatibilidad de MCP y más.

  • n8n-io
  • Plataforma de automatización de flujo de trabajo de código justo con capacidades de IA nativas. Combine el edificio visual con código personalizado, auto-anfitrión o nube, más de 400 integraciones.

  • ravitemer
  • Un poderoso complemento Neovim para administrar servidores MCP (protocolo de contexto del modelo)

  • WangRongsheng
  • 🧑‍🚀 全世界最好的 llM 资料总结(数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Resumen de los mejores recursos del mundo.

  • jae-jae
  • Servidor MCP para obtener contenido de la página web con el navegador sin cabeza de dramaturgo.

  • patruff
  • Puente entre los servidores Ollama y MCP, lo que permite a LLM locales utilizar herramientas de protocolo de contexto del modelo

  • pontusab
  • La comunidad de cursor y windsurf, encontrar reglas y MCP

    Reviews

    1 (1)
    Avatar
    user_yGlihRXK
    2025-04-17

    As a dedicated user of the azure-cosmos-mcp-server, I can confidently say it's an exceptional product by AzureCosmosDB. Its seamless integration with my applications has significantly enhanced performance and scalability. The well-documented GitHub repository is a valuable resource, making it easy to get started and navigate through its features. Highly recommended for anyone looking to improve their database management!