getCollectionsLABSCO SUMMARY
Aggregation is what makes it worth wiring up.
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.
What it is
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.
What you get
getCollectionslists every collection in the connected databasegetCollectionreturns documents with aquery, aprojectionand alimitthat defaults to 10 and caps at 1000insertOneadds a single document to a collectiondeleteOneremoves the first document matching a queryaggregateruns an aggregation pipeline with options
Requirements
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.
Setup effort
Build from source — git clone https://github.com/manpreet2000/mcp-database-server.git
USE CASES
Finding your way around an unfamiliar database
List the collections, then pull a few documents to see the shape.
Answering a question that needs a pipeline
Describe the grouping you want and let the model build and run the aggregation.
Filtering down to the records that matter
Query with a filter and a projection instead of paging through everything.
Fixing one bad record
Insert a corrected document or remove the one that is wrong.
5 tools
Listed in project docs. Your client may show a different list.
getCollectioninsertOnedeleteOneaggregateBEFORE YOU INSTALL
What to know first
Tools you get
5 tools named in the project's documentation.
Requires
- Node.js v20.12.2 or later
- A MongoDB instance; its connection string goes in MONGODB_URI in the block's env
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
You clone and build this one yourself.
Server setup
git clone https://github.com/manpreet2000/mcp-database-server.git
cd mcp-database-server
npm install
npm run buildMCP Clients
Claude Desktop
{
"mcpServers": {
"database": {
"command": "<YOUR_PATH_TO_NODE>",
"args": [
"<YOUR_PATH_TO_MCP_DATABASE>/dist/index.js"
],
"env": {
"MONGODB_URI": "<YOUR_MONGODB_URI>"
}
}
}
}<YOUR_PATH_TO_NODE> is node (or the full path of your Node.js executable), and <YOUR_PATH_TO_MCP_DATABASE> is the full path of the mcp-database-server folder the clone created, and <YOUR_MONGODB_URI> is your MongoDB connection URL.