Skip to main content
Glama
robinong79

Azure Cosmos DB MCP Server

by robinong79

Servidor MCP de Azure Cosmos DB

¿Qué es esto? 🤔

Este es un servidor que permite que tus LLM (como Claude) se comuniquen directamente con tus datos de Azure Cosmos DB. Piensa en él como un traductor amigable que se encuentra entre tu asistente de IA y tu base de datos, asegurándose de que puedan comunicarse de forma segura y eficiente.

Ejemplo rápido

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

¿Cómo funciona? 🛠️

Este servidor utiliza el Protocolo de Contexto de Modelo (MCP), un marco versátil que actúa como traductor universal entre modelos de IA y bases de datos. Si bien MCP está diseñado para ser compatible con cualquier modelo de IA, actualmente está disponible como versión preliminar para desarrolladores en Claude Desktop.

Esto es todo lo que necesitas hacer:

  1. Configurar el proyecto (ver más abajo)

  2. Agregue los detalles de su proyecto al archivo de configuración de Claude Desktop

  3. ¡Comienza a chatear con tus datos de Azure Cosmos DB de forma natural!

¿Qué puede hacer? 📊

  • Ejecute consultas de Azure Cosmos DB simplemente haciendo preguntas en un lenguaje sencillo

Inicio rápido 🚀

Prerrequisitos

  • Node.js 14 o superior

  • Cuenta NOSQL de Azure Cosmos DB o emulador de Azure Cosmos DB

  • Escritorio de Claude

Configurar proyecto

  • Obtenga el URI de la cuenta NOSQL de Azure Cosmos DB y la CLAVE de la sección de claves y cree un archivo '.env' con la siguiente clave y reemplace los valores

COSMOSDB_URI=
COSMOSDB_KEY= 

Empezando

  1. Instalar dependencias
    Ejecute el siguiente comando en la carpeta raíz para instalar todas las dependencias necesarias:

    npm install
  2. Construir el proyecto
    Compila el proyecto ejecutando:

    npm run build
  3. Iniciar el servidor
    Navegue a la carpeta dist e inicie el servidor:

    npm start
  4. Mensaje de confirmación
    Debería ver el siguiente mensaje:

    Azure Cosmos DB Server running on stdio

Añade los detalles de tu proyecto al archivo de configuración de Claude Destkop

Abra Claude Desktop y vaya a Archivo -> Configuración -> Desarrollador -> Editar configuración y abra el archivo claude_desktop_config y reemplácelo con los valores a continuación.

{
  "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"
      }
    }
  }
}

Ya debería haber configurado correctamente el servidor MCP para Azure Cosmos DB con Claude Desktop. Esta configuración le permite interactuar sin problemas con Azure Cosmos DB a través del servidor MCP, como se muestra a continuación.

https://github.com/user-attachments/assets/ae3a14f3-9ca1-415d-8645-1c8367fd6943

Contribuyendo

Este proyecto agradece contribuciones y sugerencias. La mayoría de las contribuciones requieren la aceptación de un Acuerdo de Licencia de Colaborador (CLA), que declara que tiene derecho a otorgarnos, y efectivamente nos otorga, los derechos para usar su contribución. Para más información, visite https://cla.opensource.microsoft.com .

Al enviar una solicitud de extracción, un bot de CLA determinará automáticamente si es necesario proporcionar una CLA y la decorará adecuadamente (por ejemplo, comprobación de estado o comentario). Simplemente siga las instrucciones del bot. Solo tendrá que hacerlo una vez en todos los repositorios que utilicen nuestra CLA.

Este proyecto ha adoptado el Código de Conducta de Código Abierto de Microsoft . Para más información, consulte las preguntas frecuentes sobre el Código de Conducta o escriba a opencode@microsoft.com si tiene alguna pregunta o comentario.

Marcas comerciales

Este proyecto puede contener marcas comerciales o logotipos de proyectos, productos o servicios. El uso autorizado de las marcas comerciales o logotipos de Microsoft está sujeto a las Directrices de Marcas Registradas y de Marca de Microsoft y debe cumplirlas. El uso de marcas comerciales o logotipos de Microsoft en versiones modificadas de este proyecto no debe causar confusión ni implicar patrocinio por parte de Microsoft. El uso de marcas comerciales o logotipos de terceros está sujeto a las políticas de dichos terceros.

Available Tools

4 tools
get_itemC

Retrieves an item from a Azure Cosmos DB container by its ID

ParametersJSON Schema
NameRequiredDescriptionDefault
containerNameYesName of the container
idYesID of the item to retrieve

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a retrieval operation but doesn't mention error handling (e.g., what happens if container doesn't exist or ID is invalid), authentication requirements, rate limits, or whether this is a read-only operation. The description is minimal and lacks important behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that gets straight to the point with zero waste. It's appropriately sized for a simple retrieval operation and front-loads the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a database retrieval tool with no annotations and no output schema, the description is insufficient. It doesn't explain what format the item is returned in, error conditions, authentication needs, or how this differs from sibling tools. The description should provide more context given the complexity of database operations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters ('containerName' and 'id'). The description adds minimal value by mentioning these parameters in context ('by its ID'), but doesn't provide additional semantics beyond what the schema already states. Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Retrieves') and resource ('an item from a Azure Cosmos DB container'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'query_container' which might also retrieve items, so it lacks specific sibling distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'query_container' or 'update_item'. It mentions retrieving by ID but doesn't explain when ID-based retrieval is preferred over query-based approaches or what happens if the ID doesn't exist.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

put_itemC

Inserts or replaces an item in a Azure Cosmos DB container

ParametersJSON Schema
NameRequiredDescriptionDefault
containerNameYesName of the container
itemYesItem to insert into the container

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'inserts or replaces', hinting at mutation, but fails to detail critical aspects like required permissions, whether operations are idempotent, error handling for missing containers, or rate limits. This leaves significant gaps for safe and effective tool invocation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, direct sentence that efficiently conveys the core action without unnecessary words. It is front-loaded with the key information, making it easy to parse quickly, which is ideal for concise tool descriptions.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a database mutation tool with no annotations and no output schema, the description is insufficient. It lacks details on behavioral traits (e.g., side effects, error responses), usage context relative to siblings, and return values, making it incomplete for reliable agent operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, clearly documenting both parameters ('containerName' and 'item'). The description adds no additional semantic context beyond what the schema provides, such as format examples or constraints, so it meets the baseline for adequate but not enhanced parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Inserts or replaces') and the target resource ('an item in a Azure Cosmos DB container'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'update_item' (which might handle partial updates) or 'get_item' (which retrieves), leaving room for ambiguity in tool selection.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'update_item' or 'query_container'. It lacks context such as whether this is for new items only, overwriting existing ones, or handling conflicts, which could lead to misuse by an AI agent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

query_containerC

Queries a Azure Cosmos DB container using SQL-like syntax

ParametersJSON Schema
NameRequiredDescriptionDefault
containerNameYesName of the container
parametersNoQuery parameters
queryYesSQL query string

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool queries a container but doesn't describe what happens on execution—such as whether it's read-only, if it affects data, potential rate limits, error conditions, or the format of results. For a query tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded with the core action and resource, making it easy to parse. Every part of the sentence contributes essential information, earning its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of querying a database, lack of annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., result sets, error formats), behavioral aspects like safety or performance, or how to interpret parameters effectively. For a tool with three parameters and no structured behavioral hints, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all three parameters (containerName, parameters, query) with basic descriptions. The description adds marginal value by implying the query uses SQL-like syntax, but it doesn't provide additional details like syntax examples, parameter usage, or constraints beyond what the schema offers. Baseline 3 is appropriate when the schema handles most documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('queries') and target resource ('Azure Cosmos DB container'), and specifies the method ('using SQL-like syntax'). It distinguishes from siblings like get_item, put_item, and update_item by focusing on querying rather than direct item operations. However, it doesn't explicitly contrast with siblings beyond the general verb difference.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention scenarios where query_container is preferred over get_item (e.g., for complex filtering or multiple items), nor does it specify prerequisites like container existence or permissions. Usage is implied by the action but not explicitly defined.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

update_itemC

Updates specific attributes of an item in a Azure Cosmos DB container

ParametersJSON Schema
NameRequiredDescriptionDefault
containerNameYesName of the container
idYesID of the item to update
updatesYesThe updated attributes of the item

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only states it updates attributes without disclosing key behavioral traits. It doesn't mention whether this is a partial or full update, if it requires specific permissions, what happens on failure, or if there are rate limits. The description is minimal and lacks critical operational context for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste. It's front-loaded with the core action and resource, making it easy to parse quickly. Every word contributes directly to the tool's purpose without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a database update operation with no annotations and no output schema, the description is insufficient. It doesn't explain what the tool returns, error conditions, or behavioral nuances (e.g., concurrency, atomicity). For a mutation tool in a database context, this leaves significant gaps in understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all three parameters (containerName, id, updates) adequately. The description adds no additional meaning beyond implying 'updates' modifies attributes, which is redundant with the schema. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Updates') and resource ('specific attributes of an item in a Azure Cosmos DB container'), making the purpose understandable. It distinguishes from siblings like 'get_item' (read) and 'put_item' (create/replace), but doesn't explicitly differentiate from 'query_container' (which likely searches rather than updates).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'put_item' or 'query_container'. It mentions updating attributes but doesn't specify prerequisites (e.g., item must exist) or exclusions (e.g., not for bulk updates), leaving the agent to infer usage from context alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updatesv1.0.0
    • First observedget_item
    • First observedput_item
    • First observedquery_container
    • First observedupdate_item

TDQS

B3.4/5.0

Scored across 4 tools

Disambiguation5/5

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.

Naming Consistency5/5

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.

Tool Count4/5

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.

Completeness4/5

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

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

  • GibsonAI MCP server: manage your databases with natural language

  • MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.

  • 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.

  • Text-to-SQL MCP server: read-only queries on PostgreSQL, MySQL and SQL Server with your real schema

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    A server that enables interaction with PostgreSQL, MySQL, MariaDB, or SQLite databases through Claude Desktop using natural language queries.
    1
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    A 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.
    1
    MIT