Azure Cosmos DB
STDIOAzure Cosmos DB的Go SDK集成服务
Azure Cosmos DB的Go SDK集成服务
This is an implementation of a MCP server for Azure Cosmos DB built using its Go SDK. It exposes the following tools for interacting with Azure Cosmos DB:
The project uses mcp-go as the MCP implementation.
Here is a demo (recommend watching at 2x speed 😉) using VS Code in Agent Mode:
Word(s) of caution: As much as I want folks to benefit from this, I have to call out that Large Language Models (LLMs) are non-deterministic by nature and can make mistakes. I would recommend you to always validate the results and queries before making any decisions based on them.
git clone https://github.com/abhirockzz/mcp_cosmosdb_go cd mcp_cosmosdb_go go build -o mcp_azure_cosmosdb main.go
This will differ based on the MCP client/tool you use. For VS Code you can follow these instructions on how to configure this server using a mcp.json
file.
Here is an example of the mcp.json file:
{ "servers": { "Azure Cosmos DB MCP (Golang)": { "type": "stdio", "command": "enter path to binary e.g. /Users/demo/Desktop/mcp_azure_cosmosdb" } } }
Here is an example of Claude Desktop configuration:
{ "mcpServers": { "Azure Cosmos DB MCP (Golang)": { "command": "enter path to binary e.g. /Users/demo/Desktop/mcp_azure_cosmosdb", "args": [] } //other MCP servers... } }
The user principal you will be using should have permissions (control and data plane) to execute CRUD operations on database, container, and items.
Authentication
COSMOSDB_ACCOUNT_KEY
environment variable in the MCP server configuration:{ "servers": { "CosmosDB Golang MCP": { "type": "stdio", "command": "/Users/demo/mcp_azure_cosmosdb", "env": { "COSMOSDB_ACCOUNT_KEY": "enter the key" } } } }
You are good to go! Now spin up VS Code in Agent Mode, or any other MCP tool (like Claude Desktop) and try this out!
Start with MCP inspector - npx @modelcontextprotocol/inspector ./mcp_azure_cosmosdb