Skip to content

[Onboard][Part Four] Mcp Server for Azure DocumentDB (Document)#2054

Open
xingfan-git wants to merge 32 commits intomainfrom
users/xingfan/onboardingvcoremcp_document
Open

[Onboard][Part Four] Mcp Server for Azure DocumentDB (Document)#2054
xingfan-git wants to merge 32 commits intomainfrom
users/xingfan/onboardingvcoremcp_document

Conversation

@xingfan-git
Copy link

@xingfan-git xingfan-git commented Mar 16, 2026

What does this PR do?

This PR added MCP tools for managing Azure DocumentDB (with MongoDB compatibility) document. It implements:

  • Find documents
  • Count documents
  • Insert documents
  • Update documents
  • Delete documents
  • Aggregate operation
  • Find and modify operation
  • Explain operation

Also this PR modified the option file structure for documentdb tools: tools/Azure.Mcp.Tools.DocumentDb/src/Options
Refine args naming, unify tools description, remove redundant e2etestprompt samples

[Any additional context, screenshots, or information that helps reviewers]

Documentation:

Azure DocumentDB (with MongoDB compatibility) documentation

GitHub issue number?

[MCP Server Request] DocumentDB previously known as Azure Cosmos DB for MongoDB (vCore)

Pre-merge Checklist

  • Required for All PRs
    • Read contribution guidelines
    • PR title clearly describes the change
    • Commit history is clean with descriptive messages (cleanup guide)
    • Added comprehensive tests for new/modified functionality
    • Updated servers/Azure.Mcp.Server/CHANGELOG.md and/or servers/Fabric.Mcp.Server/CHANGELOG.md for product changes (features, bug fixes, UI/UX, updated dependencies)
  • For MCP tool changes:
    • One tool per PR: This PR adds or modifies only one MCP tool for faster review cycles
    • Updated servers/Azure.Mcp.Server/README.md and/or servers/Fabric.Mcp.Server/README.md documentation
    • Validate README.md changes using script at eng/scripts/Process-PackageReadMe.ps1. See Package README
    • Updated command list in /servers/Azure.Mcp.Server/docs/azmcp-commands.md and/or /docs/fabric-commands.md
    • Run .\eng\scripts\Update-AzCommandsMetadata.ps1 to update tool metadata in azmcp-commands.md (required for CI)
    • For new or modified tool descriptions, ran ToolDescriptionEvaluator and obtained a score of 0.4 or more and a top 3 ranking for all related test prompts
    • For tools with new names, including new tools or renamed tools, update consolidated-tools.json
    • For renamed tools, follow the Tool Rename Checklist and tag the PR with the breaking-change label
    • For new tools associated with Azure services or publicly available tools/APIs/products, add URL to documentation in the PR description
  • Extra steps for Azure MCP Server tool changes:
    • Updated test prompts in /servers/Azure.Mcp.Server/docs/e2eTestPrompts.md
    • 👉 For Community (non-Microsoft team member) PRs:
      • Security review: Reviewed code for security vulnerabilities, malicious code, or suspicious activities before running tests (crypto mining, spam, data exfiltration, etc.)
      • Manual tests run: added comment /azp run mcp - pullrequest - live to run Live Test Pipeline

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Azure DocumentDB (with MongoDB compatibility) tool area to Azure.Mcp.Server, including document/index/database/collection operations plus diagnostics, and wires it into discovery/docs/testing/packaging.

Changes:

  • Introduces the documentdb area (commands, options, service contract, JSON context/response plumbing) and registers it in Azure.Mcp.Server.
  • Adds unit + live tests and test resource provisioning scripts (bicep + post-deploy initialization).
  • Updates server docs/tool discovery metadata (README, azmcp-commands, e2e prompts, consolidated-tools) and build/packaging logic for MongoDB.Driver trimming constraints.

Reviewed changes

Copilot reviewed 85 out of 85 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tools/Azure.Mcp.Tools.DocumentDb/tests/test-resources.bicep Provisions DocumentDB mongoCluster test resource + outputs connection details
tools/Azure.Mcp.Tools.DocumentDb/tests/test-resources-post.ps1 Post-deploy init using mongosh to seed DB/collection
tools/Azure.Mcp.Tools.DocumentDb/tests/Azure.Mcp.Tools.DocumentDb.UnitTests/Others/GetStatsCommandTests.cs Unit tests for stats command
tools/Azure.Mcp.Tools.DocumentDb/tests/Azure.Mcp.Tools.DocumentDb.UnitTests/Others/CurrentOpsCommandTests.cs Unit tests for current ops command
tools/Azure.Mcp.Tools.DocumentDb/tests/Azure.Mcp.Tools.DocumentDb.UnitTests/Index/ListIndexesCommandTests.cs Unit tests for listing indexes
tools/Azure.Mcp.Tools.DocumentDb/tests/Azure.Mcp.Tools.DocumentDb.UnitTests/Index/DropIndexCommandTests.cs Unit tests for dropping indexes
tools/Azure.Mcp.Tools.DocumentDb/tests/Azure.Mcp.Tools.DocumentDb.UnitTests/Index/CreateIndexCommandTests.cs Unit tests for creating indexes
tools/Azure.Mcp.Tools.DocumentDb/tests/Azure.Mcp.Tools.DocumentDb.UnitTests/Document/UpdateDocumentsCommandTests.cs Unit tests for document updates
tools/Azure.Mcp.Tools.DocumentDb/tests/Azure.Mcp.Tools.DocumentDb.UnitTests/Document/InsertDocumentsCommandTests.cs Unit tests for document insert modes
tools/Azure.Mcp.Tools.DocumentDb/tests/Azure.Mcp.Tools.DocumentDb.UnitTests/Document/FindDocumentsCommandTests.cs Unit tests for find documents + options
tools/Azure.Mcp.Tools.DocumentDb/tests/Azure.Mcp.Tools.DocumentDb.UnitTests/Document/FindAndModifyCommandTests.cs Unit tests for find-and-modify
tools/Azure.Mcp.Tools.DocumentDb/tests/Azure.Mcp.Tools.DocumentDb.UnitTests/Document/ExplainQueryCommandTests.cs Unit tests for explain query
tools/Azure.Mcp.Tools.DocumentDb/tests/Azure.Mcp.Tools.DocumentDb.UnitTests/Document/DeleteDocumentsCommandTests.cs Unit tests for deletes
tools/Azure.Mcp.Tools.DocumentDb/tests/Azure.Mcp.Tools.DocumentDb.UnitTests/Document/CountDocumentsCommandTests.cs Unit tests for counting documents
tools/Azure.Mcp.Tools.DocumentDb/tests/Azure.Mcp.Tools.DocumentDb.UnitTests/Document/AggregateCommandTests.cs Unit tests for aggregations
tools/Azure.Mcp.Tools.DocumentDb/tests/Azure.Mcp.Tools.DocumentDb.UnitTests/Database/ListDatabasesCommandTests.cs Unit tests for database listing/details
tools/Azure.Mcp.Tools.DocumentDb/tests/Azure.Mcp.Tools.DocumentDb.UnitTests/Database/DropDatabaseCommandTests.cs Unit tests for dropping DBs
tools/Azure.Mcp.Tools.DocumentDb/tests/Azure.Mcp.Tools.DocumentDb.UnitTests/Collection/SampleDocumentsCommandTests.cs Unit tests for sampling documents
tools/Azure.Mcp.Tools.DocumentDb/tests/Azure.Mcp.Tools.DocumentDb.UnitTests/Collection/RenameCollectionCommandTests.cs Unit tests for renaming collections
tools/Azure.Mcp.Tools.DocumentDb/tests/Azure.Mcp.Tools.DocumentDb.UnitTests/Collection/DropCollectionCommandTests.cs Unit tests for dropping collections
tools/Azure.Mcp.Tools.DocumentDb/tests/Azure.Mcp.Tools.DocumentDb.UnitTests/Azure.Mcp.Tools.DocumentDb.UnitTests.csproj Adds unit test project
tools/Azure.Mcp.Tools.DocumentDb/tests/Azure.Mcp.Tools.DocumentDb.LiveTests/assets.json Adds assets repo metadata for tests
tools/Azure.Mcp.Tools.DocumentDb/tests/Azure.Mcp.Tools.DocumentDb.LiveTests/DocumentDbCommandTests.cs Live tests calling MCP tools + MongoDB seeding helpers
tools/Azure.Mcp.Tools.DocumentDb/tests/Azure.Mcp.Tools.DocumentDb.LiveTests/Azure.Mcp.Tools.DocumentDb.LiveTests.csproj Adds live test project
tools/Azure.Mcp.Tools.DocumentDb/src/Services/IDocumentDbService.cs Service contract for DocumentDB operations
tools/Azure.Mcp.Tools.DocumentDb/src/Options/** Options model types for all commands
tools/Azure.Mcp.Tools.DocumentDb/src/Options/BaseDocumentDbOptions.cs Base options including connection string
tools/Azure.Mcp.Tools.DocumentDb/src/Models/DocumentDbResponse.cs Unified response envelope for commands/services
tools/Azure.Mcp.Tools.DocumentDb/src/GlobalUsings.cs Adds global System.CommandLine using
tools/Azure.Mcp.Tools.DocumentDb/src/DocumentDbSetup.cs DI registrations + command group wiring for documentdb
tools/Azure.Mcp.Tools.DocumentDb/src/Commands/Others/GetStatsCommand.cs Stats command implementation
tools/Azure.Mcp.Tools.DocumentDb/src/Commands/Others/CurrentOpsCommand.cs Current ops command implementation
tools/Azure.Mcp.Tools.DocumentDb/src/Commands/Index/ListIndexesCommand.cs List indexes command implementation
tools/Azure.Mcp.Tools.DocumentDb/src/Commands/Index/DropIndexCommand.cs Drop index command implementation
tools/Azure.Mcp.Tools.DocumentDb/src/Commands/Index/CreateIndexCommand.cs Create index command implementation
tools/Azure.Mcp.Tools.DocumentDb/src/Commands/DocumentDbOptionDefinitions.cs Central option definitions (names/descriptions/allowed values)
tools/Azure.Mcp.Tools.DocumentDb/src/Commands/DocumentDbJsonContext.cs STJ source-gen context + response serialization helper
tools/Azure.Mcp.Tools.DocumentDb/src/Commands/DocumentDbHelpers.cs BSON/JSON parsing helpers
tools/Azure.Mcp.Tools.DocumentDb/src/Commands/Document/* Document commands (find/count/insert/update/delete/aggregate/fam/explain)
tools/Azure.Mcp.Tools.DocumentDb/src/Commands/Database/* Database commands (list/drop)
tools/Azure.Mcp.Tools.DocumentDb/src/Commands/Collection/* Collection commands (rename/drop/sample)
tools/Azure.Mcp.Tools.DocumentDb/src/Commands/BaseDocumentDbCommand.cs Base command wiring for connection-string option + status mapping
tools/Azure.Mcp.Tools.DocumentDb/src/Azure.Mcp.Tools.DocumentDb.csproj New tool project references + MongoDB.Driver dependency + trim settings
tools/Azure.Mcp.Tools.DocumentDb/src/AssemblyInfo.cs InternalsVisibleTo for unit tests
servers/Azure.Mcp.Server/src/Resources/consolidated-tools.json Adds consolidated tool mappings for DocumentDB + extends db “meta-tool” mapping
servers/Azure.Mcp.Server/src/Program.cs Registers DocumentDbSetup area
servers/Azure.Mcp.Server/docs/e2eTestPrompts.md Adds e2e prompts for DocumentDB commands
servers/Azure.Mcp.Server/docs/azmcp-commands.md Adds CLI command docs for DocumentDB area
servers/Azure.Mcp.Server/changelog-entries/*.yaml Changelog entries for new DocumentDB functionality
servers/Azure.Mcp.Server/README.md Adds prompt examples for DocumentDB
servers/Azure.Mcp.Server/Azure.Mcp.Server.slnx Adds new tool/test projects into solution
eng/scripts/New-BuildInfo.ps1 Disables trimming for servers that depend on MongoDB.Driver
Directory.Packages.props Adds central package version for MongoDB.Driver
.github/CODEOWNERS Adds ownership for DocumentDb tool area

@alzimmermsft alzimmermsft added the Do Not Merge Do Not Merge / WIP PRs label Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Do Not Merge Do Not Merge / WIP PRs

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

3 participants