A Model Context Protocol server that provides read-only access to MongoDB databases through standardized MCP tools
MongoDB server has strong fundamentals: all 11 tools are explicitly defined with clear verb-noun naming, descriptions present for tools and parameters, and complete input schemas visible in src/index.ts. However, there are critical gaps in schema completeness, output documentation, and error handling guidance. Descriptions are adequate (80-150 chars typically) but lack dependency hints and operational context. Input schemas are well-typed with object/string/number/array, but output schemas are entirely undocumented, LLMs cannot plan downstream calls or extract needed fields. Error handling exists (McpError with ErrorCode) but provides no recovery guidance. No tool annotations (readOnlyHint/destructiveHint). The read-only safety focus is good, but the execution lacks production polish.
Execute an aggregation pipeline on a MongoDB collection with safety validation
Count documents in a collection matching a filter
Explain query execution plan and performance characteristics
Export query results to CSV format
Get statistics about a collection including document count, average size, indexes, and storage details
Get distinct values for a field in a collection
Analyze a collection and infer its schema from sample documents
No output schemas documented for any tool. LLMs cannot determine what fields to expect, what type each field has, or what IDs/references are returned for chaining downstream calls. This violates the core pattern:tool-description and mxe:include-chaining-ids.
Error handling provides no recovery guidance. The code throws McpError with ErrorCode and a message (e.g., 'MONGODB_URI environment variable is required'), but does not tell the LLM what to do next or classify errors as retryable/user-fixable/fatal. This violates pattern:recovery-guide and pattern:error-classification.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-21 | C | 60 | 2026-07-28+ | v2 |
| 2026-03-09 | F | 22 | - | v1 |
List all collections in a database
List all available databases on the MongoDB server
Execute a find query on a MongoDB collection with optional filtering, sorting, and projection
Perform full-text search on a collection with text indexes
No tool annotations. Despite all tools being read-only, none declare readOnlyHint in the tool definition. This is a current MCP spec 2026-07-28 pattern that aids agent reasoning about side effects. Missing from all 11 tools.
Descriptions lack dependency hints and operational context. For example, infer_schema says 'Analyze a collection and infer its schema from sample documents' but does not indicate it should be called FIRST before query_collection, or that it helps guide filter construction. This violates pattern:tool-description's requirement to state WHEN to use the tool.
aggregate_collection validates the pipeline at runtime but does not document which stages are unsafe. The validateAggregationPipeline() method rejects $out, $merge, $set, $unset, $replaceRoot, $replaceWith, but the tool description does not list these restrictions. LLMs will attempt them and see a generic error. Should list allowed vs disallowed stages in the parameter description.
query_collection, aggregate_collection, export_to_csv accept unbounded limit parameters. While code comments indicate defaults and caps (e.g., limit max 10000), the parameter descriptions do not state the minimum/maximum. Unbounded numeric parameters invite absurd values that break APIs or cause timeouts.