# DocumentDB MCP server

> Connects AI agents to Azure DocumentDB and MongoDB-compatible databases through stateless tools for databases, collections, indexes, and documents.

- Repository: https://github.com/microsoft/documentdb-mcp
- Page: https://hostedmcp.org/servers/microsoft/documentdb-mcp
- Official: yes
- Transport: —
- Stars: 3
- License: MIT

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `ALLOW_AGGREGATE_WRITE_STAGES` | no | no |  |
| `AUTH_REQUIRED` | no | no |  |
| `CONNECTION_PROFILES` | no | no |  |
| `CONNECTION_PROFILES_FILE` | no | no |  |
| `DOCUMENTDB_LOCAL_URI` | no | no |  |
| `ENABLE_MANAGEMENT_TOOLS` | no | no |  |
| `ENABLE_READ_TOOLS` | no | no |  |
| `ENABLE_WRITE_TOOLS` | no | no |  |
| `ENTRA_AUDIENCE` | no | no |  |
| `ENTRA_TENANT_ID` | no | no |  |
| `MCP_MANAGEMENT_ROLE_VALUES` | no | no |  |
| `MCP_READ_ROLE_VALUES` | no | no |  |
| `MCP_WRITE_ROLE_VALUES` | no | no |  |
| `RATE_LIMIT_ENABLED` | no | no |  |
| `RATE_LIMIT_MAX_REQUESTS` | no | no |  |
| `RATE_LIMIT_WINDOW_MS` | no | no |  |
| `TRUST_LOCAL_STDIO` | no | no |  |

## Tools (18)

- `list_databases`
- `drop_database`
- `drop_collection`
- `rename_collection`
- `sample_documents`
- `current_ops`
- `get_statistics`
- `create_index`
- `list_indexes`
- `drop_index`
- `find_documents`
- `count_documents`
- `insert_documents`
- `update_documents`
- `delete_documents`
- `aggregate`
- `find_and_modify`
- `explain_operation`

## FAQ

### Can I use this server with MongoDB-compatible databases?

Yes, the server works with Azure DocumentDB and other MongoDB-compatible DocumentDB deployments.

### How do I install the server using npx?

You can run the server directly from GitHub using the command: npx -y github:microsoft/documentdb-mcp.

### Does the server support write and management tools?

By default, only read tools are exposed. You must set ENABLE_WRITE_TOOLS and/or ENABLE_MANAGEMENT_TOOLS to true in your environment variables to enable them.

### Is this server ready for production?

No, it is currently in Public Preview and is not recommended for production workloads without your own review.
