DocumentDB Migration MCP Server for migrating data to DocumentDB
Project description
DocumentDB Migration MCP Server
This MCP (Model Context Protocol) server provides tools for migrating data to DocumentDB. It wraps the existing DocumentDB migration tools into an MCP server interface, making them accessible through the MCP protocol.
Features
- Easy Migration Workflow: Complete end-to-end migration workflow that combines index management and full load migration
- Full Load Migration: Migrate data from a source database to DocumentDB in a one-time operation
- Filtered Full Load Migration: Migrate data with filtering based on TTL
- Change Data Capture (CDC): Continuously replicate changes from a source database to DocumentDB
- Resume Token Management: Get change stream resume tokens for CDC operations
- Automatic Boundary Generation: Automatically generate optimal boundaries for segmenting collections during migration
- Index Management: Export, restore, and check compatibility of indexes between MongoDB and DocumentDB
Installation
uvx documentdb-migration-mcp-server@latest
MCP Server Configuration
Add the MCP server to your favorite agentic tools (e.g., for Amazon Q Developer CLI MCP, Claude, etc.) using the following configuration:
{
"documentdb-migration-mcp-server": {
"autoApprove": [
"runEasyMigration",
"runFullLoad",
"runFilteredFullLoad",
"runCDC",
"getResumeToken",
"generateBoundaries",
"dumpIndexes",
"restoreIndexes",
"showIndexCompatibilityIssues",
"showCompatibleIndexes"
],
"disabled": false,
"timeout": 60,
"command": "uvx",
"args": [
"documentdb-migration-mcp-server@latest"
],
"env": {
"FASTMCP_LOG_LEVEL": "ERROR",
"AWS_PROFILE": "default",
"AWS_REGION": "us-east-1"
},
"transportType": "stdio"
}
}
You can customize the AWS profile and region by changing the AWS_PROFILE and AWS_REGION environment variables.
MCP Tools
runEasyMigration
Run a complete end-to-end migration workflow from source to target.
Parameters:
source_uri: Source URI in MongoDB Connection String formattarget_uri: Target URI in MongoDB Connection String formatsource_namespace: Source Namespace as .target_namespace: (Optional) Target Namespace as ., defaults to source_namespacemax_inserts_per_batch: (Optional) Maximum number of inserts to include in a single batch, defaults to 100feedback_seconds: (Optional) Number of seconds between feedback output, defaults to 60dry_run: (Optional) Read source changes only, do not apply to target, defaults to falseverbose: (Optional) Enable verbose logging, defaults to falsecreate_cloudwatch_metrics: (Optional) Create CloudWatch metrics for monitoring, defaults to falsecluster_name: (Optional) Name of cluster for CloudWatch metricsskip_incompatible_indexes: (Optional) Skip incompatible indexes when restoring metadata, defaults to truesupport_2dsphere: (Optional) Support 2dsphere indexes creation, defaults to falseskip_id_indexes: (Optional) Do not create _id indexes, defaults to true
runFullLoad
Run a full load migration from source to target.
Parameters:
source_uri: Source URI in MongoDB Connection String formattarget_uri: Target URI in MongoDB Connection String formatsource_namespace: Source Namespace as .target_namespace: (Optional) Target Namespace as ., defaults to source_namespaceboundaries: (Optional) Comma-separated list of boundaries for segmenting. If not provided, boundaries will be auto-generated.boundary_datatype: (Optional) Datatype of boundaries (objectid, string, int). Auto-detected if boundaries are auto-generated.max_inserts_per_batch: Maximum number of inserts to include in a single batchfeedback_seconds: Number of seconds between feedback outputdry_run: Read source changes only, do not apply to targetverbose: Enable verbose loggingcreate_cloudwatch_metrics: Create CloudWatch metrics for monitoringcluster_name: Name of cluster for CloudWatch metrics
runFilteredFullLoad
Run a filtered full load migration from source to target.
Parameters:
source_uri: Source URI in MongoDB Connection String formattarget_uri: Target URI in MongoDB Connection String formatsource_namespace: Source Namespace as .target_namespace: (Optional) Target Namespace as ., defaults to source_namespaceboundaries: (Optional) Comma-separated list of boundaries for segmenting. If not provided, boundaries will be auto-generated.boundary_datatype: (Optional) Datatype of boundaries (objectid, string, int). Auto-detected if boundaries are auto-generated.max_inserts_per_batch: Maximum number of inserts to include in a single batchfeedback_seconds: Number of seconds between feedback outputdry_run: Read source changes only, do not apply to targetverbose: Enable verbose logging
runCDC
Run a CDC (Change Data Capture) migration from source to target.
Parameters:
source_uri: Source URI in MongoDB Connection String formattarget_uri: Target URI in MongoDB Connection String formatsource_namespace: Source Namespace as .target_namespace: (Optional) Target Namespace as ., defaults to source_namespacestart_position: Starting position - 0 for all available changes, YYYY-MM-DD+HH:MM:SS in UTC, or change stream resume tokenuse_oplog: Use the oplog as change data capture source (MongoDB only)use_change_stream: Use change streams as change data capture source (MongoDB or DocumentDB)threads: Number of threads (parallel processing)duration_seconds: Number of seconds to run before exiting, 0 = run forevermax_operations_per_batch: Maximum number of operations to include in a single batchmax_seconds_between_batches: Maximum number of seconds to await full batchfeedback_seconds: Number of seconds between feedback outputdry_run: Read source changes only, do not apply to targetverbose: Enable verbose loggingcreate_cloudwatch_metrics: Create CloudWatch metrics for monitoringcluster_name: Name of cluster for CloudWatch metrics
getResumeToken
Get the current change stream resume token.
Parameters:
source_uri: Source URI in MongoDB Connection String formatsource_namespace: Source Namespace as .
generateBoundaries
Generate boundaries for segmenting a collection during migration.
Parameters:
uri: MongoDB Connection String format URIdatabase: Database namecollection: Collection namenum_segments: Number of segments to divide the collection intouse_single_cursor: (Optional) Use a single cursor to scan the collection (slower but more reliable), defaults to false
dumpIndexes
Dump indexes from a MongoDB or DocumentDB instance.
Parameters:
uri: URI to connect to MongoDB or Amazon DocumentDBoutput_dir: (Optional) Directory to export indexes to. If not provided, a temporary directory will be created.dry_run: (Optional) Perform processing, but do not actually export indexesdebug: (Optional) Output debugging information
restoreIndexes
Restore indexes to an Amazon DocumentDB instance.
Parameters:
uri: URI to connect to Amazon DocumentDBindex_dir: Directory containing index metadata to restore fromskip_incompatible: (Optional) Skip incompatible indexes when restoring metadata, defaults to truesupport_2dsphere: (Optional) Support 2dsphere indexes creation, defaults to falsedry_run: (Optional) Perform processing, but do not actually restore indexesdebug: (Optional) Output debugging informationshorten_index_name: (Optional) Shorten long index name to compatible length, defaults to trueskip_id_indexes: (Optional) Do not create _id indexes, defaults to true
showIndexCompatibilityIssues
Show compatibility issues with Amazon DocumentDB.
Parameters:
index_dir: Directory containing index metadata to checkdebug: (Optional) Output debugging information
showCompatibleIndexes
Show compatible indexes with Amazon DocumentDB.
Parameters:
index_dir: Directory containing index metadata to checkdebug: (Optional) Output debugging information
Requirements
- Python 3.10+
- PyMongo
- Boto3 (for CloudWatch metrics)
- MCP Server
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file documentdb_migration_mcp_server-0.5.0.tar.gz.
File metadata
- Download URL: documentdb_migration_mcp_server-0.5.0.tar.gz
- Upload date:
- Size: 30.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ddf4a12cf186fb0058e7e289091e253e5550ab4ed789ded7c3951c1120f91cc0
|
|
| MD5 |
81c9a719acdbd6d44edf4710c701a572
|
|
| BLAKE2b-256 |
d68aa60e4a8c620c5e19b0130e1f28ef27fb4d26b03cc9bec95f5ebd48d0ecd9
|
File details
Details for the file documentdb_migration_mcp_server-0.5.0-py3-none-any.whl.
File metadata
- Download URL: documentdb_migration_mcp_server-0.5.0-py3-none-any.whl
- Upload date:
- Size: 39.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15d4a8b427ad92595cccdf5d9b30dac084e48dab0a97a4b86c49fa5c9a72cfb2
|
|
| MD5 |
2dbca6b4009aee521679dc922c53e176
|
|
| BLAKE2b-256 |
55993e0c7caa77fd6876c8455b6b3e79450b88dcead9cbb862c5e2e7a1e50c77
|