{"id":12202,"date":"2026-05-06T09:00:29","date_gmt":"2026-05-06T16:00:29","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/cosmosdb\/?p=12202"},"modified":"2026-05-06T06:53:26","modified_gmt":"2026-05-06T13:53:26","slug":"azure-cosmos-db-shell-public-preview-ai-mcp-cli","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cosmosdb\/azure-cosmos-db-shell-public-preview-ai-mcp-cli\/","title":{"rendered":"Announcing the Public Preview of Azure Cosmos DB Shell: Open-Source Power Meets AI-Driven Database Automation"},"content":{"rendered":"<p><strong>\u00a0<\/strong>Today, we&#8217;re thrilled to announce the <strong>public preview of Azure Cosmos DB Shell<\/strong> \u2013 a powerful, open-source command-line interface that revolutionizes how developers interact with their Azure Cosmos DB databases. With integrated Model Context Protocol (MCP) server support, native agentic capabilities, and bash-like syntax, Azure Cosmos DB Shell transforms database management into an intelligent, developer-friendly experience.<\/p>\n<p><iframe src=\"\/\/www.youtube.com\/embed\/yCWn0Qey978\" width=\"560\" height=\"314\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<h2><strong> From Friction to Flow: Why Cosmos DB Shell, and Why Open Source<\/strong><\/h2>\n<p>If you have ever bounced between a portal tab, an SDK sample, and a half-finished script just to answer one database question, you already know the problem Azure Cosmos DB Shell is built to solve. Modern teams move fast, but database workflows often slow them down with too many steps and too much context switching.<\/p>\n<p>Azure Cosmos DB Shell changes that rhythm. You can move quickly with familiar CLI commands, automate repeatable work in CI\/CD pipelines, and plug into emerging AI and agent workflows without introducing another complicated layer. In practice, it means less time wiring things together and more time shipping.<\/p>\n<p>The open-source foundation is what makes this especially meaningful. You can inspect exactly how commands run, trace behavior end to end, and avoid black-box surprises. Security-minded teams can audit implementation details. Platform teams can fork, extend, and adapt the shell for their own standards. Individual developers can contribute fixes and ideas that benefit everyone.<\/p>\n<p>That is the core story of this preview: not just a new CLI, but a shared foundation for faster, more transparent, and more collaborative database operations. We are building Cosmos DB Shell in the open so it can evolve with real developer workflows, from solo builders to enterprise engineering organizations.<\/p>\n<h2><strong>Agentic AI Experience: MCP Server Integration<\/strong><\/h2>\n<p>The standout feature of Azure Cosmos DB Shell is its <strong>Model Context Protocol (MCP) server support<\/strong>, enabling an entirely new paradigm: <strong>AI agents that understand and manage your databases<\/strong>.<\/p>\n<p><strong>\u00a0Why MCP + Cosmos DB Shell Matters for Developers<\/strong><\/p>\n<p>While MCP is now a standard interface for AI integration, what matters to you as a developer is what the Cosmos DB Shell MCP server actually does. It translates natural language requests into precise database operations, eliminating the context switch between your AI assistant and your database.<\/p>\n<p>Instead of telling an AI assistant &#8220;go check the database&#8221; and then manually running commands in the shell, the assistant runs the commands through the shell automatically. Better yet, the shell exposes all its commands as MCP tools that your AI platform understands:<\/p>\n<p><strong>Navigation tools:<\/strong> cd, ls, pwd &#8211; your assistant can traverse database hierarchies<\/p>\n<p><strong>Query tools: query &#8211;<\/strong> run SQL queries and get structured results back<\/p>\n<p><strong>Data manipulation:<\/strong> create item, update, rm &#8211; add, modify, and delete data autonomously<\/p>\n<p><strong>Database management:<\/strong> mkdb, mkcon, rmdb, rmcon &#8211; create and manage schemas<\/p>\n<p><strong>Inspection tools:<\/strong> endpoint, pwd &#8211; understand the current context<\/p>\n<p>Think of it this way: every command you already know how to run in the shell becomes available to your AI system. No custom API layer, no new integration code. Your assistant can navigate your database, run queries, validate results, and take actions\u2014all with the same shell interface you&#8217;re already familiar with.<\/p>\n<h2><strong>Enabling Agentic Experiences<\/strong><\/h2>\n<p>Imagine scenarios powered by MCP-enabled Cosmos DB Shell:<\/p>\n<ol>\n<li><strong>Intelligent Data Analysis<\/strong><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p><strong>\u00a0<a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/05\/Intelligent-schema-scaled.png\"><img decoding=\"async\" class=\"wp-image-12208 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/05\/Intelligent-schema-scaled.png\" alt=\"Intelligent schema image\" width=\"196\" height=\"696\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/05\/Intelligent-schema-scaled.png 704w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/05\/Intelligent-schema-288x1024.png 288w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/05\/Intelligent-schema-768x2727.png 768w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/05\/Intelligent-schema-433x1536.png 433w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/05\/Intelligent-schema-577x2048.png 577w\" sizes=\"(max-width: 196px) 100vw, 196px\" \/><\/a>\u00a0<\/strong><\/p>\n<ol start=\"2\">\n<li><strong>Autonomous Data Management<\/strong><\/li>\n<\/ol>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/05\/Real-time-Monitoring-Alerts-scaled.png\"><img decoding=\"async\" class=\" wp-image-12209 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/05\/Real-time-Monitoring-Alerts-scaled.png\" alt=\"Real time Monitoring 038 Alerts image\" width=\"227\" height=\"827\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/05\/Real-time-Monitoring-Alerts-scaled.png 686w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/05\/Real-time-Monitoring-Alerts-82x300.png 82w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/05\/Real-time-Monitoring-Alerts-281x1024.png 281w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/05\/Real-time-Monitoring-Alerts-768x2798.png 768w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/05\/Real-time-Monitoring-Alerts-422x1536.png 422w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/05\/Real-time-Monitoring-Alerts-562x2048.png 562w\" sizes=\"(max-width: 227px) 100vw, 227px\" \/><\/a><\/p>\n<ol start=\"3\">\n<li><strong>Real-time Monitoring &amp; Alerts<\/strong><\/li>\n<\/ol>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/05\/Autonomous-Data-Management-scaled.png\"><img decoding=\"async\" class=\" wp-image-12210 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/05\/Autonomous-Data-Management-scaled.png\" alt=\"Autonomous Data Management image\" width=\"447\" height=\"1701\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/05\/Autonomous-Data-Management-scaled.png 657w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/05\/Autonomous-Data-Management-79x300.png 79w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/05\/Autonomous-Data-Management-269x1024.png 269w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/05\/Autonomous-Data-Management-768x2924.png 768w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/05\/Autonomous-Data-Management-538x2048.png 538w\" sizes=\"(max-width: 447px) 100vw, 447px\" \/><\/a><\/p>\n<ol start=\"4\">\n<li><strong>Intelligent Schema Evolution<\/strong><\/li>\n<\/ol>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/05\/Intelligent-Data-Analysis-scaled.png\"><img decoding=\"async\" class=\"wp-image-12211 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/05\/Intelligent-Data-Analysis-scaled.png\" alt=\"Intelligent Data Analysis image\" width=\"348\" height=\"925\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/05\/Intelligent-Data-Analysis-scaled.png 940w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/05\/Intelligent-Data-Analysis-113x300.png 113w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/05\/Intelligent-Data-Analysis-385x1024.png 385w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/05\/Intelligent-Data-Analysis-768x2042.png 768w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/05\/Intelligent-Data-Analysis-578x1536.png 578w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/05\/Intelligent-Data-Analysis-770x2048.png 770w\" sizes=\"(max-width: 348px) 100vw, 348px\" \/><\/a><\/p>\n<p>Enabling MCP is simple. In your VS Code settings:<\/p>\n<pre class=\"prettyprint language-json\"><code class=\"language-json\">\u00a0\u00a0\u00a0 {\u00a0\u00a0\u00a0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 \"cosmosDB.shell.MCP.enabled\": true,\u00a0\u00a0\u00a0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 \"cosmosDB.shell.MCP.port\": 6128,\u00a0\u00a0\u00a0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 \"cosmosDB.shell.MCP.startOnLaunch\": true,\u00a0\u00a0\u00a0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 \"cosmosDB.shell.MCP.bindToLocalhost\": true\u00a0\u00a0\u00a0\r\n\u00a0\u00a0\u00a0 }\u00a0\u00a0\u00a0<\/code><\/pre>\n<p>Once enabled, your AI assistants can interact with Cosmos DB through a secure, standardized interface. The MCP server runs locally, giving you complete control over database access and data security.<\/p>\n<h2><strong>\u00a0Intuitive CLI Shell: Bash-Like Power<\/strong><\/h2>\n<p>Beyond AI integration, Cosmos DB Shell provides a developer-friendly command-line experience inspired by Unix\/Linux shells.<\/p>\n<p><strong>Familiar Commands<\/strong><\/p>\n<p>Work with bash-like syntax you already know:<\/p>\n<p><strong>\u00a0\u00a0\u00a0 # Navigate your database hierarchy\u00a0\u00a0\u00a0<\/strong><\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">cosmosdb-shell&gt; cd mydb\r\ncosmosdb-shell mydb&gt; cd users<\/code><\/pre>\n<p><strong>\u00a0\u00a0\u00a0 # List containers or documents\u00a0\u00a0\u00a0<\/strong><\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">cosmosdb-shell mydb&gt; ls<\/code><\/pre>\n<p><strong>\u00a0\u00a0\u00a0 # Show current location\u00a0\u00a0\u00a0<\/strong><\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">cosmosdb-shell mydb\/users&gt; pwd\r\n\/mydb\/users<\/code><\/pre>\n<p><strong>\u00a0\u00a0\u00a0 # Query documents with SQL\u00a0\u00a0<\/strong><\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">cosmosdb-shell mydb\/users&gt; query \"SELECT * FROM c WHERE c.active = true\"<\/code><\/pre>\n<p><strong>\u00a0\u00a0\u00a0 # Insert documents\u00a0\u00a0\u00a0<\/strong><\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">cosmosdb-shell mydb\/users&gt; create {\"name\": \"Alice\", \"email\": \"alice@example.com\"}<\/code><\/pre>\n<p><strong>\u00a0\u00a0\u00a0 # Delete with precision\u00a0\u00a0\u00a0<\/strong><\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">cosmosdb-shell mydb\/users&gt; delete \"SELECT * FROM c WHERE c.status = 'inactive'\"<\/code><\/pre>\n<p><strong>Powerful Features<\/strong><\/p>\n<p><strong>Pipe Support<\/strong>: Chain commands for data transformations<\/p>\n<p><strong>Scripting<\/strong>: Automate complex workflows with shell scripts<\/p>\n<p><strong>JSON Output<\/strong>: Work with structured data natively<\/p>\n<p><strong>Batch Operations<\/strong>: Execute bulk inserts, updates, and deletes efficiently<\/p>\n<p><strong>Interactive &amp; Non-Interactive Modes<\/strong>: Use interactively or embed in automation<\/p>\n<p><strong>\ud83d\ude80 Installation &amp; Getting Started<\/strong><\/p>\n<h2><strong>Three Ways to Install<\/strong><\/h2>\n<ol>\n<li><strong>VS Code Extension<\/strong> (Recommended)\u00a0 Install the pre release version directly from the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-azuretools.vscode-cosmosdb\">Marketplace<\/a>\u00a0 which is a seamless integration with your editor One-click setup<\/li>\n<li><strong>NuGet Global Tool <\/strong>dotnet tool install &#8211;global CosmosDBShell &#8211;prerelease<\/li>\n<li><strong>\u00a0Self-Contained Binaries \u00a0<\/strong><a href=\"https:\/\/github.com\/Azure\/CosmosDBShell\/releases\/tag\/1.0-preview\">Pre-built executables for Windows, macOS, Linux<\/a><\/li>\n<\/ol>\n<p>For comprehensive guides, see the <a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/cosmos-db\/shell\/overview\"><u>documentation<\/u><\/a>.<\/p>\n<p><strong>Security Built In, Not Bolted On<\/strong><\/p>\n<p>We built security into Cosmos DB Shell from the ground up, not as an afterthought. Whether you&#8217;re a solo developer working locally or managing enterprise databases at scale, Cosmos DB Shell gives you the tools and guardrails you need.<\/p>\n<p><strong>\u00a0Multiple Authentication Paths for Every Context <\/strong>: You&#8217;re not locked into one approach. Development workflows often benefit from quick account key access, but production systems demand stronger security. Cosmos DB Shell adapts: use Entra ID for interactive sessions (most secure), Managed Identity in production environments (no secrets to manage), or account keys for rapid prototyping. Each method is purpose-built for its use case.<\/p>\n<p><strong>Credentials Treated as Sacred <\/strong>: We partnered with Azure Key Vault to ensure your credentials never live unencrypted on disk. Cosmos DB Shell integrates seamlessly with Key Vault, so your database keys stay protected whether you&#8217;re connecting locally or in CI\/CD pipelines. This isn&#8217;t optional\u2014it&#8217;s the foundation of responsible database access.<\/p>\n<p><strong>MCP Server Isolation:<\/strong> When you enable MCP for AI integrations, the server runs locally on your machine and binds only to localhost by default. This means AI agents never have unbounded network access to your databases; traffic stays within your control boundary. You decide what leaves your system.<\/p>\n<p><strong>Every Operation Gets Logged<\/strong>: Compliance teams and security auditors need visibility. Cosmos DB Shell tracks all database operations\u2014who ran what, when, and from where\u2014giving you the audit trail enterprises require. Whether you&#8217;re subject to regulatory requirements or just want to understand what changed in your data, the logs are there.<\/p>\n<p><strong>Encryption You Control<\/strong>: Support for customer-managed keys (CMK) means your encryption keys never leave your control. If your compliance posture demands it, Cosmos DB Shell respects that requirement.<\/p>\n<p><strong>Roadmap &amp; Future<\/strong><\/p>\n<p>We&#8217;re just getting started. The public preview is your opportunity to:<\/p>\n<p><strong>Shape Development<\/strong>: Your feedback directly influences roadmap priorities<\/p>\n<p><strong>Contribute<\/strong>: Submit pull requests, report bugs, and suggest features<\/p>\n<p><strong>Collaborate<\/strong>: Work with Microsoft engineers to build the future of database tooling<\/p>\n<p>We&#8217;re planning:<\/p>\n<ul>\n<li>Extended scripting capabilities<\/li>\n<li>Custom command extensions<\/li>\n<li>Deeper observability and monitoring<\/li>\n<li>Enhanced AI agent frameworks<\/li>\n<\/ul>\n<h2><strong>Join the Community<\/strong><\/h2>\n<p>Cosmos DB Shell succeeds because of our community. We invite you to:<\/p>\n<p><strong><a href=\"https:\/\/github.com\/Azure\/CosmosDBShell\">Star on GitHub<\/a> <\/strong>\u00a0&#8211; Show your support<\/p>\n<p><a href=\"https:\/\/github.com\/Azure\/CosmosDBShell\/issues\"><strong>Report Issues<\/strong>\u00a0<\/a>&#8211; Help us fix bugs<\/p>\n<p><a href=\"https:\/\/github.com\/Azure\/CosmosDBShell\/discussions\/categories\/ideas\"><strong>Share Your Story<\/strong>\u00a0<\/a>&#8211; Tell us how you&#8217;re using the shell<\/p>\n<h2><strong>About Azure Cosmos DB<\/strong><\/h2>\n<p>Azure Cosmos DB is a fully managed and serverless NoSQL and vector database for modern app development, including AI applications. With its SLA-backed speed and availability as well as instant dynamic scalability, it is ideal for real-time NoSQL and MongoDB applications that require high performance and distributed computing over massive volumes of NoSQL and vector data.<\/p>\n<p>To stay in the loop on Azure Cosmos DB updates, follow us on\u00a0<a href=\"https:\/\/twitter.com\/AzureCosmosDB\">X<\/a>,\u00a0<a href=\"https:\/\/aka.ms\/AzureCosmosDBYouTube\">YouTube<\/a>, and\u00a0<a href=\"https:\/\/www.linkedin.com\/company\/azure-cosmos-db\/\">LinkedIn<\/a>.\u00a0 Join the discussion with other developers on the\u00a0<a href=\"https:\/\/discord.gg\/pczdC2SU\">#nosql channel on the Microsoft Open Source Discord<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0Today, we&#8217;re thrilled to announce the public preview of Azure Cosmos DB Shell \u2013 a powerful, open-source command-line interface that revolutionizes how developers interact with their Azure Cosmos DB databases. With integrated Model Context Protocol (MCP) server support, native agentic capabilities, and bash-like syntax, Azure Cosmos DB Shell transforms database management into an intelligent, developer-friendly [&hellip;]<\/p>\n","protected":false},"author":80443,"featured_media":12213,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1610,12,1980,14,2017,1985,2018,667],"tags":[],"class_list":["post-12202","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai","category-announcements","category-azure-cosmos-db","category-core-sql-api","category-azure-cosmos-db-tools","category-data-explorer","category-mcp","category-security"],"acf":[],"blog_post_summary":"<p>\u00a0Today, we&#8217;re thrilled to announce the public preview of Azure Cosmos DB Shell \u2013 a powerful, open-source command-line interface that revolutionizes how developers interact with their Azure Cosmos DB databases. With integrated Model Context Protocol (MCP) server support, native agentic capabilities, and bash-like syntax, Azure Cosmos DB Shell transforms database management into an intelligent, developer-friendly [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts\/12202","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/users\/80443"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/comments?post=12202"}],"version-history":[{"count":2,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts\/12202\/revisions"}],"predecessor-version":[{"id":12216,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts\/12202\/revisions\/12216"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/media\/12213"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/media?parent=12202"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/categories?post=12202"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/tags?post=12202"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}