mcp-mongo-server 3.1.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +5 -1
  2. package/build/index.js +1764 -1579
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -14,7 +14,7 @@ A Model Context Protocol (MCP) server that lets AI assistants work with your Mon
14
14
  ## Why use it
15
15
 
16
16
  - **Talk to your database in plain language** — the assistant discovers your collections and their shape automatically.
17
- - **Safe by default** — turn on read-only mode to let an assistant explore without any risk of changing data.
17
+ - **Read-only mode** — restrict write operations globally or per connection.
18
18
  - **Works everywhere** — connects to standalone, replica set, sharded, and Atlas deployments, over plain or TLS connections.
19
19
 
20
20
  ## Key Features
@@ -92,6 +92,9 @@ npx -y mcp-mongo-server "mongodb://..." --transport http --port 3001 --allowed-o
92
92
  |----------|-------------|
93
93
  | `MCP_MONGODB_URI` | MongoDB connection URI (alternative to the argument) |
94
94
  | `MCP_MONGODB_CONNECTIONS` | JSON object of named MongoDB connections and their database permissions |
95
+ | `MCP_MONGODB_MAX_RESULT_DOCUMENTS` | Optional document cap for `query` and `aggregate` |
96
+ | `MCP_MONGODB_MAX_RESULT_BYTES` | Optional UTF-8 byte cap for the compact JSON results array, minimum 2 |
97
+ | `MCP_MONGODB_QUERY_TIMEOUT_MS` | Optional MongoDB operation timeout in milliseconds for `query`, `aggregate`, `listIndexes`, and query count and explain operations |
95
98
  | `MCP_MONGODB_READONLY` | Enable read-only mode (`"true"`) |
96
99
  | `MCP_MONGODB_ALLOW_CROSS_DB` | Allow cross-database aggregation stages (`"true"`) |
97
100
  | `MCP_MONGODB_ALLOW_SERVER_JS` | Allow server-side JavaScript operators (`"true"`) |
@@ -123,6 +126,7 @@ uses a local build and the two [Docker test databases](docs/development.md#local
123
126
 
124
127
  - Discover targets with `listConnections` and `listDatabases`. Pass `connectionId` and `database` to database tools and the collection analysis prompt. Omitted selectors use the `default` connection and its URI database.
125
128
  - Omit `databases` to allow only the URI database. If supplied, the list must include the URI database. Global read-only mode applies to every connection.
129
+ - Write tools appear in tool discovery when at least one connection is writable. Use `listConnections` to choose a writable target.
126
130
  - A positional URI or `MCP_MONGODB_URI` can supply `default` when the JSON contains only secondary connections. Named connections default to a 5-second server selection timeout. Set `serverSelectionTimeoutMS` in the URI to override it.
127
131
  - If a connection is offline, `resources/list` reports its ID and fails. Tools targeting other connections remain usable.
128
132