A Model Context Protocol (MCP) server written in TypeScript that inserts users into a MongoDB database and can search data dynamically (conditional query) from any database collection with type-safe validation using Zod. Fully compatible with MCP Inspector for testing.
- MCP server using SDK v1.25.1
- Strict input validation with Zod
- Inserts users into MongoDB
userscollection - Search data dynamically from any MongoDB collection
- STDIO transport ready for MCP Inspector
- TypeScript ready for Node.js 18+
- Easily extendable for update/delete tools or HTTP transport
- Node.js v18+
- MongoDB running locally (
mongodb://127.0.0.1:27017) - npm installed
Install dependencies, build, and run:
npm install # Install dependencies
npm run build # Compile TypeScript into dist/
npm start # Start the MCP server