VOOZH about

URL: https://glama.ai/mcp/servers/TeiNam/mongo-mcp-server

⇱ MongoDB MCP Server by TeiNam | Glama


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 --help

UVXλ₯Ό 톡해 μ‹€ν–‰

# UVXκ°€ μ„€μΉ˜λœ 경우
uvx mongo-mcp-server

# SSE 트랜슀포트 λͺ¨λ“œ
uvx mongo-mcp-server --transport=sse

Python 직접 μ‹€ν–‰

# μ €μž₯μ†Œ 볡제
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 3000

Docker μ‚¬μš©

# μ €μž₯μ†Œ 볡제
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-mcp

UVX μ‚¬μš©

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 /health

  • MCP 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"
 }
 }
 }
}

μ‚¬μš© κ°€λŠ₯ν•œ 도ꡬ

도ꡬ 이름

μ„€λͺ…

listCollections

λ°μ΄ν„°λ² μ΄μŠ€μ˜ λͺ¨λ“  μ‚¬μš© κ°€λŠ₯ν•œ μ»¬λ ‰μ…˜ λͺ©λ‘ 쑰회

find

MongoDB 쿼리 ꡬ문을 μ‚¬μš©ν•˜μ—¬ μ»¬λ ‰μ…˜μ˜ λ¬Έμ„œ 쑰회

insertOne

μ»¬λ ‰μ…˜μ— 단일 λ¬Έμ„œ μ‚½μž…

updateOne

μ»¬λ ‰μ…˜μ—μ„œ 단일 λ¬Έμ„œ μ—…λ°μ΄νŠΈ

deleteOne

μ»¬λ ‰μ…˜μ—μ„œ 단일 λ¬Έμ„œ μ‚­μ œ

indexes

μ»¬λ ‰μ…˜μ˜ λͺ¨λ“  인덱슀 λͺ©λ‘ 쑰회

createIndex

μ»¬λ ‰μ…˜μ— μƒˆλ‘œμš΄ 인덱슀 생성

dropIndex

μ»¬λ ‰μ…˜μ—μ„œ κΈ°μ‘΄ 인덱슀 μ‚­μ œ

κ³ κΈ‰ μ‚¬μš©λ²•

μ‚¬μš©μž μ •μ˜ 도ꡬ μΆ”κ°€

  1. 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]:
 # 도ꡬ μ‹€ν–‰ 둜직 κ΅¬ν˜„
 pass
  1. app/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 νŒŒμΌμ„ μ°Έμ‘°ν•˜μ„Έμš”.

A
license - permissive license
-
quality - not tested
D
maintenance

Maintenance

–Maintainers
–Response time
–Release cycle
–Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

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