Skip to main content
Glama

MongoDB MCP

Feature-rich MCP server for MongoDB with multi-connection support. Connect many clusters at once — no switching, no duplicate MCP processes.


Quick start

Add to your MCP client configuration (path depends on client — e.g. Claude Desktop, VS Code, Windsurf):

{
  "mcpServers": {
    "mongodb": {
      "command": "npx",
      "args": ["-y", "@raviraj87/mongodb-mcp"],
      "env": {
        "MONGODB_URI": "mongodb://localhost:27017/mydb"
      }
    }
  }
}

Option B — multiple connections (copy config.example.yaml~/.mongodb-mcp.yaml):

default_connection: local
connections:
  local:
    uri_env: MONGODB_URI
  staging:
    uri_env: MONGODB_URI_STAGING
  prod:
    uri_env: MONGODB_URI_PROD
    read_only: true

Set URIs in mcp.json env. Every tool accepts optional connection: "staging".

Extra connections via env (no YAML):

MONGODB_EXTRA_CONNECTIONS=staging:MONGODB_URI_STAGING,prod:MONGODB_URI_PROD

Related MCP server: MongoDB MCP Server for LLMs

vs official mongodb-mcp-server

Feature

Official

This server

Multiple clusters simultaneously

Switch or N processes

Named connection param

Composite tools

No

explore_collection, database_overview, compare_collections

Diagnostics

mongodb-logs

+ server_status, current_ops, repl_set_status

Knowledge search

Yes

Yes (search_knowledge, optional)

Atlas API

Full

Core read ops (optional)

Per-connection read_only

No

Yes


Tools (~45)

Connection: list_connections, ping, connect

Read: find, find_one, aggregate, aggregate_db, count, explain, distinct, sample_documents, text_search, export_query

Metadata: list_databases, list_collections, collection_schema, collection_indexes, collection_storage_size, collection_stats, db_stats, validate_collection

Write: insert_many, update_many, delete_many, bulk_write, find_one_and_*

Admin: create_collection, drop_collection, rename_collection, create_index, drop_index, drop_database, coll_mod

Diagnostics: server_status, current_ops, repl_set_status, mongodb_logs, list_commands

Composite: explore_collection, database_overview, analyze_query, compare_collections, index_health

Assistant: list_knowledge_sources, search_knowledge (disable with assistant.enabled: false)

Atlas: atlas_list_*, atlas_inspect_cluster, atlas_performance_advisor (set atlas.enabled: true)


Safety

  • Global or per-connection read_only

  • index_check — reject collection scans

  • disable_server_side_js — block $where, $function

  • confirmation_required_tools — destructive ops need confirmed: true

  • max_documents_per_query, max_payload_bytes

  • connection_filter — expose only specific connections per project


Install from source

cd mongodb-mcp
npm install
npm run build

Clone from GitHub:

git clone https://github.com/raviraj-ntp/mongodb-mcp.git
{
  "command": "node",
  "args": ["/path/to/mongodb-mcp/dist/index.js"]
}

License

Copyright © 2026 Ravi Raj. Licensed under the MIT License.

A
license - permissive license
-
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    F
    maintenance
    A Model Context Protocol (MCP) server that enables LLMs to interact directly with MongoDB databases. Query collections, inspect schemas, and manage data seamlessly through natural language.
    Last updated
    45
    174
    MIT
  • A
    license
    -
    quality
    D
    maintenance
    An MCP server that enables large language models to interact directly with MongoDB databases, allowing them to query collections, inspect schemas, and manage data through natural language.
    Last updated
    45
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    A Model Context Protocol server that enables interaction with MongoDB databases and MongoDB Atlas, allowing users to perform database operations and manage Atlas resources through natural language.
    Last updated
    22
    64,747
    Apache 2.0
  • A
    license
    -
    quality
    D
    maintenance
    A Model Context Protocol (MCP) server for MongoDB operations, enabling AI assistants to interact with MongoDB databases through a standardized interface.
    Last updated
    40
    4
    MIT

View all related MCP servers

Related MCP Connectors

  • GibsonAI MCP server: manage your databases with natural language

  • MCP server for AI dialogue using various LLM models via AceDataCloud

  • Official Microsoft MCP Server to query Microsoft Entra data using natural language

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/raviraj-ntp/mongodb-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server