Listing documents is convenient; running a pipeline is the part that saves real time, because getting a Mongo aggregation right is fiddly and iterating on it in chat with the data in front of you is genuinely faster than in a shell. The default limit of 10 with a 1000 ceiling is a sensible guard against pulling a collection into context. The write tools have no confirmation step, so scope the connection user accordingly.
A MongoDB client for assistants. It lists collections, runs find queries with filters and projections, inserts and deletes single documents, and executes aggregation pipelines — the everyday half of a Mongo shell session, reachable in plain language. Other databases are named as future work; MongoDB is what it does today.
- `getCollections` lists every collection in the connected database
- `getCollection` returns documents with a `query`, a `projection` and a `limit` that defaults to 10 and caps at 1000
- `insertOne` adds a single document to a collection
- `deleteOne` removes the first document matching a query
- `aggregate` runs an aggregation pipeline with options
Node.js v20.12.2 or higher and a MongoDB instance. Clone the repository, `npm install`, `npm run build`, then point your client at `dist/index.js` with `MONGODB_URI` in the environment block. The connection string carries your database credentials, so keep it out of version control. Write tools are always available — there is no read-only mode — so give the URI a user scoped to what you are willing to let an assistant change.
One command plus a key — npx -y mcp-database, then supply credentials
