Skip to content

Releases: kiliczsh/mcp-mongo-server

3.0.1

Choose a tag to compare

@kiliczsh kiliczsh released this 29 Jul 11:45
55310c0

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

Choose a tag to compare

@kiliczsh kiliczsh released this 29 Jul 11:31
9ea8487

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-28 while still serving legacy 2025-11-25 clients.
  • 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/$merge rejected 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 convertTime tool (Unix/date → UTC ISO 8601 / GMT / Unix + server timezone); date filters honor timezone offsets.
  • Fixed sort on the query tool (was silently stripped from the input schema).
  • Fixed createIndex returning an empty {} — now returns { acknowledged, createdIndexes, indexCount }.

Breaking changes

  • Runs on the MCP SDK v2 line and negotiates the 2026-07-28 protocol (legacy 2025-11-25 still 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

Choose a tag to compare

@kiliczsh kiliczsh released this 21 Jul 22:06

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

Choose a tag to compare

@kiliczsh kiliczsh released this 21 Jul 21:17
655e68f

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 as AbortError
  • Task-augmented execution only runs when explicitly requested by the client
  • Added title, description and websiteUrl to 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/sdk 1.29 (protocol 2025-11-25), mongodb 7.5, zod 4, @biomejs/biome 2.5, @types/node 26, 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

Choose a tag to compare

@kiliczsh kiliczsh released this 06 Feb 15:41

2.0.2

Breaking Changes

  • Dockerfile completely rewritten — now uses multi-stage oven/bun + node:22-slim build instead of debian:bullseye-slim with mcp-proxy
  • Removed mcp-proxy dependency — HTTP transport is now native
  • docker-compose.yml no longer uses tty/stdin_open (HTTP mode by default)

Features

  • Streamable HTTP transport: --transport http flag starts an Express server with MCP Streamable HTTP at /mcp
  • Port configuration: --port flag and MCP_PORT env 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 /mcp endpoint
  • Docker logging: json-file driver with rotation (10MB x 3 files)

Improvements

  • Multi-stage Docker build — smaller image, no git clone, copies local files
  • tsup externals: @modelcontextprotocol/sdk and mongodb kept as runtime imports
  • .dockerignore added 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

Choose a tag to compare

@kiliczsh kiliczsh released this 06 Feb 15:38

2.0.1

Breaking Changes

  • Dockerfile completely rewritten — now uses multi-stage oven/bun + node:22-slim build instead of debian:bullseye-slim with mcp-proxy
  • Removed mcp-proxy dependency — HTTP transport is now native
  • docker-compose.yml no longer uses tty/stdin_open (HTTP mode by default)

Features

  • Streamable HTTP transport: --transport http flag starts an Express server with MCP Streamable HTTP at /mcp
  • Port configuration: --port flag and MCP_PORT env 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 /mcp endpoint
  • Docker logging: json-file driver with rotation (10MB x 3 files)

Improvements

  • Multi-stage Docker build — smaller image, no git clone, copies local files
  • tsup externals: @modelcontextprotocol/sdk and mongodb kept as runtime imports
  • .dockerignore added 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

Choose a tag to compare

@kiliczsh kiliczsh released this 06 Feb 15:35

2.0.0

Breaking Changes

  • Dockerfile completely rewritten — now uses multi-stage oven/bun + node:22-slim build instead of debian:bullseye-slim with mcp-proxy
  • Removed mcp-proxy dependency — HTTP transport is now native
  • docker-compose.yml no longer uses tty/stdin_open (HTTP mode by default)

Features

  • Streamable HTTP transport: --transport http flag starts an Express server with MCP Streamable HTTP at /mcp
  • Port configuration: --port flag and MCP_PORT env 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 /mcp endpoint
  • Docker logging: json-file driver with rotation (10MB x 3 files)

Improvements

  • Multi-stage Docker build — smaller image, no git clone, copies local files
  • tsup externals: @modelcontextprotocol/sdk and mongodb kept as runtime imports
  • .dockerignore added 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

Choose a tag to compare

@kiliczsh kiliczsh released this 26 Apr 19:16

What's Changed

New Contributors

Full Changelog: 1.1.0...1.3.0

1.2.0

Choose a tag to compare

@kiliczsh kiliczsh released this 12 Apr 21:13

What's Changed

New Contributors

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

Choose a tag to compare

@kiliczsh kiliczsh released this 22 Mar 15:20

What's Changed

New Contributors

Full Changelog: 1.1.0...1.1.2