> For the complete documentation index, see [llms.txt](https://codemash.gitbook.io/codemash/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codemash.gitbook.io/codemash/cloud/ai/mcp/providers/mongodb.md).

# MongoDB

Connect the MongoDB MCP server.

The MongoDB MCP server lets the chat query and manage MongoDB databases and collections. Transport: **Stdio**.

{% hint style="warning" %}
MongoDB is a **Stdio** server: Norbix starts it as a program on the Norbix server, with the **Command** (default `docker`) and **Arguments** you give. The Norbix server image has no `docker`, `npx` or `uvx` today (checked on a local Norbix stack), so the server cannot start and the chat gets none of its tools. You can save and test it — the test only checks the stored secret. Use an **HttpStream** server ([Brave Search](/codemash/cloud/ai/mcp/providers/brave-search.md), [GitHub](/codemash/cloud/ai/mcp/providers/github.md), [Stripe](/codemash/cloud/ai/mcp/providers/stripe.md)) for now. Through the SDK, CLI and API it is saved the same way: [Save Mcp Integration](/codemash/api-reference/ai/integrations/save-mcp-integration.md).
{% endhint %}

## Get your credentials

1. In [MongoDB Atlas](https://cloud.mongodb.com/) (or your own MongoDB), create a database user with only the rights the chat needs — read-only is safest.
2. Atlas: **Connect → Drivers** shows the connection string, for example `mongodb+srv://reader:<password>@cluster0.example.mongodb.net/shop`. Allow the Norbix server's address under **Network Access**.
3. The server program is the MongoDB MCP server image, for example `mcp/mongodb` (Docker MCP catalog) or `mongodb/mongodb-mcp-server`. Norbix gives the connection string to the program in the environment variable `MONGODB_URI`.

More in the server's own guide: [MongoDB MCP server](https://github.com/mongodb-js/mongodb-mcp-server).

## Connect it in Cloud

**Where:** Project → Integrations → MCP → **Add New Integration** → MongoDB → **Connect** · `/projects/<project>/ai/mcps/integrations/new/mongodb`

| Field             | Required | What it does                                                                         | Example                                                              |
| ----------------- | -------- | ------------------------------------------------------------------------------------ | -------------------------------------------------------------------- |
| Command           | no       | The program to start. Empty = `docker`.                                              | `docker`                                                             |
| Arguments         | no       | One argument per line. Empty = none.                                                 | `run` `-i` `--rm` `-e` `MONGODB_URI` `mcp/mongodb` (one per line)    |
| Connection String | yes      | Passed to the program as `MONGODB_URI`. Stored encrypted, asked again on every save. | `mongodb+srv://reader:placeholder@cluster0.example.mongodb.net/shop` |
| Integration Name  | yes      | How the integration is listed in Norbix.                                             | `Orders database`                                                    |

<figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-9cfbd51754ad6baa16b4dc322295c2174673ac61%2Fmongodb-form-1.png?alt=media" alt="New MongoDB Integration form filled with placeholder values"><figcaption><p>The filled form (secrets are made-up placeholders).</p></figcaption></figure>

Press **Save**. The title becomes *Editing MongoDB integration*, the badges say **ENABLED** and **NOT TESTED**, the id (`int_…`) appears, the secret field is empty again with the note that it will not be displayed, and the test panel appears.

<figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-9d61a5ff37137c1addf9a2edfb79dad22621adb6%2Fmongodb-saved-2.png?alt=media" alt="The MongoDB integration after save: badges ENABLED and NOT TESTED, the id, and the Test integration panel"><figcaption><p>After save.</p></figcaption></figure>

## Test and set as default

**Test integration** only checks that Norbix can read the stored secret; it does not start or call the server — see [Test an MCP integration](/codemash/cloud/ai/mcp/test.md). MCP integrations have no default: every enabled one is offered to the end-user chat — see [Default MCP integration](/codemash/cloud/ai/mcp/set-default.md). To keep it away from the chat: [Disable or delete](/codemash/cloud/ai/mcp/disable.md).

## Common errors

| Message                             | Cause                                                                                        | Fix                               |
| ----------------------------------- | -------------------------------------------------------------------------------------------- | --------------------------------- |
| No tools of this server in the chat | Norbix cannot start the **Command** on its server (no `docker`, `npx` or `uvx` there today). | Use an HttpStream server for now. |
| *Required* under the secret field   | The secret is asked again on every save.                                                     | Type it again.                    |
