Back to Home
chrstnwhlrt icon

ro-mongodb-mcp-rs

Verified Safe

by chrstnwhlrt

Overview

A Model Context Protocol (MCP) server for executing read-only MongoDB queries, enabling LLMs to safely interact with MongoDB databases.

Installation

Run Command
./target/release/ro-mongodb-mcp-rs

Environment Variables

  • KUBECONFIG
  • RUST_LOG

Security Notes

The server is explicitly designed for read-only operations, preventing accidental or malicious write/delete actions. Query injection risks are mitigated by JSON-escaping collection names and validating user-provided queries as JSON before execution. For Kubernetes connections, it uses `mongosh --eval` but with carefully constructed and escaped commands. Credentials for K8s are discovered securely from mounted files within the MongoDB pods (paths defined by environment variables). Direct connections use a native Rust MongoDB driver. A 30-second query timeout is in place to prevent resource exhaustion. Users are advised to secure the `config.yaml` file if it contains direct MongoDB connection strings with credentials.

Similar Servers

Stats

Interest Score36
Security Score9
Cost ClassHigh
Avg Tokens500
Stars1
Forks0
Last Update2025-11-27

Tags

MongoDBMCPLLMRustDatabase Query