mcp-mongodb
MCP Server
Documentation
## MCP 配置文件
{
"mcpServers": {
"mongodb": {
"command": "node",
"args": [
"E:\\project\\mongodb\\build\\index2.js"
],
"env": {
"MONGO_URI": "mongodb://localhost:27017/"
},
"disabled": false,
"autoApprove": []
},
}
}## 读取资源请求示例:
mongodb
read_resource
{
"uri": "mongodb://localhost:27017/common"
}
## CallToolRequestSchema、ReadResourceRequestSchema 的区别
CallToolRequestSchema:
用于执行特定操作
适合执行命令、处理数据等主动操作
示例:获取集合列表、插入数据等
ReadResourceRequestSchema:
用于读取资源内容
适合提供对资源的只读访问
示例:读取集合文档、获取数据库状态等
## 多表联查示例
mongodb
multi_collection_query
{
"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
}
]
}
## 修改托送测试test
pull-request
漫长的过程
跑一下试试
Frequently asked questions
What is mcp-mongodb?
mcp-mongodb is MCP Server
How do I install mcp-mongodb?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is mcp-mongodb open source?
Yes — it is hosted on GitHub at https://github.com/nan-qin/mcp-mongodb.
Related MCP tools
Playwright MCP server TypeScript-based implementation. Trusted by 22000+ developers. Trusted by 22000+ developers. Trusted by 22000+ developers.
Official Notion MCP Server TypeScript-based implementation. Trusted by 3400+ developers. Trusted by 3400+ developers. Trusted by 3400+ developers.
Directory for Awesome MCP Servers TypeScript-based implementation. Trusted by 1900+ developers. Trusted by 1900+ developers.
🧩 MCP Gateway - A lightweight gateway service that instantly transforms existing MCP Servers and APIs into MCP servers with zero code changes.
MCP Aggregator, Orchestrator, Middleware, Gateway in one docker TypeScript-based implementation. Trusted by 1400+ developers.
MCP Server for kubernetes management commands TypeScript-based implementation. Trusted by 1100+ developers. Trusted by 1100+ developers.
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP