Docbase

io.github.CloudCorpRecordsPublished by GitHub account CloudCorpRecordsv0.1.0Updated Nov 7, 2026

MongoDB tools: query, aggregate, index, and administer collections and databases.

VerifiedSTDIODesktop onlyDatabasesData & Analytics

Overview

AI-generated overview

Local MCP server that gives an assistant a full set of MongoDB tools: browse databases, query and aggregate, write documents, and administer collections and…

What you can do
  • Browse databases, collections, indexes, storage sizes and database statistics
  • Run find queries, counts, aggregation pipelines and explain plans
  • Insert, update and delete documents in bulk
  • Create, rename, drop collections and databases, and create or drop indexes
  • Export matching documents and read server log lines
When to use it
Useful when an assistant should inspect or modify a MongoDB instance directly — exploring schemas, running ad-hoc queries and aggregations, or performing administrative and data-changing operations from a chat session.
Requirements
Runs as a local stdio process via npx or the Docker image. Live calls need the mongosh client on the PATH and a reachable MongoDB instance; the stock container bundles no mongosh. The connection string is passed on the command line or through the MDB_MCP_CONNECTION_STRING environment variable, or supplied to the connect tool.
Before you install
Tools can write and destroy data: insert-many, update-many, delete-many, drop-collection, drop-database, rename-collection, drop-index and create-index act on the real database. The connection string, which may contain credentials, is passed as an argument or environment variable. Without mongosh or a reachable instance the server still starts and only fails at call time.

Installation

In SourceWeft

  1. Open Docbase in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

docbase

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.

Install

bash
npx @reneturcios/docbase call list-databases

Or run the container image:

bash
docker run -i ghcr.io/cloudcorprecords/docbase

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.

CLI

bash
# 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 --version

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.

How a call flows

  1. Arguments are validated (required database/collection names, object-shaped filters, non-empty document arrays, and so on). Invalid calls fail before anything reaches an executor.
  2. The call is mapped to its command document — for example update-many becomes { update: <collection>, updates: [{ q: filter, u: update, multi: true }] }.
  3. The executor runs the document. Three tools post-process the reply: 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.

MCP server

One bin serves both faces. The mcp subcommand starts a stdio MCP server:

bash
npx -y @reneturcios/docbase mcp mongodb://alice@localhost:27017/shop

MCP client configuration:

json
{  "mcpServers": {    "docbase": {      "command": "npx",      "args": ["-y", "@reneturcios/docbase", "mcp"],      "env": { "MDB_MCP_CONNECTION_STRING": "mongodb://alice@localhost:27017/shop" }    }  }}

Tools

ToolRequiredOptionalWhat it does
connect—connectionStringPing the instance (validates a supplied connection string)
list-databases——List all databases (listDatabases)
list-collectionsdatabase—List a database's collections
collection-schemadatabase, collection—Infer field types from a 25-document sample
collection-indexesdatabase, collection—List a collection's indexes
collection-storage-sizedatabase, collection—Collection storage statistics (collStats)
finddatabase, collectionfilter, projection, limit, sortRun a find query
aggregatedatabase, collection, pipeline—Run an aggregation pipeline
countdatabase, collectionqueryCount matching documents
insert-manydatabase, collection, documents—Insert documents (ordered)
update-manydatabase, collection, filter, update—Update all matching documents
delete-manydatabase, collection, filter—Delete all matching documents
create-collectiondatabase, collection—Create a collection
drop-collectiondatabase, collection—Drop a collection
drop-databasedatabase—Drop a database
rename-collectiondatabase, collection, newName—Rename a collection (same database)
create-indexdatabase, collection, keys—Create an index; the name is derived from the keys
drop-indexdatabase, collection, indexName—Drop an index by name
explaindatabase, collectionmethod, methodArgsExplain a query plan (queryPlanner verbosity)
exportdatabase, collectionexportTitle, filterReturn matching documents under an export title
db-statsdatabase—Database statistics (dbStats)
mongodb-logs—limit, typeRead server log lines (getLog, default global)

Development

bash
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

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.

License

MIT — see LICENSE.

Source: README.md at commit bf9c374

Tools

22

connect

Connect to a MongoDB instance

ParametersconnectionString

list-databases

List all databases in the connected MongoDB instance

Takes no parameters.

list-collections

List collections in a MongoDB database

Parametersdatabaserequired

collection-schema

Describe the schema for a collection

Parametersdatabaserequiredcollectionrequired

collection-indexes

List indexes for a collection

Parametersdatabaserequiredcollectionrequired

collection-storage-size

Get the storage size of a collection

Parametersdatabaserequiredcollectionrequired

find

Run a find query against a MongoDB collection

Parameterssortlimitfilterdatabaserequiredcollectionrequiredprojection

aggregate

Run an aggregation pipeline against a MongoDB collection

Parametersdatabaserequiredpipelinerequiredcollectionrequired

count

Count documents in a MongoDB collection

Parametersquerydatabaserequiredcollectionrequired

insert-many

Insert documents into a MongoDB collection

Parametersdatabaserequireddocumentsrequiredcollectionrequired

update-many

Update documents in a MongoDB collection

Parametersfilterrequiredupdaterequireddatabaserequiredcollectionrequired

delete-many

Delete documents from a MongoDB collection

Parametersfilterrequireddatabaserequiredcollectionrequired

create-collection

Create a new collection in a MongoDB database

Parametersdatabaserequiredcollectionrequired

drop-collection

Drop a collection from a MongoDB database

Parametersdatabaserequiredcollectionrequired

drop-database

Drop a MongoDB database

Parametersdatabaserequired

rename-collection

Rename a MongoDB collection

ParametersnewNamerequireddatabaserequiredcollectionrequired

create-index

Create an index on a MongoDB collection

Parameterskeysrequireddatabaserequiredcollectionrequired

drop-index

Drop an index from a MongoDB collection

ParametersdatabaserequiredindexNamerequiredcollectionrequired

explain

Get the execution plan for a MongoDB query

ParametersmethoddatabaserequiredcollectionrequiredmethodArgs

export

Export a MongoDB collection to a file

ParametersfilterdatabaserequiredcollectionrequiredexportTitle

db-stats

Get statistics for a MongoDB database

Parametersdatabaserequired

mongodb-logs

Retrieve MongoDB log entries

Parameterstypelimit

Version history

1
  1. v0.1.0LatestOct 31, 2026

Score

90% 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.

  • Reached in the last 30 days25 pts
  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts