
Azure Cosmos DB MCP Server

2025.03.24
0
JavaScript数据库中间件AI数据库连接数据库
Azure Cosmos DB MCP Server 是一个连接大型语言模型(如Claude)与Azure Cosmos DB数据库的中间件服务。它充当AI助手与数据库之间的安全、高效翻译器,允许用户通过自然语言查询数据库。该服务基于Model Context Protocol (MCP)框架开发,目前作为Claude Desktop的开发者预览版提供。
View on GitHub
Overview
基本能力
产品定位
Azure Cosmos DB MCP Server 是一个数据库中间件服务,专为连接AI模型与Azure Cosmos DB设计。
核心功能
- 通过自然语言(如英语)查询Azure Cosmos DB数据库
- 作为AI模型与数据库之间的安全翻译器
- 支持通过MCP协议与Claude Desktop集成
适用场景
- 需要通过自然语言查询Azure Cosmos DB的场景
- AI助手需要访问结构化数据库数据的应用
- 开发者希望简化数据库查询流程的环境
工具列表
- Claude Desktop:集成该MCP服务的AI助手客户端
- Azure Cosmos DB Emulator:本地开发测试工具
常见问题
- 需要签署CLA(贡献者许可协议)才能参与项目贡献
- 使用Microsoft商标需遵守相关品牌指南
使用教程
使用依赖
- Node.js 14或更高版本
- Azure Cosmos DB NOSQL账户或Azure Cosmos DB Emulator
- Claude Desktop
安装Node.js命令(示例):
# 使用nvm安装Node.js
nvm install 16
安装教程
- 克隆项目仓库
- 创建.env文件并配置Cosmos DB连接信息:
COSMOSDB_URI=your_uri
COSMOSDB_KEY=your_key
- 安装依赖:
npm install
- 构建项目:
npm run build
- 启动服务:
npm start
调试方式
- 确认服务启动后显示:
Azure Cosmos DB Server running on stdio
- 在Claude Desktop配置文件中添加服务路径:
{
"mcpServers": {
"cosmosdb": {
"command": "node",
"args": [ "path/to/dist/index.js" ],
"env": {
"COSMOSDB_URI": "your_uri",
"COSMOSDB_KEY": "your_key"
}
}
}
}
- 在Claude Desktop中测试自然语言查询