How to integrate MongoDB MCP with Hermes

Connect Hermes to MongoDB MCP. List collections in your production database, query top slow queries from cluster, and more using natural language, with authentication handled for you.

MongoDB MCP logoMongoDB MCP
S2s Oauth2

MongoDB MCP is MongoDB's managed interface for accessing Atlas resources and data. Use it for secure, centralized access to clusters, databases, and collections.

41 Tools

Introduction

Hermes is a 24/7 autonomous agent that lives on your computer or server — it remembers what it learns and evolves as your usage grows.

This guide explains the easiest and most robust way to connect your MongoDB account to Hermes. You can do this through either Composio Connect CLI or Composio Connect MCP. For personal use we recommend the CLI, but you won't go wrong with MCP either.

For exact tool slugs and parameter tables, see the tool catalog in the Composio docs.

Also integrate MongoDB MCP with

What is Composio Connect?

Composio Connect is a consumer offering that lets anyone plug 2,000+ applications directly into their agent harness — including Hermes. It can:

  • Search and load tools from relevant toolkits on-demand, reducing context usage.
  • Chain multiple tools to accomplish complex workflows via a remote workbench, without excessive back-and-forth with the LLM.
  • Manage app authentication end-to-end with zero manual overhead.

Integrating MongoDB with Hermes

Using Composio Connect CLI

1. Install the Composio CLI

Run the install script directly, or paste https://composio.dev/hermes into your Hermes chat box to have it installed for you.

bash
curl -fsSL https://composio.dev/install | bash
Hermes authenticating with Composio

2. Authenticate

Once the CLI is installed, ask Hermes to authenticate with Composio.

3. Connect to MongoDB

Ask your agent to connect to MongoDB, or simply request any MongoDB-related task. Hermes will prompt you to authenticate and authorize access.

4. Done. You're all set with a new MongoDB connection.


Using Composio Connect MCP

1. Get your MCP URL and API Key

Go to dashboard.composio.dev and copy your Connect MCP URL and API key.

Copy MCP URL and API key from Composio dashboard

2. Open the Hermes config file

bash
nano ~/.hermes/config.yaml

3. Add the Composio Connect MCP server

bash
mcp_servers:
  composio:
    url: "https://connect.composio.dev/mcp"
    headers:
      x-consumer-api-key: "YOUR_COMPOSIO_API_KEY"
    connect_timeout: 60
    timeout: 180

Save with Ctrl + O, Enter, then exit with Ctrl + X.

4. Restart your Hermes agent

Once restarted, ask your agent to connect to MongoDB or request any MongoDB-related task. It will prompt you to authenticate and authorize access.

5. Done!

What is the MongoDB MCP server, and what's possible with it?

The MongoDB MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your MongoDB account. It provides structured and secure access to your MongoDB Atlas resources, databases, collections, documents, indexes, and performance data, so your agent can explore data, run queries, manage collections, optimize indexes, and administer Atlas resources on your behalf.

  • Database exploration and analysis: Have your agent list databases and collections, inspect schemas and storage use, count documents, and review database statistics.
  • Document queries and data changes: Direct your agent to find or aggregate documents, insert multiple records, or delete records that match a filter.
  • Collection and index management: Let the agent create, rename, or drop collections, inspect existing indexes, and create or remove indexes.
  • Query and performance optimization: Instruct your agent to explain query execution and retrieve Atlas performance recommendations for indexes, schemas, and recent operations.
  • Atlas resource administration: Have your agent create and inspect projects, clusters, database users, and network access lists, list alerts, load sample data, or pause, resume, and upgrade supported clusters.

Way Forward

With MongoDB connected, Hermes can now act on your behalf whenever it detects a relevant task or you ask it to.

From here, you can extend Hermes further:

  • Connect more apps: Calendar, Slack, Notion, Linear, and hundreds of others are available through the same Composio Connect setup. Each new integration compounds what Hermes can do for you.
  • Build workflows across tools: Once multiple apps are connected, Hermes can chain actions together — turn an email into a calendar invite, a Slack message into a Linear ticket, or a meeting note into a follow-up draft.
  • Let it learn your patterns: The more you use Hermes, the better it gets at anticipating how you'd handle recurring tasks. Give it feedback on drafts and decisions, and it will adapt.

If you run into trouble or want to share what you've built, join the community or check out the Docs for deeper configuration options.

TOOLS

Supported Tools

Every MongoDB MCP action and event your agent gets out of the box.

Aggregate

Run an aggregation against a MongoDB collection

Aggregate db

Run an aggregation against a MongoDB database

Atlas create access list

Allow Ip/CIDR ranges to access your MongoDB Atlas clusters.

Atlas create cluster

Create a MongoDB Atlas cluster (M10–M80, replica set or single shard, single or multi-region).

Atlas create db user

Create an MongoDB Atlas database user

Atlas create free cluster

Create a free MongoDB Atlas cluster

Atlas create project

Create a MongoDB Atlas project

Atlas get performance advisor

Get MongoDB Atlas performance advisor recommendations and suggestions, which includes the operations: suggested indexes, drop index suggestions, schema suggestions, and a sample of the most recent (max 50) slow query logs

Atlas inspect access list

Inspect Ip/CIDR ranges with access to your MongoDB Atlas clusters.

Atlas inspect cluster

Inspect metadata of a MongoDB Atlas cluster

Atlas list alerts

List triggered alerts for a MongoDB Atlas project.

Atlas list clusters

List MongoDB Atlas clusters

Atlas list db users

List MongoDB Atlas database users

Atlas list orgs

List MongoDB Atlas organizations

Atlas list projects

List MongoDB Atlas projects.

Atlas load sample dataset

Load a MongoDB sample dataset into an Atlas cluster, or check the status of a previously-initiated load.

Atlas pause resume cluster

Pause or resume a dedicated (M10+) MongoDB Atlas cluster (Free and Flex clusters cannot be paused).

Atlas streams build

Create Atlas Stream Processing resources.

Atlas streams discover

Discover and inspect Atlas Stream Processing resources.

Atlas streams manage

Manage Atlas Stream Processing resources: start/stop processors, modify pipelines, update configurations.

Atlas streams teardown

Delete Atlas Stream Processing resources.

Atlas upgrade cluster

Upgrade a MongoDB Atlas cluster tier.

Collection indexes

Describe the indexes for a collection

Collection schema

Describe the schema for a collection

Collection storage size

Gets the size of the collection

Count

Gets the number of documents in a MongoDB collection using db.collection.count() and query as an optional filter parameter

Create collection

Creates a new collection in a database.

Create index

Create an index for a collection

Db stats

Returns statistics that reflect the use state of a single database

Delete many

Removes all documents that match the filter from a MongoDB collection

Drop collection

Removes a collection or view from the database.

Drop database

Removes the specified database, deleting the associated data files

Drop index

Drop an index for the provided database and collection.

Explain

Returns statistics describing the execution of the winning plan chosen by the query optimizer for the evaluated method

Find

Run a find query against a MongoDB collection

Insert many

Insert an array of documents into a MongoDB collection.

List collections

List all collections for a given database

List databases

List all databases for a MongoDB connection

Remote atlas connect

Connect to MongoDB Atlas cluster

Rename collection

Renames a collection in a MongoDB database

Update many

Updates all documents that match the specified filter for a collection.

FAQ

Frequently asked questions

Start with MongoDB MCP.It takes 30 seconds.

Managed auth, hosted MCP servers, and every MongoDB MCP tool your agent needs.Free to start.

Start building