MongoDB リモートMCPを Cursor にMCP接続する方法(設定手順)
MongoDB のリモートMCPサーバーを Cursor に約1分でMCP接続。OAuth / 401 の問題は先に OAuth 2.1 デバッガーで確認できます。
Streamable HTTPhttps://mcp.mongodb.com/mcp
Install in Cursor →
Or add to ~/.cursor/mcp.json:
{
"mcpServers": {
"mongodb": {
"url": "https://mcp.mongodb.com/mcp"
}
}
}claude mcp add --transport http mongodb https://mcp.mongodb.com/mcp
Install in VS Code →
Or add to .vscode/mcp.json:
{
"servers": {
"mongodb": {
"type": "http",
"url": "https://mcp.mongodb.com/mcp"
}
}
}- Open Settings → Connectors (Integrations) → Add Custom Connector.
- Paste the endpoint URL:
https://mcp.mongodb.com/mcp - Complete the browser OAuth 2.1 login flow when prompted.
Bridge the remote endpoint into stdio with mcp-remote in claude_desktop_config.json:
{
"mcpServers": {
"mongodb": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://mcp.mongodb.com/mcp"
]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"mongodb": {
"serverUrl": "https://mcp.mongodb.com/mcp"
}
}
}Add to ~/.kiro/settings/mcp.json (or .kiro/settings/mcp.json in your workspace), then reopen Kiro's Agent panel to pick up the server:
{
"mcpServers": {
"mongodb": {
"url": "https://mcp.mongodb.com/mcp"
}
}
}Add to ~/.codex/config.toml — Codex reads remote HTTP servers from [mcp_servers.*] tables:
[mcp_servers.mongodb] url = "https://mcp.mongodb.com/mcp"
Add to cline_mcp_settings.json (Cline → MCP Servers → Configure), or paste it via Cline's MCP marketplace file:
{
"mcpServers": {
"mongodb": {
"type": "streamableHttp",
"url": "https://mcp.mongodb.com/mcp"
}
}
}Add to ~/.gemini/settings.json under mcpServers — httpUrl for Streamable HTTP, url for legacy SSE:
{
"mcpServers": {
"mongodb": {
"httpUrl": "https://mcp.mongodb.com/mcp"
}
}
}接続手順
- MCP 設定を開く — Cursor → Settings → MCP。またはグローバル
~/.cursor/mcp.json/ プロジェクト.cursor/mcp.jsonを直接編集。 - サーバーを追加 — ワンクリック deeplink を使うか、
mcpServersに"mongodb": { "url":https://mcp.mongodb.com/mcp}を追加します。 - 認証を完了 — 初回呼び出し時に MongoDB の OAuth 認可画面が開きます。許可するとツールが有効になります。
- 検証 — オンライン Inspector に
https://mcp.mongodb.com/mcpを貼り付け、initialize と tools/list を実行して接続を確認します。
🧰 ツール一覧(36)
| Tool | Safety | Description | Parameters |
|---|---|---|---|
| list-connections ~32 tok | 🟢 Read | List configured MongoDB connections. | — |
| connect ~33 tok | 🟢 Read | Connect to a MongoDB instance or Atlas cluster. | — |
| list-databases ~31 tok | 🟢 Read | List databases of a connection. | — |
| list-collections ~31 tok | 🟢 Read | List collections of a database. | — |
| collection-indexes ~31 tok | 🟢 Read | List indexes of a collection. | — |
| collection-schema ~32 tok | 🟢 Read | Infer the schema of a collection. | — |
| collection-storage-size ~33 tok | 🟢 Read | Get storage size of a collection. | — |
| db-stats ~27 tok | 🟢 Read | Get database statistics. | — |
| count ~29 tok | 🟢 Read | Count documents matching a filter. | — |
| find ~29 tok | 🟢 Read | Run a find query on a collection. | — |
| aggregate ~29 tok | 🟢 Read | Run an aggregation pipeline. | — |
| explain ~31 tok | 🟢 Read | Explain a find or aggregate query plan. | — |
| insert-one ~28 tok | 🟠 Write | Insert a single document. | — |
| insert-many ~29 tok | 🟠 Write | Insert multiple documents. | — |
| update-one ~28 tok | 🟠 Write | Update a single document. | — |
| update-many ~29 tok | 🟠 Write | Update multiple documents. | — |
| rename-collection ~29 tok | 🟠 Write | Rename a collection. | — |
| delete-one ~28 tok | 🔴 Destructive | Delete a single document. | — |
| delete-many ~29 tok | 🔴 Destructive | Delete multiple documents. | — |
| drop-collection ~28 tok | 🔴 Destructive | Drop a collection. | — |
| drop-database ~27 tok | 🔴 Destructive | Drop a database. | — |
| create-index ~30 tok | 🟠 Write | Create an index on a collection. | — |
| export ~29 tok | 🟢 Read | Export query results to a file. | — |
| mongodb-logs ~30 tok | 🟢 Read | Retrieve MongoDB server logs. | — |
| atlas-list-orgs ~31 tok | 🟢 Read | List MongoDB Atlas organizations. | — |
| atlas-list-projects ~29 tok | 🟢 Read | List Atlas projects. | — |
| atlas-list-clusters ~29 tok | 🟢 Read | List Atlas clusters. | — |
| atlas-inspect-cluster ~31 tok | 🟢 Read | Inspect an Atlas cluster. | — |
| atlas-create-cluster ~30 tok | 🟠 Write | Create an Atlas cluster. | — |
| atlas-create-free-cluster ~34 tok | 🟠 Write | Create a free-tier Atlas cluster. | — |
| atlas-list-db-users ~31 tok | 🟢 Read | List Atlas database users. | — |
| atlas-create-db-user ~32 tok | 🟠 Write | Create an Atlas database user. | — |
| atlas-list-access-list ~33 tok | 🟢 Read | List Atlas IP access list entries. | — |
| atlas-create-access-list ~33 tok | 🟠 Write | Add an Atlas access list entry. | — |
| atlas-inspect-access-list ~33 tok | 🟢 Read | Inspect the Atlas access list. | — |
| atlas-connect-cluster ~34 tok | 🟢 Read | Get connection details for a cluster. | — |