connect
Connect to a MongoDB instance
connectionString
io.github.CloudCorpRecordsPublished by GitHub account CloudCorpRecordsv0.1.0Updated Nov 7, 2026
MongoDB tools: query, aggregate, index, and administer collections and databases.
Local MCP server that gives an assistant a full set of MongoDB tools: browse databases, query and aggregate, write documents, and administer collections and…
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Follow the launch instructions in the repository.
docbase gives an agent — or you, at a terminal — a complete set of MongoDB database tools: browse databases and collections, run find queries and aggregation pipelines, insert, update, and delete documents, manage indexes and collections, read database statistics and server logs, and ask the server to explain a query plan.
There is no bundled MongoDB driver. Every tool call is first mapped to
a plain MongoDB command document ({ find: ... }, { aggregate: ... },
{ createIndexes: ... }), and the default executor runs that document
through the mongosh command-line client with
db.runCommand(...). A machine that wants live answers therefore needs
mongosh on its PATH and a reachable MongoDB instance. Without
either, the server still starts and lists its tools; only the call
itself reports the problem, in plain language.
Or run the container image:
The container defaults to the MCP server (see below). Note the stock
image bundles no mongosh binary, so containerised live queries need
a mongosh provided on the host or mounted into the image.
Exit codes: 0 on success, 1 when the tool call, the connection, or
mongosh itself fails (the error says which), 2 for usage errors.
The connection string is a normal MongoDB URL (mongodb:// or
mongodb+srv://). For both mcp and call it can be left off the
command line and supplied through the MDB_MCP_CONNECTION_STRING
environment variable. The connect tool also accepts a
connectionString argument, which is validated and used for that
call's ping.
update-many becomes
{ update: <collection>, updates: [{ q: filter, u: update, multi: true }] }.collection-schema samples 25 documents ($sample) and infers a
field-to-types map from them; mongodb-logs runs getLog and
applies the requested limit to the returned lines; export runs
a find and returns the matching documents under the requested
export title.One bin serves both faces. The mcp subcommand starts a stdio MCP
server:
MCP client configuration:
All command construction, validation, schema inference, and log
limiting are covered by tests that drive the core through a fake
executor — no MongoDB server and no mongosh binary are needed to run
the suite.
MIT — see LICENSE.
Source: README.md at commit bf9c374
Connect to a MongoDB instance
connectionStringList all databases in the connected MongoDB instance
Takes no parameters.
List collections in a MongoDB database
databaserequiredDescribe the schema for a collection
databaserequiredcollectionrequiredList indexes for a collection
databaserequiredcollectionrequiredGet the storage size of a collection
databaserequiredcollectionrequiredRun a find query against a MongoDB collection
sortlimitfilterdatabaserequiredcollectionrequiredprojectionRun an aggregation pipeline against a MongoDB collection
databaserequiredpipelinerequiredcollectionrequiredCount documents in a MongoDB collection
querydatabaserequiredcollectionrequiredInsert documents into a MongoDB collection
databaserequireddocumentsrequiredcollectionrequiredUpdate documents in a MongoDB collection
filterrequiredupdaterequireddatabaserequiredcollectionrequiredDelete documents from a MongoDB collection
filterrequireddatabaserequiredcollectionrequiredCreate a new collection in a MongoDB database
databaserequiredcollectionrequiredDrop a collection from a MongoDB database
databaserequiredcollectionrequiredDrop a MongoDB database
databaserequiredRename a MongoDB collection
newNamerequireddatabaserequiredcollectionrequiredCreate an index on a MongoDB collection
keysrequireddatabaserequiredcollectionrequiredDrop an index from a MongoDB collection
databaserequiredindexNamerequiredcollectionrequiredGet the execution plan for a MongoDB query
methoddatabaserequiredcollectionrequiredmethodArgsExport a MongoDB collection to a file
filterdatabaserequiredcollectionrequiredexportTitleGet statistics for a MongoDB database
databaserequiredRetrieve MongoDB log entries
typelimit90% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
npx @reneturcios/docbase call list-databasesdocker run -i ghcr.io/cloudcorprecords/docbase# Run one tool; the JSON-args argument is optional for no-arg toolsdocbase call list-databasesdocbase call find '{"database":"shop","collection":"users","filter":{"active":true},"limit":5}'docbase call db-stats '{"database":"shop"}'
# Start the MCP server (connection string optional, see below)docbase mcp mongodb://alice@localhost:27017/shop
docbase --versionnpx -y @reneturcios/docbase mcp mongodb://alice@localhost:27017/shop{ "mcpServers": { "docbase": { "command": "npx", "args": ["-y", "@reneturcios/docbase", "mcp"], "env": { "MDB_MCP_CONNECTION_STRING": "mongodb://alice@localhost:27017/shop" } } }}npm installnpm run build # tsc -> dist/npm test # node test runner over test/*.test.ts, no network, no live databasenpm run dev # run the CLI from source via tsx