1. Conduid
  2. Data
  3. kiliczsh/mcp-mongo-server
MCP server · Data

kiliczsh/mcp-mongo-server

A Model Context Protocol Server for MongoDB

80Excellent

Scored 10 hours ago · breakdown

About kiliczsh/mcp-mongo-server

kiliczsh/mcp-mongo-server is an MCP server published by kiliczsh in the Data category: a Model Context Protocol Server for MongoDB.

The repository has 282 stars and 56 forks, with the last commit 2 months ago. Recent commit activity is the strongest signal that reported issues will get attention.

Install

From source
git clone https://github.com/kiliczsh/mcp-mongo-server

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

✦

Ask AI about kiliczsh/mcp-mongo-server

Powered by Claude · Grounded in docs

I know everything about kiliczsh/mcp-mongo-server. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

Static checks derived from the repository 10 hours ago. Heuristics on the source, not an audit.

  • ✓README presentThe repository ships documentation.
  • ✓License declaredUsable under a stated license.
  • !Tests presentNo tests found. Behaviour changes may go unnoticed between versions.
  • ✓Dependencies pinnedA lockfile pins dependency versions.
  • ✓No dynamic code executionSource scan found no eval, dynamic Function, or shell execution.
  • !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.

Releases

3.0.13.0.1 · 29 Jul 2026Patch 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`)…
3.0.03.0.0 · 29 Jul 2026Major 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`,…
2.1.12.1.1 · 21 Jul 2026Security 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…
2.1.02.1.0 · 21 Jul 2026MCP 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…
2.0.22.0.2 · 6 Feb 20262.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…

README

MCP MongoDB Server


NPM Version NPM Downloads NPM License

A Model Context Protocol (MCP) server that lets AI assistants work with your MongoDB databases. It exposes your collections, infers their schemas, and runs queries, aggregations, and writes through a standard interface — so tools like Claude Desktop and Cursor can read and reason about your data.

Demo

Why use it

  • Talk to your database in plain language — the assistant discovers your collections and their shape automatically.
  • Safe by default — turn on read-only mode to let an assistant explore without any risk of changing data.
  • Works everywhere — connects to standalone, replica set, sharded, and Atlas deployments, over plain or TLS connections.

Key Features

  • Read-Only Mode — blocks every write path (insert, update, index creation, and aggregation stages like $out/$merge that could modify data).
  • Smart ObjectId Handling — configurable auto/none/force conversion of 24-character hex strings to ObjectIds.
  • Schema Inference — automatic collection schema detection from document samples.
  • Query & Aggregation — full query and aggregation pipeline support, with optional explain plans.
  • Write Operations — insert, update, and index creation (when read-only mode is off).
  • Time Conversion — a convertTime helper turns Unix timestamps and date strings into UTC/GMT/ISO, so date queries stay unambiguous across timezones.
  • Progress & Cancellation — long operations report progress and can be cancelled mid-flight.
  • Two Transports — run locally over stdio, or expose an HTTP endpoint for remote access.

Requirements

  • Node.js 20 or newer

Quick Start

Point the server at your database — no install step needed:

npx -y mcp-mongo-server mongodb://localhost:27017/mydatabase

Explore safely, without any chance of changing data:

npx -y mcp-mongo-server mongodb://localhost:27017/mydatabase --read-only

Usage

Local (stdio)

This is the default, used by Claude Desktop, Cursor, and other local clients:

npx -y mcp-mongo-server "mongodb://user:pass@localhost:27017/mydatabase"

Remote (HTTP)

Expose an HTTP endpoint at /mcp for remote or multi-client access:

npx -y mcp-mongo-server "mongodb://user:pass@localhost:27017/mydatabase" --transport http --port 3001

By default, only requests without a browser Origin (CLIs, IDEs) and requests from localhost are accepted; everything else is rejected with 403 to guard against DNS-rebinding attacks. Allow specific browser origins with --allowed-origins:

npx -y mcp-mongo-server "mongodb://..." --transport http --port 3001 --allowed-origins "https://app.example.com"

Options

Flag Description
--read-only, -r Block all write operations
--allow-cross-db Allow aggregation $out/$merge/$lookup to target other databases (off by default)
--allow-server-js Allow server-side JavaScript operators $function/$where/$accumulator (off by default)
--transport, -t stdio (default) or http
--port, -p HTTP port (default 3001)
--allowed-origins Comma-separated browser origins to allow in HTTP mode
--json-limit Max HTTP request body size (default 10mb)
--auth-token Require Authorization: Bearer <token> on the HTTP endpoint

Environment Variables

Variable Description
MCP_MONGODB_URI MongoDB connection URI (alternative to the argument)
MCP_MONGODB_READONLY Enable read-only mode ("true")
MCP_MONGODB_ALLOW_CROSS_DB Allow cross-database aggregation stages ("true")
MCP_MONGODB_ALLOW_SERVER_JS Allow server-side JavaScript operators ("true")
MCP_PORT HTTP port
MCP_HTTP_ALLOWED_ORIGINS Comma-separated browser origins to allow in HTTP mode
MCP_HTTP_JSON_LIMIT Max HTTP request body size (default 10mb)
MCP_HTTP_AUTH_TOKEN Bearer token required to access the HTTP endpoint

Security

Database scope. The server operates on the database in your connection string. Aggregation stages that reach another database ($out, $merge, $lookup with an explicit db) are rejected by default, so a pipeline can't quietly read from or write to databases you didn't point it at. Enable them with --allow-cross-db if you need them.

Server-side JavaScript. The aggregation operators $function, $where, and $accumulator run arbitrary JavaScript on the MongoDB server. They are rejected by default; enable them with --allow-server-js if you trust the pipelines being run.

Read-only mode blocks every write path, including aggregation stages that write or run server-side JavaScript ($out, $merge, $function, $where, $accumulator).

Least privilege. Application-level checks only go so far — the strongest guarantee comes from the database. Connect with a MongoDB user scoped to just the database you need, with read-only permissions when the assistant only needs to explore. That way the database itself enforces the boundary, as defense in depth.

Documentation

License

MIT — see LICENSE for details.

README fetched from the repository 10 hours ago. The original is authoritative.

Questions

About kiliczsh/mcp-mongo-server

How do I install kiliczsh/mcp-mongo-server?

No package has been published for this server, so install it from source: clone the repository and follow its README.

Is kiliczsh/mcp-mongo-server safe to use with an AI agent?

Its trust score is 80 out of 100 (excellent). It passes 4 of the 6 static security checks run so far; the failures are listed above. It has no ConduID identity yet, so agent calls to it are not receipted.

Is kiliczsh/mcp-mongo-server still maintained?

Yes — the latest release is 3.0.1 (29 Jul 2026), and the last commit was 2 months ago. The repository has 282 stars and 1 open issues.