This project provides a MongoDB assistant using Google's ADK (AI Development Kit) with the MongoDB MCP (Model Context Protocol) server.
-
Install dependencies:
uv sync
-
Configure MongoDB Connection:
Create a
.env
file in the project root with your MongoDB connection string:GOOGLE_GENAI_USE_VERTEXAI=FALSE GOOGLE_API_KEY=
# Get this from your MongoDB Atlas cluster connection string # Go to: https://cloud.mongodb.com → Clusters → Connect → Connect your application MDB_MCP_CONNECTION_STRING=mongodb+srv://username:password@cluster.mongodb.net/database
Alternative: Using API Keys (if preferred):
# Get these from https://cloud.mongodb.com/v2#/account/apiKeys MDB_MCP_API_CLIENT_ID=your_api_client_id MDB_MCP_API_CLIENT_SECRET=your_api_client_secret
-
Run the agent:
adk web
The implementation was updated to use the connection string approach which is simpler and more reliable than API keys. The MongoDB MCP server supports two authentication methods:
- Connection String (recommended): Direct MongoDB connection string
- API Keys: MongoDB Atlas API keys with
MDB_MCP_API_CLIENT_ID
andMDB_MCP_API_CLIENT_SECRET
The connection string approach is preferred as it's more straightforward and doesn't require API key setup in Atlas.