-
Install Meshagent
-
Sign Up & Authenticate
Follow this guide to sign up and runmeshagent auth login
if needed. -
Run the MCP Server in a Meshagent Room
- Starts a Meshagent Room called
test
and runs a test instance of the MCP server. - The Room (and MCP instance) will close if inactive.
MDB_MCP_CONNECTION_STRING
Your MongoDB connection string
Example:mongodb+srv://username:password@cluster.mongodb.net/myDatabase
MESHAGENT_PORT
Agent port inside the room (set to 8001 for MCP server)
- Starts a Meshagent Room called
-
Launch a Chatbot in the Room
- Brings in a chatbot that can interact with the MCP tools (and any future compatible toolkits).
- Multiple toolkits or chatbots can be added to the same Room.
- The console will output a browser link to your Room.
-
Test Interaction
- Open the provided Room link in your browser.
- Send a message to the
mcp-mongodb
agent and interact with your live MongoDB MCP Server tools!
🏗️ Project Level Deployment (Persistent Automatic Services)
Set up persistent Meshagent services—one for the MCP server, one for the chatbot—so that they join any new Room created in your Meshagent project. Perfect for production or team environments!-
Create a Persistent MCP Service
-
Create a Persistent Chatbot Service
- All Meshagent project Rooms will now automatically include your MCP MongoDB server and chatbot—no manual launching required.
🛠️ Tools Available
The MongoDB MCP server (via Meshagent) gives you a wide range of database tools:Tool | Short Description |
---|---|
aggregate | aggregate |
collection-indexes | collection-indexes |
collection-schema | collection-schema |
collection-storage-size | collection-storage-size |
count | count |
create-collection | create-collection |
create-index | create-index |
db-stats | db-stats |
delete-many | delete-many |
drop-collection | drop-collection |
drop-database | drop-database |
explain | explain |
find | find |
insert-many | insert-many |
list-collections | list-collections |
list-databases | list-databases |
mongodb-logs | mongodb-logs |
rename-collection | rename-collection |
switch-connection | switch-connection |
update-many | update-many |
Tool Details
aggregate
Run an aggregation against a MongoDB collectionParameters:
collection
(string), database
(string), pipeline
(array)Read-only.
collection-indexes
Describe the indexes for a collectionParameters:
collection
, database
Read-only.
collection-schema
Describe the schema for a collectionParameters:
collection
, database
Read-only.
collection-storage-size
Gets the size of the collectionParameters:
collection
, database
Read-only.
count
Gets the number of documents in a collection (with optional filter)Parameters:
collection
, database
, query
(object, optional)Read-only.
create-collection
Creates a new collection in a database (database auto-creates if missing)Parameters:
collection
, database
create-index
Create an index for a collectionParameters:
collection
, database
, keys
(object), name
(optional string)
db-stats
Returns statistics about a single databaseParameters:
database
Read-only.
delete-many
Removes all documents that match the filter from a MongoDB collectionParameters:
collection
, database
, filter
(object, optional)Destructive operation.
drop-collection
Removes a collection or view from the databaseParameters:
collection
, database
Destructive operation.
drop-database
Removes the specified databaseParameters:
database
Destructive operation.
explain
Returns statistics describing the execution of a query planParameters:
collection
, database
, method
(array)Read-only.
find
Run a find query (with optional filter, projection, etc.)Parameters:
collection
, database
, filter
(optional object), limit
(optional number), projection
(optional object), sort
(optional object)Read-only.
insert-many
Insert an array of documents into a MongoDB collectionParameters:
collection
, database
, documents
(array)
list-collections
List all collections for a given databaseParameters:
database
Read-only.
list-databases
List all databases for a MongoDB connectionRead-only.
mongodb-logs
Return the most recent MongoDB log eventsParameters:
limit
(optional integer), type
(optional string: global/startupWarnings)Read-only.
rename-collection
Renames a collection in a MongoDB databaseParameters:
collection
, database
, newName
(string), dropTarget
(optional boolean)
switch-connection
Switch to a different MongoDB connection (with optional connection string)Parameters:
connectionString
(optional string)Read-only.
update-many
Updates all documents that match the filter in a collectionParameters:
collection
, database
, update
(object), filter
(optional object), upsert
(optional boolean)