เซิร์ฟเวอร์ MCP Ro Mongodb MCP Rs | PlugMCP
ข้ามไปยังเนื้อหา ไดเรกทอรี ผลิตภัณฑ์ แหล่งข้อมูล Pricing จากผู้เผยแพร่
เอกสารประกอบ ro-mongodb-mcp-rs
A high-performance Model Context Protocol (MCP) server for executing read-only MongoDB queries . Built in Rust for speed and reliability.
Overview
This server enables LLMs to safely query MongoDB databases through the MCP protocol. It supports two connection types:
High-performance MCP server for read-only MongoDB queries. Supports direct connections and Kubernetes pods. Built in Rust.
เสียบเครื่องมือใดก็ได้เข้ากับเอเจนต์ใดก็ได้ ไดเรกทอรี MCP สำหรับคนที่ไม่เขียนเซิร์ฟเวอร์
ผลิตภัณฑ์
ไดเรกทอรี
นักพัฒนา
บริษัท
Features
Read-only queries - Only find, aggregate, countDocuments, and distinct operations
Query controls - Limit, sort, and projection parameters for find operations
Dual connection support - Kubernetes pods and direct MongoDB URLs
Saved queries with variables - Save reusable queries with {{placeholder}} variables
Schema integration - Data model files help LLMs understand your collections
Auto-discovery - Automatic K8s credential discovery from pod environment
Timeout protection - 30-second query timeout prevents runaway queries
Fast startup - ~4ms cold start, sub-millisecond for cached operations
Quick Start
1. Build
2. Configure Create ~/.config/ro-mongodb-mcp-rs/config.yaml:
# Direct connection (simplest)
connections:
- name: local
mongodb_url: mongodb://localhost:27017
database_name: mydb
# data_model_file_path: /path/to/schema.md # optional
Or copy and customize the example:
cp config.example.yaml ~/.config/ro-mongodb-mcp-rs/config.yaml
3. Run ./target/release/ro-mongodb-mcp-rs
The server communicates via JSON-RPC 2.0 over stdin/stdout.
Configuration Configuration file: ~/.config/ro-mongodb-mcp-rs/config.yaml
Direct MongoDB Connections For local development, MongoDB Atlas, or any network-accessible MongoDB:
connections:
- name: local-dev
mongodb_url: mongodb://localhost:27017
database_name: myapp
data_model_file_path: /path/to/schema.md
- name: atlas-prod
mongodb_url: mongodb+srv://user:[email protected]
database_name: production
data_model_file_path: /path/to/schema.md
Kubernetes Namespace Connections For MongoDB running in Kubernetes clusters:
# Optional: custom kubeconfig
# kubeconfig_path: /path/to/kubeconfig
namespaces:
- namespace_name: production # K8s namespace (also the connection name)
deployment_name: mongodb # Pod label: app=mongodb
database_name: myapp
data_model_file_path: /path/to/schema.md
K8s Credential Discovery: The server reads credentials from pod environment variables:
MONGO_INITDB_ROOT_USERNAME_FILE → file path containing username
MONGO_INITDB_ROOT_PASSWORD_FILE → file path containing password
Configuration Fields Path expansion: All path fields support environment variables ($HOME, ${VAR}) and tilde (~) expansion.
Important: Connection names must be unique across all connections.
MCP Tools The server provides 10 tools:
Discovery Tools
Query Tools // find - retrieve documents
{"status": "active"}
// aggregate - pipeline queries
[{"$match": {}}, {"$group": {"_id": "$status", "count": {"$sum": 1}}}]
// countDocuments - count matching documents
{"status": "active"}
// distinct - unique values (use distinct_field param)
{} // with distinct_field: "country"
Optional parameters (find only):
Saved Query Tools Placeholder Variables: Saved queries support {{placeholder}} syntax for runtime substitution:
// Save with placeholders - quotes in template control output type
{
"query": "{\"name\": \"{{name}}\", \"age\": {{age}}}"
}
// "{{name}}" → string {{age}} → number
// Run with variables (all values are strings)
{
"variables": {"name": "John", "age": "25"}
}
// Result: {"name": "John", "age": 25}
Runtime Overrides: For find operations only, you can override limit, sort, and projection. These are ignored for other operations (with a warning).
Storage: Queries are persisted per connection in ~/.local/share/ro-mongodb-mcp-rs/<connection>.queries.yaml
Usage Examples
Basic Query {
"name": "query_mongodb",
"arguments": {
"connection_name": "local",
"collection_name": "users",
"operation": "find",
"query": "{\"status\": \"active\"}",
"limit": 10,
"sort": "{\"createdAt\": -1}",
"projection": "{\"name\": 1, \"email\": 1}"
}
}
Aggregation Pipeline {
"name": "query_mongodb",
"arguments": {
"connection_name": "local",
"collection_name": "orders",
"operation": "aggregate",
"query": "[{\"$match\": {\"status\": \"completed\"}}, {\"$group\": {\"_id\": \"$userId\", \"total\": {\"$sum\": \"$amount\"}}}]"
}
}
Count Documents {
"name": "query_mongodb",
"arguments": {
"connection_name": "local",
"collection_name": "users",
"operation": "countDocuments",
"query": "{}"
}
}
Distinct Values {
"name": "query_mongodb",
"arguments": {
"connection_name": "local",
"collection_name": "users",
"operation": "distinct",
"query": "{}",
"distinct_field": "country"
}
}
Save a Query (with Variables) {
"name": "save_query",
"arguments": {
"connection_name": "local",
"query_name": "user_activity",
"description": "Get user activity after a date",
"collection_name": "events",
"operation": "find",
"query": "{\"userId\": \"{{userId}}\", \"createdAt\": {\"$gte\": \"{{startDate}}\"}}"
}
}
Run a Saved Query (with Variables) {
"name": "run_saved_query",
"arguments": {
"connection_name": "local",
"query_name": "user_activity",
"variables": {"userId": "12345", "startDate": "2024-01-01T00:00:00Z"},
"limit": 100
}
}
Performance Benchmarks on typical hardware:
Binary size: ~21MB (release build)
MCP Client Integration
Claude Desktop Add to your Claude Desktop config:
{
"mcpServers": {
"mongodb": {
"command": "/path/to/ro-mongodb-mcp-rs"
}
}
}
Goose CLI Add to ~/.config/goose/config.yaml:
extensions:
mongodb:
bundled: false
display_name: "MongoDB"
enabled: true
name: "mongodb"
timeout: 300
type: "stdio"
cmd: "/path/to/ro-mongodb-mcp-rs"
args: []
Or add it interactively with goose configure and select "Command-line Extension".
Generic MCP Client The server uses JSON-RPC 2.0 over stdin/stdout:
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' | ./ro-mongodb-mcp-rs
Development
Prerequisites
Rust 1.85 or later (edition 2024)
For K8s connections: valid kubeconfig with cluster access
For direct connections: network access to MongoDB
Build
Test
Debug Logging RUST_LOG=ro_mongodb_mcp_rs=debug ./target/release/ro-mongodb-mcp-rs
Lint cargo clippy --all-targets
Version Management ./ro-mongodb-mcp-rs --version
./set-version.sh 1.2.3
git push origin main --follow-tags
Troubleshooting
"No healthy pods found" (Kubernetes) # Check pods exist and are running
kubectl get pods -n <namespace> -l app=<deployment_name>
# Verify pod is healthy
kubectl describe pod <pod-name> -n <namespace>
"MongoDB credential environment variable not found" (Kubernetes) # Check pod environment variables
kubectl exec -n <namespace> <pod-name> -- env | grep MONGO
MONGO_INITDB_ROOT_USERNAME_FILE
MONGO_INITDB_ROOT_PASSWORD_FILE
"Failed to read data model file"
Verify the file exists: ls -la /path/to/schema.md
Paths support $HOME, ${VAR}, and ~ expansion
Connection timeout (Direct)
Verify MongoDB is running: mongosh mongodb://localhost:27017
Check network connectivity
Verify credentials in URL are correct
Query timeout Queries timeout after 30 seconds. For large datasets:
Add filters to reduce result size
Use $limit in aggregation pipelines
Use countDocuments first to check data size
Project Structure src/
├── main.rs # Entry point, CLI, initialization
├── config.rs # Configuration loading and validation
├── connection.rs # MongoConnection trait and registry
├── direct_connection.rs # Direct MongoDB URL connections
├── k8s_connection.rs # Kubernetes namespace connections
├── k8s_client.rs # Kubernetes API interactions
├── mcp.rs # MCP server and tool implementations
├── mongodb.rs # Query operations and mongosh execution
├── saved_queries.rs # Query persistence
└── tools.rs # MCP tool parameter types
Security
Read-only by design - Only read operations are supported
No query injection - Operations are validated before execution
Credential isolation - K8s credentials stay in the cluster
Timeout protection - 30-second limit prevents resource exhaustion
Note: Direct connection URLs may contain credentials. Keep your config file secure:
chmod 600 ~/.config/ro-mongodb-mcp-rs/config.yaml
License MIT License. See LICENSE for details.
คะแนนในไดเรกทอรี 8/100 อยู่ในรายการ 10 จาก 10
อยู่ใน MCP Registry ทางการ 0 จาก 18
ผู้ดูแลอ้างสิทธิ์แล้ว 0 จาก 8
ตอบกลับพร้อมรายการเครื่องมือ 0 จาก 12
ดาวบน GitHub 2 จาก 16
ยอดดาวน์โหลดรายสัปดาห์ 0 จาก 10
Graphify Turn any codebase, with its docs, SQL schemas, configs, and PDFs, into a queryable knowledge graph. A /graphify skill for Claude Code, Cursor, Codex, and Gemini CLI: local deterministic AST parsing, e Private Gpt Complete API layer for private AI applications on local models: RAG, skills, tools, MCP, text-to-sql, and more. Works with any OpenAI-compatible inference server. Scientific Agent Skills Turn any AI agent into an AI Scientist. The #1 Agent Skills library for science, used by 250,000+ scientists worldwide. 177 ready-to-use validated skills plus 100+ scientific databases covering biolog Open Code Review Secure, fast, efficient, battle-tested at Alibaba's scale. Hybrid architecture code review tool: deterministic pipelines + LLM Agent, precise line-level comments, built-in multi-language ruleset (NPE, Codebase Memory Local code intelligence for developers and AI agents. Connect code, docs and infrastructure in a persistent graph, with CBM Lens, MCP tools, agent integrations and change-aware test selection. Orm The Prisma ORM: write your application in TypeScript with human-readable queries instead of SQL. Host your database on Prisma Postgres and your app on Prisma Compute. OpenViking Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills. Context Mode Free, local plugin that keeps tool output out of your coding agent's context window. Sandbox and SQLite FTS5 search, 99% fewer bytes in context. Works with Claude Code, Codex, Pi, OMP, OpenCode, Gemin Dbx 25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Dock Xerj AI search engine and MCP server for bots and agents. One Rust binary indexes code, docs, logs, JSONL/CSV and PDFs for BM25 full-text, vector and hybrid search, code search without grep, agent memory a Wasp The batteries-included full-stack framework for the AI era. Develop JS/TS web apps (React, Node.js, and Prisma) using declarative code that abstracts away complex full-stack features like auth, backgr WrenAI GenBI (Generative BI) for AI agents, an open-source, governed text-to-SQL through an open context layer that turns natural-language questions into trusted dashboards, charts, and SQL across 20+ data s เซิร์ฟเวอร์ MCP หมวด Databases เซิร์ฟเวอร์ MCP ที่ดีที่สุดในหมวด Databases
ยังไม่มีรายการเครื่องมือ เซิร์ฟเวอร์แบบรีโมตจะได้รายการหลังการตรวจสอบสถานะครั้งแรก
ติดตั้ง Ro Mongodb MCP Rs อย่างไร? คัดลอกคอนฟิก stdio สำหรับ Cursor, Claude Desktop, Claude Code หรือ VS Code ได้ในหน้านี้ คอนฟิกนี้ใช้การติดตั้งของผู้เผยแพร่ ไม่ใช่พร็อกซีของ PlugMCP
Ro Mongodb MCP Rs ต้องใช้ API key ไหม? ระเบียนนี้ไม่ได้ระบุตัวแปรสภาพแวดล้อมที่จำเป็น
Ro Mongodb MCP Rs ใช้ทรานสปอร์ตแบบใด? Ro Mongodb MCP Rs ทำงานแบบโลคัลผ่าน stdio
Ro Mongodb MCP Rs ถูกตรวจสอบล่าสุดเมื่อใด? ตรวจสอบล่าสุดเมื่อ 2026-10-28 High-performance MCP server for read-only MongoDB queries. Supports direct connections and Kubernetes pods. Built in Rust.
เครื่องมือมีคำอธิบาย 0 จาก 6