Mcp Mongodb

Mcp Mongodb

MCP Server

nan-qin

Databases
Visit Server

README

MCP 配置文件

{
  "mcpServers": {
    "mongodb": {
      "command": "node",
      "args": [
        "E:\\project\\mongodb\\build\\index2.js"
      ],
      "env": {
        "MONGO_URI": "mongodb://localhost:27017/"
      },
      "disabled": false,
      "autoApprove": []
    },
  }
}

读取资源请求示例:

<use_mcp_tool> <server_name>mongodb</server_name> <tool_name>read_resource</tool_name>

{ "uri": "mongodb://localhost:27017/common" }

</use_mcp_tool>

CallToolRequestSchema、ReadResourceRequestSchema 的区别

CallToolRequestSchema: 用于执行特定操作 适合执行命令、处理数据等主动操作 示例:获取集合列表、插入数据等

ReadResourceRequestSchema: 用于读取资源内容 适合提供对资源的只读访问 示例:读取集合文档、获取数据库状态等

多表联查示例

<use_mcp_tool> <server_name>mongodb</server_name> <tool_name>multi_collection_query</tool_name>

{ "database": "common", "collection": "players", "pipeline": [ { "$lookup": { "from": "platform", "localField": "platform", "foreignField": "appKey", "as": "platformInfo" } }, { "$unwind": "$platformInfo" }, { "$project": { "_id": 1, "pid": 1, "__v": 1, "bank": 1, "ip": 1, "lobbyUrl": 1, "platform": "$platformInfo", "rtp": 1, "_collection": { "$literal": "players" } } }, { "$limit": 2 } ] }

</use_mcp_tool>

Recommended Servers

Metabase MCP Server

Metabase MCP Server

Enables AI assistants to interact with Metabase databases and dashboards, allowing users to list and execute queries, access data visualizations, and interact with database resources through natural language.

Featured
JavaScript
Airtable MCP Server

Airtable MCP Server

A Model Context Protocol server that provides tools for programmatically managing Airtable bases, tables, fields, and records through Claude Desktop or other MCP clients.

Featured
JavaScript
mcp-shodan

mcp-shodan

MCP server for querying the Shodan API and Shodan CVEDB. This server provides tools for IP lookups, device searches, DNS lookups, vulnerability queries, CPE lookups, and more.

Featured
JavaScript
Supabase MCP Server

Supabase MCP Server

A Model Context Protocol (MCP) server that provides programmatic access to the Supabase Management API. This server allows AI models and other clients to manage Supabase projects and organizations through a standardized interface.

Featured
JavaScript
MCP DuckDB Knowledge Graph Memory Server

MCP DuckDB Knowledge Graph Memory Server

A memory server for Claude that stores and retrieves knowledge graph data in DuckDB, enhancing performance and query capabilities for conversations with persistent user information.

Featured
TypeScript
dbt Semantic Layer MCP Server

dbt Semantic Layer MCP Server

A server that enables querying the dbt Semantic Layer through natural language conversations with Claude Desktop and other AI assistants, allowing users to discover metrics, create queries, analyze data, and visualize results.

Featured
TypeScript
Verodat MCP Server

Verodat MCP Server

An MCP server that integrates Verodat's data management capabilities with AI systems like Claude Desktop, enabling users to manage accounts, workspaces, and datasets, as well as perform AI-powered queries on their data.

Official
Local
TypeScript
GreptimeDB MCP Server

GreptimeDB MCP Server

A Model Context Protocol server implementation that enables AI assistants to securely interact with GreptimeDB, allowing them to explore database schema, read data, and execute SQL queries through a controlled interface.

Official
Python
LlamaCloud MCP Server

LlamaCloud MCP Server

A MCP server connecting to a managed index on LlamaCloud. This is a TypeScript-based MCP server that implements a connection to a managed index on LlamaCloud.

Official
JavaScript
MongoDB MCP Server

MongoDB MCP Server

Provides read-only access to MongoDB databases for LLMs to inspect collection schemas and execute aggregation pipelines.

Official
JavaScript