mongo-mcp-simple
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MONGO_MCP_TLS | No | Enable TLS (Atlas URIs already include this) | false |
| MONGO_MCP_URI | No | MongoDB connection URI (mongodb:// or mongodb+srv://). Use uri_env in the config file if the URI contains a password. | |
| MONGO_MCP_AUTH | No | Authentication mechanism: scram, ldap, windows (Kerberos), x509, none, or uri | scram if user is set, otherwise none |
| MONGO_MCP_HOST | No | MongoDB host, e.g. server:27017 or m1:27017,m2:27017 | |
| MONGO_MCP_USER | No | Username for authentication | |
| MONGO_MCP_CONFIG | No | Path to multi-profile JSON configuration file. Password environment variables referenced by password_env in the profiles must also be defined. | |
| MONGO_MCP_DATABASE | No | Default database used by tools when database is not specified | |
| MONGO_MCP_MAX_DOCS | No | Maximum number of documents returned in a result | 100 |
| MONGO_MCP_PASSWORD | No | Password for authentication | |
| MONGO_MCP_READONLY | No | Block write tools and write commands | false |
| MONGO_MCP_AUTH_SOURCE | No | Database where the user is defined | admin (ldap/windows: $external) |
| MONGO_MCP_MAX_TIME_MS | No | Query timeout in milliseconds | 60000 |
| MONGO_MCP_REPLICA_SET | No | Replica set name | |
| MONGO_MCP_TLS_CA_FILE | No | Path to CA file | |
| MONGO_MCP_READ_PREFERENCE | No | Read preference: primary, secondaryPreferred, etc. | |
| MONGO_MCP_DIRECT_CONNECTION | No | Connect directly to a single replica set member | |
| MONGO_MCP_TLS_CERTIFICATE_KEY_FILE | No | Path to x509 client certificate key file | |
| MONGO_MCP_SERVER_SELECTION_TIMEOUT_MS | No | Server selection timeout in milliseconds | 10000 |
| MONGO_MCP_TLS_ALLOW_INVALID_CERTIFICATES | No | Allow self-signed certificates for internal company CAs | false |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_connectionsA | List configured MongoDB connection profiles (passwords are never shown; broken ones show their error). |
| test_connectionA | Connect and return server version, edition, topology (standalone / replica set / sharded), the authenticated user and whether transactions are supported. |
| add_connectionB | Register (or replace) a connection profile at runtime and test it. host: "srv01", "srv01:27017" or "h1:27017,h2:27017"; or uri: "mongodb://..." / "mongodb+srv://...". auth: none | scram (user+password) | ldap | windows (Kerberos with the Windows logon) | x509 | uri. Passwords are never passed here: use password_env (name of an environment variable set in mcp.json). |
| remove_connectionC | Close and forget a connection profile. |
| list_databasesB | List databases with size on disk (only the ones the login may see). |
| list_collectionsC | Collections and views of a database with type and estimated document count. name_filter: regex on the name, e.g. "^order". |
| collection_statsC | Document count, data / storage / index sizes (MB), average document size, index sizes, capped flag. |
| list_indexesB | Indexes of a collection with keys and options (unique, sparse, TTL, partial filter). |
| infer_schemaA | Infer the document structure from a random sample: every field path with its BSON types and how often it appears (present_pct). Nested objects use dots, array elements use "[]". |
| findB | Query documents. filter / projection / sort are JSON (Extended JSON for ObjectId, dates...). sort: {"createdAt": -1} or [["a", 1], ["b", -1]]. limit defaults to the profile's max_docs (100). collation: {"locale": "tr", "strength": 2} for Turkish case-insensitive matching: "istanbul" finds "İstanbul" (İ=i, I=ı; regex $options "i" does not fold İ/ı). |
| aggregateB | Run an aggregation pipeline (JSON array of stages). $out / $merge are allowed unless the profile is read-only. limit caps the returned documents (default the profile's max_docs). collation: {"locale": "tr", "strength": 2} for Turkish case-insensitive matching (İ=i, I=ı). |
| count_documentsA | Count documents matching a filter. estimated=true uses collection metadata (fast, ignores the filter). collation: {"locale": "tr", "strength": 2} for Turkish case-insensitive matching (İ=i, I=ı). |
| distinctB | Distinct values of a field (optionally within a filter). Returns at most 5000 values. collation: {"locale": "tr", "strength": 2} for Turkish case-insensitive matching (İ=i, I=ı). |
| insert_documentsB | Insert one document (JSON object) or many (JSON array). Returns the inserted _ids. ordered=false keeps inserting after a failing document. |
| update_documentsB | Update with operators ({"$set": {...}, "$inc": {...}}) or an aggregation pipeline (JSON array). many=false updates the first match. An empty filter requires confirm_all=true. |
| replace_documentB | Replace the first document matching the filter with a whole new document (no update operators). |
| delete_documentsA | Delete the first matching document (many=false) or all matching documents (many=true). An empty filter requires confirm_all=true. |
| run_transactionA | Execute several writes atomically (all or nothing). Requires a replica set or sharded cluster. operations: [{"op": "insert", "collection": "orders", "document": {...}}, {"op": "update", "collection": "stock", "filter": {...}, "update": {"$inc": {"qty": -1}}}, {"op": "insert_many" | "update_many" | "replace" | "delete" | "delete_many", ...}] If any operation fails, nothing is written and the error names the failing step. |
| create_indexA | Create an index. keys: {"customerId": 1, "createdAt": -1} or {"title": "text"} / {"loc": "2dsphere"}. expire_after_seconds makes a TTL index; partial_filter is a filter expression. |
| drop_indexA | Drop an index by name (see list_indexes). The _id index cannot be dropped. |
| create_collectionA | Create a collection or view. options are passed to the 'create' command, e.g. {"validator": {"$jsonSchema": {...}}}, {"capped": true, "size": 1048576}, {"timeseries": {"timeField": "ts"}}, {"viewOn": "orders", "pipeline": [...]}. |
| drop_collectionA | Drop a collection with all its documents and indexes. confirm_name must repeat the collection name. |
| rename_collectionC | Rename a collection within the same database. |
| drop_databaseA | Drop a whole database. confirm_name must repeat the database name. admin/config/local are refused. |
| run_commandA | Run any database command (like db.runCommand), e.g. {"serverStatus": 1}, {"usersInfo": 1}, {"createUser": "app", "pwd": "...", "roles": [...]}, {"collMod": "orders", "validator": {...}}, {"explain": {"find": "orders", "filter": {...}}, "verbosity": "executionStats"}. database defaults to the profile's database (use "admin" for server-level commands). |
| server_statusB | Server health summary: version, uptime, connections, operation counters, memory, replication role. |
| current_opsC | Running operations (opid, op, namespace, seconds running, client, command summary). |
| kill_opA | Kill a running operation by opid (from current_ops). |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 28 tools
Most tools target a clearly distinct resource and action (find vs aggregate vs count_documents vs distinct, list vs create vs drop for collections/indexes). The main overlap is the generic run_command, which can duplicate server_status, current_ops, kill_op, create_index, and other administrative operations; count_documents vs collection_stats is also mildly overlapping. Descriptions still make the intended dedicated tool clear in most cases.
The dominant convention is verb_noun snake_case (list_connections, insert_documents, create_index, drop_collection). There are minor deviations: single-verb tools (find, aggregate, distinct) and noun-based tools (collection_stats, server_status, current_ops). These deviations are readable and predictable, not chaotic.
The server exposes 28 tools, which is above the 25+ threshold for 'too many' under the rubric. The breadth of MongoDB administration explains many of them, but the surface is heavy and could be consolidated in places (e.g. connection management, collection/index lifecycle, and generic run_command coverage).
The surface covers connection management, database/collection/index lifecycle, CRUD, aggregation, counts, distinct values, schema inference, transactions, server health, running ops, and a generic run_command escape hatch. Core MongoDB workflows have no obvious dead ends; less common operations like user management or collMod are reachable through run_command.