Docs Menu
Docs Home
/ /

MongoDB MCP Server のトラブルシューティング

このページの情報を使用して、 MongoDB MCP Server の問題のトラブルシューティングに役立ちます。

MCP Server に問題がある場合は、問題のトラブルシューティングに役立つ情報については、 MCP Server ログ を確認してください。

デフォルトでは 、MCP サーバーはログをディスクに書込み、 MCPクライアントにもログを送信します。loggers オプションを変更して、ログが送信される場所を指定できます。MCP サーバー オプションの詳細については、MongoDB MCP サーバー構成オプション を参照してください。

次の表は、MCP サーバーがログファイルを保存するデフォルトのディレクトリを示しています。

オペレーティング システム
デフォルトのログディレクトリ

Windows

%LOCALAPPDATA%\mongodb\mongodb-mcp\.app-logs

macOS と Linux

~/.mongodb/mongodb-mcp/.app-logs

ログパスを変更するには、次のいずれかを設定します。

  • logPath MCP サーバーを起動するときにJSON構成ファイルまたはコマンドラインで オプションを

  • MDB_MCP_LOG_PATH 環境変数

構成ファイルが正しいこと、およびMongoDBデプロイに有効な接続文字列を使用していること を確認します。

接続文字列の形式と例については、接続文字列を参照してください。

HTTPトランスポートを使用しており、接続の問題が発生している場合

  • クライアント接続URL に/mcp エンドポイント パスが含まれていることを確認します。

    http://<server-address>:3000/mcp
  • リモートサーバー(別のコンピューター、コンテナ、またはクラウドインスタンス)に接続する場合は、リモート接続を受け入れるためにサーバーが--httpHost=0.0.0.0 で起動されていることを確認してください。

    npx -y mongodb-mcp-server@latest --transport http --httpHost=0.0.0.0 --readOnly
  • 指定されたポートがオープンで、クライアントコンピューターからアクセス可能であることを確認します。

MongoDB MCP Server は、Atlas インフラストラクチャを管理するための Atlas ツール、Atlas CLI が提供するのと同様にローカル配置を管理するための Local Atlas ツール、データ操作用の Database ツールという 3 つの主要なカテゴリのツールを提供します。次の表は、各ツールの構成を比較します。

構成要素
Atlas ツール
ローカル Atlas ツール
Database Tools

認証要件

Required: Atlas API credentials
apiClientId (Service Account ID)
apiClientSecret (Service Account Secret)
Required: Docker runtime
• No additional credentials needed
• Automatically manages local deployments
Optional: Multiple connection methods
• Pre-configured connection string
• Atlas credentials for atlas-connect-cluster
• Runtime connection via connect tool
• Local deployment via atlas-local-connect-deployment

接続方法

API-based connection to Atlas Management API
• No direct database connection needed
• Uses Atlas REST API endpoints
Local deployment management
• Uses Docker containers
• No external network access required
Direct connection to MongoDB database. Multiple options available:
• Configured connection string
• Runtime connection prompt
• Atlas cluster discovery
• Local deployment connection

権限要件

Service Account Roles (Atlas project-level):
Project Read Only (minimum for read operations)
Project Owner (for cluster creation/management)
Organization Owner (for project creation)
System Requirements:
• Docker runtime permissions
• Local file system access
• Container management capabilities
Database User Roles (when applicable):
readAnyDatabase (read-only mode)
readWriteAnyDatabase (full operations)
• Custom roles for specific databases/collections

設定オプション

Environment Variables:
MDB_MCP_API_CLIENT_ID or
MDB_MCP_API_CLIENT_SECRET

Command Line:
--apiClientId
--apiClientSecret
Environment Variables:
DOCKER_HOST (optional)

Command Line:
• No specific MCP configuration required
• Automatically detects Docker runtime
Environment Variables (optional):
MDB_MCP_CONNECTION_STRING

Command Line (optional):
• Connection string as positional argument:
--connectionString

Runtime Methods:
• Interactive connection via LLM prompts
• Atlas credential-based discovery

読み取り専用モードの影響

• Read operations: ✅ Available
• Cluster inspection: ✅ Available
• Cluster creation: ❌ Disabled
• User management: ❌ Disabled
• Local deployment creation: ✅ Available
• Deployment inspection: ✅ Available
• Container management: ✅ Available
• No read-only restrictions
• Read operations: ✅ Available
• Query operations: ✅ Available
• Aggregations: ✅ Available as long as they don't have a $out or $merge stage.
• Insert/Update/Delete: ❌ Disabled
• Index creation: ❌ Disabled

ツールカテゴリ

Can be disabled with:
--disabledTools atlas or
MDB_MCP_DISABLED_TOOLS="atlas"
Can be disabled with:
--disabledTools atlas or
MDB_MCP_DISABLED_TOOLS="atlas"
Can be disabled with:
--disabledTools mongodb or
MDB_MCP_DISABLED_TOOLS="mongodb"

ネットワーク要件

Outbound HTTPS to Atlas API:
• Standard internet connection
Local Docker Network:
• Docker daemon access
• Local port availability
• No external network requirements
Connection to MongoDB cluster (when applicable):
• Atlas: mongodb+srv:// (port 27017)
• Sharded clusters (port 27016)
• Self-managed: Custom host/port
• Local deployments: Docker network
• VPC/network access as required

利用可能な操作

• Organization management
• Project management
• Cluster lifecycle (create, inspect, delete)
• Database user management
• Access list configuration
• Performance Advisor recommendations
• Alert management
• Local deployment creation and management
• Container lifecycle operations
• Local cluster configuration
• Development environment setup
• Testing deployment management
• CRUD operations (find, insert, update, delete)
• Aggregation pipelines
• Index management
• Collection and database administration
• Schema inspection
• Vector search operations
• Data export

エラーシナリオ

Missing API Credentials:
Atlas tools return: "Atlas API credentials not configured"

Insufficient Permissions:
HTTP 403 errors from Atlas API
Docker Unavailable:
"Docker daemon not running" or "Docker not installed"

Container Issues:
Port conflicts, resource constraints
Connection Failures (when configured):
Network timeouts, authentication failures

Missing Database Permissions:
MongoDB authorization errors

一時的な認証情報

Not applicable:
Uses persistent service account credentials
Not applicable:
Local deployments use container-managed authentication
Auto-generated database users (when applicable):
When using Atlas API credentials without connection string:
• Random username/password
• 4-hour expiration by default
• Automatic role assignment

Database ツールは、さまざまなユースケースとセキュリティ要件に対応するために 複数の接続 方法をサポートしています。

  • 事前構成された接続文字列: connectionStringCLI、環境変数、または永続的なデータベースアクセス用の構成ファイルを使用して を構成します。

  • Atlas クラスター接続:atlas-connect-cluster Atlas API認証情報とともに ツールを使用して、Atlas クラスターを自動的に検出して接続します。

  • ランタイム接続:connect ツールを使用して、LVM の対話中に接続文字列を対話的に提供します。事前構成は必要ありません。

  • ローカル配置接続:atlas-local-connect-deployment Dockerと を使用してローカル Atlas 配置を作成し、接続します。Dockerは必要ですが、構成は必要ありません。

セキュリティ推奨事項:

  • 本番環境データベース: 環境変数または Atlas API認証情報を介して事前構成された接続文字列を使用し、安全な自動接続を実現します。

  • 開発/テスト: ランタイム接続またはローカル配置により、永続的な構成なしで柔軟性が向上します。

  • チャットのセキュリティ: チャット履歴が保存されたり、サードパーティと共有されたりしないと保証されない限り、ランタイム接続メソッドは使用されません。

戻る

メモリ オーバーフロー

項目一覧