Releases: kiliczsh/mcp-mongo-server
Release list
3.0.1
Patch release.
Renames the CLI bin from mongodb to mcp-mongo-server so npx -y mcp-mongo-server "<connection-string>" (the form documented in the README) resolves directly.
Previously, because the package name (mcp-mongo-server) and bin name (mongodb) differed, npx failed to resolve the single bin:
sh: mongodb: command not found
and the only working invocation was the awkward npx -y -p mcp-mongo-server mongodb "<connection-string>".
No API or behavior changes.
Full changelog: #45
3.0.0
Major release: migrates to the MCP SDK v2 with dual-era protocol support, adds security hardening, and introduces new capabilities.
Highlights
Protocol / SDK
- Migrated to MCP SDK v2 (
@modelcontextprotocol/server,/node,/express). - Dual-era protocol support — negotiates
2026-07-28while still serving legacy2025-11-25clients. - Error semantics aligned with the newer spec: validation/lookup misses return
InvalidParams(-32602).
Security hardening (opt-in, safe by default)
- Cross-database scoping — aggregations pinned to the connected database; cross-db
$lookup/$out/$mergerejected unless--allow-cross-db. - Server-side JavaScript blocked by default (
$where,$function,$accumulator,mapReduce) unless--allow-server-js. - Hardened system-collection guard (case-insensitive).
- Configurable HTTP body limit (
--json-limit); oversized/malformed bodies return proper JSON-RPC errors. - Nesting-depth guard on the aggregation operator scan.
- Optional bearer-token auth for the HTTP transport (
--auth-token), constant-time comparison.
Features & fixes
- New
convertTimetool (Unix/date → UTC ISO 8601 / GMT / Unix + server timezone); date filters honor timezone offsets. - Fixed
sorton thequerytool (was silently stripped from the input schema). - Fixed
createIndexreturning an empty{}— now returns{ acknowledged, createdIndexes, indexCount }.
Breaking changes
- Runs on the MCP SDK v2 line and negotiates the
2026-07-28protocol (legacy2025-11-25still supported). - Stricter defaults: cross-database targets and server-side JavaScript are rejected unless explicitly enabled.
- Minimum MongoDB server version is 4.2+ (modern driver requirement); older servers can no longer be connected.
Full changelog: #44
2.1.1
Security fix
Fixes a read-only mode bypass in the aggregate tool. When the server was started with --read-only (or MCP_MONGODB_READONLY=true), an aggregation pipeline containing $out or $merge could still write to or replace collections, bypassing the read-only protection. Server-side JavaScript operators ($function, $accumulator, $where) are now rejected in read-only mode as well.
Affected: all versions up to and including 2.1.0 when run in read-only mode.
Fixed: aggregation pipelines are now recursively checked and these operators are rejected under read-only mode. Normal (writable) mode is unchanged.
For defense in depth, we also recommend enforcing read-only access at the database level with a read-only MongoDB user.
Full Changelog: 2.1.0...2.1.1
2.1.0
MCP 2025-11-25 spec compliance, security hardening and dependency updates
Spec compliance
- SEP-1303: validation and MongoDB runtime errors are now tool execution errors (
isError: true) so models can self-correct; unknown tools remain protocol errors, cancellation propagates asAbortError - Task-augmented execution only runs when explicitly requested by the client
- Added
title,descriptionandwebsiteUrlto server implementation info - Tool schemas verified against JSON Schema 2020-12 (strict), tool names conform to SEP-986
Security
- Origin header validation on HTTP transport (DNS rebinding protection): invalid origins get
403 Forbidden; configurable via--allowed-origins/MCP_HTTP_ALLOWED_ORIGINS - Dependency overrides for 13 vulnerable transitive packages: audit findings reduced from 57 (1 critical, 16 high) to 3 moderate
Dependencies
@modelcontextprotocol/sdk1.29 (protocol 2025-11-25),mongodb7.5,zod4,@biomejs/biome2.5,@types/node26, inspector 1.0
Tested end-to-end against MongoDB 4.4, 6.0, 7.0 and 8.2 (standalone, replica set, no-auth, auth+keyFile RS, TLS) — 7/7 passing.
Full Changelog: 2.0.2...2.1.0
2.0.2
2.0.2
Breaking Changes
- Dockerfile completely rewritten — now uses multi-stage
oven/bun+node:22-slimbuild instead ofdebian:bullseye-slimwithmcp-proxy - Removed
mcp-proxydependency — HTTP transport is now native docker-compose.ymlno longer usestty/stdin_open(HTTP mode by default)
Features
- Streamable HTTP transport:
--transport httpflag starts an Express server with MCP Streamable HTTP at/mcp - Port configuration:
--portflag andMCP_PORTenv var (default:3001) - Request logging: HTTP mode logs every request with timestamp, client IP, method, status, duration, and MCP method
- Docker healthcheck: built-in health monitoring via
/mcpendpoint - Docker logging:
json-filedriver with rotation (10MB x 3 files)
Improvements
- Multi-stage Docker build — smaller image, no git clone, copies local files
tsupexternals:@modelcontextprotocol/sdkandmongodbkept as runtime imports.dockerignoreadded to reduce build context- CI workflows switched from npm to bun, Node 20 to 22
- Docs reorganized to reference example files
Full Changelog: 1.3.0...2.0.2
2.0.1
2.0.1
Breaking Changes
- Dockerfile completely rewritten — now uses multi-stage
oven/bun+node:22-slimbuild instead ofdebian:bullseye-slimwithmcp-proxy - Removed
mcp-proxydependency — HTTP transport is now native docker-compose.ymlno longer usestty/stdin_open(HTTP mode by default)
Features
- Streamable HTTP transport:
--transport httpflag starts an Express server with MCP Streamable HTTP at/mcp - Port configuration:
--portflag andMCP_PORTenv var (default:3001) - Request logging: HTTP mode logs every request with timestamp, client IP, method, status, duration, and MCP method
- Docker healthcheck: built-in health monitoring via
/mcpendpoint - Docker logging:
json-filedriver with rotation (10MB x 3 files)
Improvements
- Multi-stage Docker build — smaller image, no git clone, copies local files
tsupexternals:@modelcontextprotocol/sdkandmongodbkept as runtime imports.dockerignoreadded to reduce build context- CI workflows switched from npm to bun, Node 20 to 22
- Docs reorganized to reference example files
Full Changelog: 1.3.0...2.0.1
2.0.0
2.0.0
Breaking Changes
- Dockerfile completely rewritten — now uses multi-stage
oven/bun+node:22-slimbuild instead ofdebian:bullseye-slimwithmcp-proxy - Removed
mcp-proxydependency — HTTP transport is now native docker-compose.ymlno longer usestty/stdin_open(HTTP mode by default)
Features
- Streamable HTTP transport:
--transport httpflag starts an Express server with MCP Streamable HTTP at/mcp - Port configuration:
--portflag andMCP_PORTenv var (default:3001) - Request logging: HTTP mode logs every request with timestamp, client IP, method, status, duration, and MCP method
- Docker healthcheck: built-in health monitoring via
/mcpendpoint - Docker logging:
json-filedriver with rotation (10MB x 3 files)
Improvements
- Multi-stage Docker build — smaller image, no git clone, copies local files
tsupexternals:@modelcontextprotocol/sdkandmongodbkept as runtime imports.dockerignoreadded to reduce build context- CI workflows switched from npm to bun, Node 20 to 22
- Docs reorganized to reference example files
Full Changelog: 1.3.0...2.0.0
1.3.0
What's Changed
- feat: implement read-only mode for MongoDB connections by @kiliczsh in #11
- Fix output not JSON by @rvanderfeer in #12
- feat(call): add sort option to query operation by @s-xync in #26
New Contributors
- @rvanderfeer made their first contribution in #12
- @s-xync made their first contribution in #26
Full Changelog: 1.1.0...1.3.0
1.2.0
What's Changed
- feat: implement read-only mode for MongoDB connections by @kiliczsh in #11
- Fix output not JSON by @rvanderfeer in #12
New Contributors
- @rvanderfeer made their first contribution in #12
Features
- Added completion handler for MongoDB collections
- Added automatic ObjectId conversion with configurable modes
- Implemented intelligent conversion of string IDs to MongoDB ObjectId based on field names
- Added new objectIdMode parameter supporting "auto", "none" or "force" conversion strategies
- Added default value and schema improvements to tools endpoints
- Added MongoDB environment variable support
- MCP_MONGODB_URI
- MCP_MONGODB_READONLY
Bug Fixes
- Fixed MCP ping tool error handling
- Fixed commitQuorum type to string only in index creation schema
Code Improvements
- Refactored codebase into modular structure
- Refactored MongoDB call handler for better code organization
- Improved error handling
Issues Resolved
- #15: Automatic ObjectId conversion with configurable modes
- #16: Default value and schema improvements to tools endpoints
- #17 & #20: commitQuorum type in index creation schema
Full Changelog: 1.1.0...1.2.0
1.1.2
What's Changed
- feat: implement read-only mode for MongoDB connections by @kiliczsh in #11
- Fix output not JSON by @rvanderfeer in #12
New Contributors
- @rvanderfeer made their first contribution in #12
Full Changelog: 1.1.0...1.1.2