Azure Cosmos DB MCP Server

Integrations

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

Azure Cosmos DB MCP 服务器

这是什么?🤔

这是一个服务器,可以让你的法学硕士(比如 Claude)直接与你的 Azure Cosmos DB 数据对话!你可以把它想象成一个友好的翻译器,位于你的 AI 助手和数据库之间,确保它们能够安全高效地进行对话。

快速示例

You: "What were our top 10 customers last month?" Claude: *queries your Azure Cosmos DB database and gives you the answer in plain English*

它是如何工作的?🛠️

该服务器利用了模型上下文协议 (MCP),这是一个多功能框架,可充当 AI 模型和数据库之间的通用转换器。虽然 MCP 旨在支持任何 AI 模型,但目前它仍可在 Claude Desktop 中作为开发者预览版使用。

您需要做的就是:

  1. 设置项目(见下文)
  2. 将您的项目详细信息添加到 Claude Desktop 的配置文件中
  3. 开始自然地与您的 Azure Cosmos DB 数据聊天!

它能做什么?📊

  • 只需用简单的英语提问即可运行 Azure Cosmos DB 查询

快速入门🚀

先决条件

  • Node.js 14 或更高版本
  • Azure Cosmos DB NOSQL 帐户或 Azure Cosmos DB 模拟器
  • 克劳德桌面

设置项目

  • 从密钥部分获取 Azure Cosmos DB NOSQL 帐户 URI 和密钥,并使用以下密钥创建一个“.env”文件并替换值
COSMOSDB_URI= COSMOSDB_KEY=

入门

  1. 安装依赖项
    在根文件夹中运行以下命令来安装所有必要的依赖项:
    npm install
  2. 构建项目
    通过运行以下命令编译项目:
    npm run build
  3. 启动服务器
    导航到dist文件夹并启动服务器:
    npm start
  4. 确认消息
    您应该会看到以下消息:
    Azure Cosmos DB Server running on stdio

将您的项目详细信息添加到 Claude Destkop 的配置文件中

打开 Claude Desktop 并导航至文件 -> 设置 -> 开发人员 -> 编辑配置,然后打开claude_desktop_config文件并将其替换为以下值,

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

现在,您应该已成功使用 Claude Desktop 为 Azure Cosmos DB 配置了 MCP 服务器。此设置允许您通过 MCP 服务器与 Azure Cosmos DB 无缝交互,如下所示。

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

贡献

该项目欢迎您的贡献和建议。大多数贡献都要求您同意一份贡献者许可协议 (CLA),该协议声明您有权并确实授予我们使用您贡献的权利。详情请访问https://cla.opensource.microsoft.com

当您提交拉取请求时,CLA 机器人会自动判断您是否需要提供 CLA,并适当地修饰 PR(例如,状态检查、评论)。只需按照机器人提供的说明操作即可。您只需在所有使用我们 CLA 的仓库中执行一次此操作。

本项目已采用Microsoft 开源行为准则。更多信息请参阅行为准则常见问题解答,或联系opencode@microsoft.com提出其他问题或意见。

商标

本项目可能包含项目、产品或服务的商标或徽标。Microsoft 商标或徽标的授权使用须遵守Microsoft 的商标和品牌指南。在本项目的修改版本中使用 Microsoft 商标或徽标不得引起混淆或暗示 Microsoft 的赞助。任何第三方商标或徽标的使用均须遵守该第三方的政策。

-
security - not tested
A
license - permissive license
-
quality - not tested

该服务器使 Claude 这样的 LLM 能够通过自然语言查询与 Azure Cosmos DB 数据库进行交互,充当 AI 助手和数据库系统之间的翻译器。

  1. What is this? 🤔
    1. Quick Example
  2. How Does It Work? 🛠️
    1. What Can It Do? 📊
  3. Quick Start 🚀
    1. Prerequisites
    2. Set up project
    3. Getting Started
    4. Add your project details to Claude Destkop's config file
  4. Contributing
    1. Trademarks
      ID: 37x5gtn5v8