Skip to main content

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.

ParameterRequiredDescription
ActionYesThe operation to run: find, insert_one, insert_many, update_one, update_many, delete_one, delete_many, or count.
CollectionYesThe target collection for the action.
FilterSomeJSON filter used by find, count, update_*, and delete_*.
Update DocumentSomeJSON update document for update_one and update_many (for example, $set).
DocumentSomeJSON document for insert_one.
DocumentsSomeJSON array of documents for insert_many.
ProjectionNoJSON projection to limit returned fields for find.
LimitNoMaximum 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.

Test Tool Contracts Before Deployment

Use the built-in testing utility to verify placeholder resolution, required field behavior, and permissions before enabling tools in production.