AI agents get database access through Model Context Protocol

Microsoft has released a public preview of the MCP toolkit for Azure DocumentDB, giving AI agents direct access to DocumentDB databases through the Model Context Protocol. The announcement came out of the Azure Update pipeline, with deeper details from the Ignite 2025 sessions where the broader MCP strategy for Azure was laid out.

MCP, or Model Context Protocol, is an open standard that defines how AI agents connect to external data sources and tools. Think of it as a USB-C port for AI: instead of each agent having its own proprietary way to talk to databases, there is a standard interface. Microsoft’s MCP server for Azure SDK has been expanding through 2026, and DocumentDB is the latest database service to get first-class support.

What the toolkit does

The MCP toolkit for DocumentDB lets AI agents query, insert, update, and delete documents stored in DocumentDB databases. An agent can ask natural-language questions about your data, run aggregations, or pull context for a task without being pre-loaded with static data. The toolkit handles authentication, connection management, and query translation.

Practical use cases include:

The vector search integration is worth calling out separately. DocumentDB supports vector indexing for AI workloads, and the MCP toolkit means agents can query these embeddings directly. This is useful for retrieval-augmented generation pipelines where the agent pulls relevant context from a vector store before generating a response.

How MCP compares with the old way

Before MCP, giving an agent database access meant one of several approaches, none of them great. Function calling lets the LLM invoke a predefined function, but you had to write that function, register it with the specific provider’s API, and handle auth separately. Custom API endpoints worked but created a maintenance surface for every database interaction the agent needed. Direct SDK access in the agent’s runtime tied you to a specific language and framework.

MCP separates the concerns. The agent speaks MCP, the server implements MCP for DocumentDB, and neither side needs to know about the other’s internals. Microsoft publishes and maintains the server. You configure it. The agent connects to it. Updates to the protocol or the database driver happen on Microsoft’s side.

The tradeoff is an additional network hop. An agent calling DocumentDB through MCP goes agent to MCP server to database, rather than agent directly to database. In most use cases this latency is negligible (sub-millisecond MCP overhead), but for throughput-critical applications where every millisecond matters, it is worth measuring before committing.

What this means for Azure developers

The MCP toolkit lowers the bar for building agent-driven applications on Azure. A developer who knows DocumentDB and has experimented with AI agents can now connect the two without writing custom middleware. The Ignite 2025 demos showed a customer-support agent that resolved account queries by talking directly to DocumentDB, with no intermediate API layer.

For teams already running DocumentDB in production, the vector search angle is particularly useful. If you are storing embeddings alongside your operational data, an agent that can query both in one round trip is more natural than the current pattern of querying operational data from one service and embeddings from another. It simplifies the architecture.

Practical considerations for preview adoption

The preview status means the API surface may still shift. Microsoft recommends avoiding production dependencies on the MCP endpoint format for now, and keeping an abstraction layer between the agent and the MCP server so that a server update does not break the agent pipeline.

Authentication is worth planning early. The MCP server uses Azure Managed Identity by default, which works well for agents running inside Azure. For external agents or hybrid setups, you can fall back to key-based auth through the DocumentDB SDK, but Managed Identity is the recommended path. It eliminates credential rotation and reduces the blast radius if credentials leak.

Rate limiting is another consideration. An agent that queries DocumentDB aggressively can consume RU/s faster than expected, especially during the initial connection phase or if a conversation loop triggers repeated queries. Set per-agent rate limits at the MCP server level rather than relying on DocumentDB’s account-level throttling, which affects all traffic, not just the agent.

Getting started

The MCP toolkit for DocumentDB is in public preview. Enable it through the Azure portal or via the Azure SDK CLI. Microsoft recommends starting with a test DocumentDB instance and a simple agent that queries a single collection before scaling up. The Azure SDK team has published a walkthrough for setting up the MCP server, and the Ignite 2025 recordings are linked from the Azure blog.

The toolkit supports both DocumentDB NoSQL API and the MongoDB-compatible API, which covers most DocumentDB deployments. For the vector search features, make sure your DocumentDB instance has vector indexing enabled and your embeddings are stored in a compatible format.

Leave a Reply

Your email address will not be published. Required fields are marked *