mcpmongo

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

  1. The MCP server connects to MongoDB and exposes operations as tools.
  2. The client connects to the MCP server.
  3. User queries are sent to Gemini AI which utilizes MongoDB tools as needed.
  4. Tool calls are executed and results returned to the user via Gemini AI.

Environment Variables

  • MONGODB_URI: Connection string for MongoDB
  • MONGODB_NAME: Database name
  • GEMINI_API_KEY: API key for Gemini AI

License

ISC License

Contributing

Contribute by opening issues or submitting pull requests.