mcpmongo
1
The MCP MongoDB Integration project combines MongoDB with the Model Context Protocol (MCP) to enable AI-driven database interactions. It features a server that exports MongoDB operations as MCP tools and a client-side chatbot using Gemini AI to perform database queries.
MCP MongoDB Integration
This project demonstrates the integration of MongoDB with the Model Context Protocol (MCP) to provide AI assistants with database interaction capabilities.
Features
- MongoDB Integration: Full CRUD operations as MCP tools
- MCP Server: Implements the Model Context Protocol
- Gemini AI Integration: Connects to Google's Gemini models
- Terminal Chatbot: Interactive chat interface for database operations
Prerequisites
- Node.js (v14 or higher)
- MongoDB instance
- Google Gemini API key
How it Works
- The MCP server connects to MongoDB and exposes operations as tools.
- The client connects to the MCP server.
- User queries are sent to Gemini AI which utilizes MongoDB tools as needed.
- Tool calls are executed and results returned to the user via Gemini AI.
Environment Variables
MONGODB_URI
: Connection string for MongoDBMONGODB_NAME
: Database nameGEMINI_API_KEY
: API key for Gemini AI
License
ISC License
Contributing
Contribute by opening issues or submitting pull requests.