Provides a standardized protocol for interacting with MongoDB databases, supporting CRUD operations on documents, collection management, and index operations through async/await patterns.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MongoDB MCP Serverfind users where email contains '@company.com'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MongoDB MCP μλ²
π Python
π FastAPI
π FastMCP
π MongoDB
π Anthropic
π Docker
π License
MongoDB λ°μ΄ν°λ² μ΄μ€μμ μνν μνΈμμ©μ νμ€νλ νλ‘ν μ½λ‘ μ 곡νλ κ°λ ₯ν Model Context Protocol(MCP) μλ² κ΅¬ν체μ λλ€.
μμ±μ
Rastalion
Related MCP server: MongoDB
κ°μ
μ΄ MCP μλ² κ΅¬ν체λ Model Context Protocolμ ν΅ν΄ MongoDB λ°μ΄ν°λ² μ΄μ€μ μνΈμμ©ν μ μλ κ°λ ₯ν μΈν°νμ΄μ€λ₯Ό μ 곡ν©λλ€. λ°μ΄ν°λ² μ΄μ€, 컬λ μ λ° λ¬Έμμ λν μμ μ async/await ν¨ν΄κ³Ό μ€λ₯ μ²λ¦¬λ₯Ό ν΅ν΄ μμ μ μΌλ‘ μ§μν©λλ€.
νΉμ§
MongoDB CRUD μμ μλ²½ μ§μ
MongoDBμμ μμ ν μ°κ²° μ²λ¦¬
μ΅μ μ μ±λ₯μ μν λΉλκΈ°(async/await) ν¨ν΄
ν¬κ΄μ μΈ μ€λ₯ μ²λ¦¬
μ¬μ΄ λ°°ν¬λ₯Ό μν Docker μ§μ
νμ ννΈλ₯Ό κ°μΆ 쿼리 μ€ν
μ€μκ° μ λ°μ΄νΈλ₯Ό μν SSE(Server-Sent Events) μ§μ
λΉ λ₯Έ μμ
CLI λκ΅¬λ‘ μ¬μ©
# μ μ₯μ 볡μ
git clone https://github.com/yourusername/mongo-mcp-server.git
cd mongo-mcp-server
# κ°λ° λͺ¨λλ‘ μ€μΉ
pip install -e .
# λ‘컬μμ CLI λͺ
λ ΉμΌλ‘ μ€ν
mongo-mcp-server
# SSE νΈλμ€ν¬νΈλ‘ μ€ν
mongo-mcp-server --transport=sse
# MongoDB URL μ§μ
mongo-mcp-server --mongodb-url="mongodb://username:password@hostname:port/dbname"
# λμλ§ λ³΄κΈ°
mongo-mcp-server --helpUVXλ₯Ό ν΅ν΄ μ€ν
# UVXκ° μ€μΉλ κ²½μ°
uvx mongo-mcp-server
# SSE νΈλμ€ν¬νΈ λͺ¨λ
uvx mongo-mcp-server --transport=ssePython μ§μ μ€ν
# μ μ₯μ 볡μ
git clone https://github.com/yourusername/mongo-mcp-server.git
cd mongo-mcp-server
# μμ‘΄μ± μ€μΉ
pip install -r requirements.txt
# νκ²½ λ³μ μ€μ
export MONGODB_URL="mongodb://username:password@hostname:port/dbname?authSource=admin"
# μλ² μ€ν
uvicorn app.main:app --host 0.0.0.0 --port 3000Docker μ¬μ©
# μ μ₯μ 볡μ
git clone https://github.com/yourusername/mongo-mcp-server.git
cd mongo-mcp-server
# Docker Composeλ‘ λΉλ λ° μ€ν
docker-compose up -d
# λ‘κ·Έ νμΈ
docker-compose logs -f mongo-mcpUVX μ¬μ©
UVXλ λ€μν νκ²½μμ μλΉμ€λ₯Ό μ½κ² κ΄λ¦¬ν μ μλ λꡬμ λλ€.
# λ±λ‘ μ€ν¬λ¦½νΈμ μ€ν κΆν λΆμ¬
chmod +x uvx-register.sh
# UVXμ μλΉμ€ λ±λ‘
./uvx-register.sh
# μλΉμ€ μμ
uvx start mongo-mcp
# μν νμΈ
uvx status mongo-mcp
# λ‘κ·Έ νμΈ
uvx logs mongo-mcpλ μμΈν λ΄μ©μ UVX κ°μ΄λλ₯Ό μ°Έμ‘°νμΈμ.
νκ²½ λ³μ
μλ² μ€ν μ μ λ€μ νκ²½ λ³μλ₯Ό μ€μ νμΈμ:
# νμ
MONGODB_URL="mongodb://username:password@hostname:port/dbname?authSource=admin"
# μ ν - κΈ°λ³Έκ° νμ
PORT=3000
MCP_TRANSPORT=http # 'http' λλ 'sse'API μλν¬μΈνΈ
μν νμΈ:
GET /healthMCP API:
GET /mcp- FastMCP μλν¬μΈνΈ (OpenAPI λ¬Έμ)SSE μ°κ²°:
GET /sse- Server-Sent Events μλν¬μΈνΈλ©μμ§ μ²λ¦¬:
POST /messages- λ©μμ§ μ²λ¦¬ μλν¬μΈνΈ
IDE ν΅ν©
VS Code μ€μ
VS Code settings.jsonμ λ€μμ μΆκ°νμΈμ:
{
"mcp": {
"inputs": [
{
"type": "promptString",
"id": "mongodbUri",
"description": "MongoDB μ°κ²° URI"
}
],
"servers": {
"mongodb": {
"command": "mongo-mcp-server",
"args": [
"--mongodb-url",
"$(mongodbUri)"
],
"env": {}
}
}
}
}Claude λλ λ€λ₯Έ AI μ΄μμ€ν΄νΈ
Claude λλ λ€λ₯Έ AI μ΄μμ€ν΄νΈλ₯Ό μν΄ MCP μλ²λ₯Ό λ€μκ³Ό κ°μ΄ ꡬμ±νμΈμ:
{
"mcp": {
"servers": {
"mongodb": {
"url": "http://localhost:3000/mcp"
}
}
}
}μ¬μ© κ°λ₯ν λꡬ
λꡬ μ΄λ¦ | μ€λͺ |
| λ°μ΄ν°λ² μ΄μ€μ λͺ¨λ μ¬μ© κ°λ₯ν 컬λ μ λͺ©λ‘ μ‘°ν |
| MongoDB 쿼리 ꡬ문μ μ¬μ©νμ¬ μ»¬λ μ μ λ¬Έμ μ‘°ν |
| 컬λ μ μ λ¨μΌ λ¬Έμ μ½μ |
| 컬λ μ μμ λ¨μΌ λ¬Έμ μ λ°μ΄νΈ |
| 컬λ μ μμ λ¨μΌ λ¬Έμ μμ |
| 컬λ μ μ λͺ¨λ μΈλ±μ€ λͺ©λ‘ μ‘°ν |
| 컬λ μ μ μλ‘μ΄ μΈλ±μ€ μμ± |
| 컬λ μ μμ κΈ°μ‘΄ μΈλ±μ€ μμ |
κ³ κΈ μ¬μ©λ²
μ¬μ©μ μ μ λꡬ μΆκ°
app/tools/documents/λλapp/tools/collection/μ μ λꡬ μμ±:
from ..base.tool import BaseTool
class MyNewTool(BaseTool):
@property
def name(self) -> str:
return "my_new_tool"
@property
def description(self) -> str:
return "μ λꡬμ λν μ€λͺ
"
@property
def input_schema(self) -> Dict[str, Any]:
return {
"type": "object",
"properties": {
# λꡬ μ
λ ₯ μ€ν€λ§ μ μ
}
}
async def execute(self, params: Dict[str, Any]) -> Dict[str, Any]:
# λꡬ μ€ν λ‘μ§ κ΅¬ν
passapp/tools/registry.pyμ λꡬ λ±λ‘:
from .documents.my_new_tool import MyNewTool
# ToolRegistry.__init__ λ©μλ λ΄μμ
self.register_tool(MyNewTool())CLI λꡬ μ€μΉ λ° λ°°ν¬
PyPIμ ν¨ν€μ§λ‘ λ±λ‘νμ¬ μ μμ μΌλ‘ μ¬μ©ν μ μμ΅λλ€:
# setup.py νμΈ ν λΉλ
python setup.py sdist bdist_wheel
# ν¨ν€μ§ μ
λ‘λ (PyPI κ³μ νμ)
twine upload dist/*
# μ μ μ€μΉ
pip install mongodb-mcp-bridge
# μ΄λμλ μ€ν κ°λ₯
mongodb-mcp-bridgeλ¬Έμ ν΄κ²°
μλ²κ° μμλμ§ μλ κ²½μ°:
mongo-mcp-server --helpλ‘ λμλ§ νμΈMongoDB μ°κ²° λ¬Έμ :
--mongodb-urlνλΌλ―Έν°κ° μ¬λ°λ₯Έμ§ νμΈλꡬ μ€ν μ€λ₯: λꡬ ꡬνκ³Ό μ λ ₯ λ§€κ°λ³μ νμΈ
Docker λ¬Έμ :
docker-compose logs mongo-mcpλ‘ λ‘κ·Έ νμΈ
Docker ꡬμ±
Docker μ€μ μλ λ€μμ΄ ν¬ν¨λ©λλ€:
Python 3.12 κΈ°λ³Έ μ΄λ―Έμ§
Asia/Seoul νμμ‘΄
MongoDB 4.4 μΈμ€ν΄μ€
λ°μ΄ν°λ² μ΄μ€ μ€ν 리μ§λ₯Ό μν μꡬ λ³Όλ₯¨
μμͺ½ μλΉμ€μ λν ν¬μ€ 체ν¬
μλνλ λ€νΈμν¬ κ΅¬μ±
λΌμ΄μ μ€
μ΄ νλ‘μ νΈλ MIT λΌμ΄μ μ€ νμ λ°°ν¬λ©λλ€ - μμΈν λ΄μ©μ LICENSE νμΌμ μ°Έμ‘°νμΈμ.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Appeared in Searches
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/TeiNam/mongo-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
