awslabs.documentdb-mcp-server

v2.0.2
awslabs.documentdb-mcp-server Checked 15 hours ago Published 14 days ago

An AWS Labs Model Context Protocol (MCP) server for documentdb

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

find

Run a query against a DocumentDB collection. This tool queries documents from a specified collection based on a filter. Returns: List[Dict[str, Any]]: List of matching documents

ParameterTypeDescription
collection *stringName of the collection
database *stringName of the database
query *objectQuery filter (e.g., {"name": "example"})
limitintegerMaximum number of documents to return (default: 10)
projectionFields to include/exclude (e.g., {"_id": 0, "name": 1})

aggregate

Run an aggregation pipeline against a DocumentDB collection. This tool executes a DocumentDB aggregation pipeline on a specified collection. Returns: List[Dict[str, Any]]: List of aggregation results

ParameterTypeDescription
collection *stringName of the collection
database *stringName of the database
pipeline *arrayDocumentDB aggregation pipeline
limitintegerMaximum number of documents to return (default: 10)

insert

Insert one or more documents into a DocumentDB collection. This tool inserts new documents into a specified collection. Returns: Dict[str, Any]: Insert operation results including document IDs

ParameterTypeDescription
collection *stringName of the collection
database *stringName of the database
documents *Document or list of documents to insert

update

Update documents in a DocumentDB collection. This tool updates existing documents that match a specified filter. Returns: Dict[str, Any]: Update operation results

ParameterTypeDescription
collection *stringName of the collection
database *stringName of the database
filter *objectFilter to select documents to update
update *objectUpdate operations to apply. It should either include DocumentDB operators like $set, or an entire document if the entire document needs to be replaced.
manybooleanWhether to update multiple documents (default: False)
upsertbooleanWhether to create a new document if no match is found (default: False)

delete

Delete documents from a DocumentDB collection. This tool deletes documents that match a specified filter. Returns: Dict[str, Any]: Delete operation results

ParameterTypeDescription
collection *stringName of the collection
database *stringName of the database
filter *objectFilter to select documents to delete
manybooleanWhether to delete multiple documents (default: False)

listDatabases

List all available databases in the DocumentDB cluster. This tool returns the names of all accessible databases in the connected cluster. Returns: Dict[str, Any]: List of database names

createCollection

Create a new collection in a DocumentDB database. This tool creates a new collection in the specified database. Returns: Dict[str, Any]: Status of collection creation

ParameterTypeDescription
collection *stringName of the collection to create
database *stringName of the database

listCollections

List collections in a DocumentDB database. This tool returns the names of all collections in a specified database. Returns: List[str]: List of collection names

ParameterTypeDescription
database *stringName of the database

dropCollection

Drop a collection from a DocumentDB database. This tool completely removes a collection and all its documents from the specified database. This operation cannot be undone, so use it with caution. Returns: Dict[str, Any]: Status of the drop operation

ParameterTypeDescription
collection *stringName of the collection to drop
database *stringName of the database

countDocuments

Count documents in a DocumentDB collection. This tool counts the number of documents in a collection that match the provided filter. If no filter is provided, it counts all documents. Returns: Dict[str, Any]: Count result

ParameterTypeDescription
collection *stringName of the collection
database *stringName of the database
filterQuery filter to count specific documents

getDatabaseStats

Get statistics about a DocumentDB database. This tool retrieves statistics about the specified database, including storage information and collection data. Returns: Dict[str, Any]: Database statistics

ParameterTypeDescription
database *stringName of the database

getCollectionStats

Get statistics about a DocumentDB collection. This tool retrieves detailed statistics about the specified collection, including size, document count, and storage information. Returns: Dict[str, Any]: Collection statistics

ParameterTypeDescription
collection *stringName of the collection
database *stringName of the database

analyzeSchema

Analyze the schema of a collection by sampling documents. This tool samples documents from a collection and provides information about the document structure and field coverage across the sampled documents. Returns: Dict[str, Any]: Schema analysis results including field coverage

ParameterTypeDescription
collection *stringName of the collection to analyze
database *stringName of the database
sample_sizeintegerNumber of documents to sample (default: 100)

explainOperation

Get an explanation of how an operation will be executed. This tool returns the execution plan for a query or aggregation operation, helping you understand how DocumentDB will process your operations. Returns: Dict[str, Any]: Operation explanation

ParameterTypeDescription
collection *stringName of the collection
database *stringName of the database
operation_type *stringType of operation to explain (find, aggregate)
pipelinePipeline for DocumentDB aggregation operations
queryQuery for find operations
verbositystringExplanation verbosity level (queryPlanner, executionStats)