Configuration
Once the MongoDB connection is validated, configuration defines how MCP Express exposes collection operations as callable tools. Most actions require a collection and may include a filter, update document, or data payload depending on the tool.
Tool Orchestration
MongoDB uses an action-oriented model where each tool maps to a bounded database operation. Configuration should keep collection scope explicit and expose only the runtime fields needed by that action.
Action Configuration
Use action configuration to define which database operation the tool performs and which parameters are resolved at runtime. Filters, updates, and documents can include placeholders like {{email}}.
Supported Actions
- Find: Retrieve documents using a filter, projection, and optional limit.
- Insert One: Insert a single document.
- Insert Many: Insert a list of documents.
- Update One: Update a single document using a filter and update document.
- Update Many: Update multiple documents using a filter and update document.
- Delete One: Delete a single document using a filter.
- Delete Many: Delete multiple documents using a filter.
- Count: Count documents using a filter.
Common Runtime Parameters
Use the following parameters according to the configured action.
| Parameter | Required | Description |
|---|---|---|
| Action | Yes | The operation to run: find, insert_one, insert_many, update_one, update_many, delete_one, delete_many, or count. |
| Collection | Yes | The target collection for the action. |
| Filter | Some | JSON filter used by find, count, update_*, and delete_*. |
| Update Document | Some | JSON update document for update_one and update_many (for example, $set). |
| Document | Some | JSON document for insert_one. |
| Documents | Some | JSON array of documents for insert_many. |
| Projection | No | JSON projection to limit returned fields for find. |
| Limit | No | Maximum number of documents to return for find. |
Governance Controls
Limit tools to approved databases and collections, and avoid broad filters in production. Require explicit filters for updates and deletes, and keep projections narrow so only expected fields are returned.
Use the built-in testing utility to verify placeholder resolution, required field behavior, and permissions before enabling tools in production.