Skip to content

Commit 6ea0b8c

Browse files
committed
Restructure MongoDB Atlas Foundry agents article as how-to; update TOC and index
1 parent 2a0b908 commit 6ea0b8c

3 files changed

Lines changed: 68 additions & 60 deletions

File tree

Lines changed: 64 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,65 @@
11
---
22
title: Connect Microsoft Foundry Agents to MongoDB Atlas
3-
description: Learn how to connect Microsoft Foundry Agents to MongoDB Atlas
3+
description: Learn how to connect Microsoft Foundry Agents to MongoDB Atlas using the MongoDB MCP Server for data retrieval and vector search.
44
ms.topic: how-to
5-
ms.date: 03/20/20256
5+
ms.date: 03/20/2026
66
---
77

8-
# Connect Microsoft Foundry Agents to MongoDB Atlas
8+
# Connect Microsoft Foundry agents to MongoDB Atlas
99

10-
This article shows how to connect Microsoft Foundry agents that can query and retrieve data from MongoDB Atlas using the MongoDB MCP Server.
10+
This article shows you how to connect Microsoft Foundry agents that can query and retrieve data from MongoDB Atlas using the MongoDB MCP Server.
1111

12-
## Pre-requistes
12+
## Architecture overview
13+
14+
At a high level, the integration includes these components:
15+
16+
- **Microsoft Foundry Agent** – Orchestrates reasoning and tool usage.
17+
- **MongoDB MCP Server** – Exposes MongoDB Atlas operations (vector search, aggregation) as agent tools.
18+
- **MongoDB Atlas** – Stores operational and vectorized data.
19+
- **Azure hosting** – Hosts the MCP Server in Azure Container Apps.
20+
21+
The Foundry agent calls the MCP Server over HTTPS at query time, and the MCP Server executes operations against your Atlas cluster. Your data remains in MongoDB Atlas.
22+
23+
## Prerequisites
1324

1425
Before you begin, ensure you have:
1526

16-
- An Azure subscription with access to Microsoft Foundry Project
17-
- A MongoDB Atlas account with a project and cluster
18-
- A vector index created in MongoDB Atlas (for RAG scenarios)
19-
- Permission to deploy services to Azure (for MCP Server hosting)
27+
- An Azure subscription with access to a Microsoft Foundry project.
28+
- A MongoDB Atlas account with a project and cluster.
29+
- A vector search index created in MongoDB Atlas (for RAG scenarios).
30+
- Permission to deploy services to Azure (for MCP Server hosting).
31+
32+
## Prepare MongoDB Atlas
33+
34+
1. Create or select a MongoDB Atlas cluster.
35+
1. Load your dataset (for example, sample Airbnb or domain-specific data).
36+
1. Create a vector search index on the target collection.
37+
38+
## Deploy the MongoDB MCP Server
39+
40+
The [MongoDB MCP Server](https://github.com/mongodb-js/mongodb-mcp-server) acts as a bridge between Foundry agents and MongoDB Atlas.
41+
42+
1. Deploy the MCP Server to Azure Container Apps or another Azure-hosted environment. For details on hosting, see the [MongoDB MCP Server Azure deployment guide](https://github.com/mongodb-js/mongodb-mcp-server/blob/main/deploy/azure/README.md).
43+
1. Configure the server with:
44+
- MongoDB Atlas connection details
45+
- Enabled tools (vector search, aggregation)
46+
1. Expose a remote HTTPS endpoint.
47+
48+
## Create an agent in Microsoft Foundry
49+
50+
1. Open the Microsoft Foundry portal.
51+
1. Create a new agent, provide system instructions, and choose a deployed Foundry model.
52+
1. Go to **Tools** > **MongoDB MCP Server** > **Connect**.
53+
1. Paste the MCP Server remote URL.
54+
1. Save the agent configuration.
55+
56+
After you add the MCP Server, the agent can invoke MongoDB operations through the MCP tool during reasoning.
2057

21-
## Pre-requisites for RAG
58+
## Deploy the embedding endpoint
2259

23-
In retrieval-augmented generation (RAG) scenarios, Foundry agents often need to generate embeddings for user queries at runtime before invoking MongoDB Atlas Vector Search. This integration supports that pattern by exposing an embedding generation function as an OpenAPI (Swagger)–based tool that the agent can call during reasoning.
60+
In retrieval-augmented generation (RAG) scenarios, Foundry agents need to generate embeddings for user queries at runtime before invoking MongoDB Atlas Vector Search. You expose an embedding generation function as an OpenAPI-based tool that the agent calls during reasoning.
2461

25-
- Define the embedding function like below
62+
Define the embedding function with the following OpenAPI specification:
2663

2764
```yaml
2865
openapi: 3.0.1
@@ -57,65 +94,32 @@ paths:
5794
items:
5895
type: number
5996
```
60-
The implementation behind this API typically calls a Foundry-hosted embedding model (for example, text-embedding-3-large) and returns the vector as JSON.
6197
62-
## Connect Microsoft Foundry agents to MongoDB Atlas
98+
The implementation behind this API typically calls a Foundry-hosted embedding model (for example, `text-embedding-3-large`) and returns the vector as JSON.
6399

64-
### Step 1: Prepare MongoDB Atlas
100+
## Configure the agent for vector search
65101

66-
- Create or select a MongoDB Atlas cluster.
67-
- Load your dataset (for example, sample Airbnb or domain-specific data).
68-
- Create a vector search index on the target collection.
102+
By using the previous steps, you can perform database operations but you can't perform vector search because it requires embedding user queries. To configure the agent for vector search:
69103

70-
Microsoft Foundry connects to Atlas data in-place. The data remains in MongoDB Atlas, and Foundry agents retrieve it at query time.
104+
1. In the agent tools, add a new OpenAPI tool.
105+
1. Paste the OpenAPI specification from the [Deploy the embedding endpoint](#deploy-the-embedding-endpoint) step.
106+
1. In the agent instructions, guide the agent to invoke this function for vector search use cases.
107+
1. Save the agent.
71108

72-
### Step 2: Deploy the MongoDB MCP Server
109+
Once registered, the agent can invoke `generateEmbeddings` as part of its reasoning chain.
73110

74-
The [MongoDB MCP Server](https://github.com/mongodb-js/mongodb-mcp-server) acts as a bridge between Foundry agents and MongoDB Atlas.
75-
76-
- Deploy the MCP Server to Azure Container Apps or another Azure-hosted environment. For details on hosting, [visit] (https://github.com/mongodb-js/mongodb-mcp-server/blob/main/deploy/azure/README.md)
77-
- Configure it with:MongoDB Atlas connection details
78-
- Enabled tools (vector search, aggregation)
79-
- Expose a remote HTTPS endpoint
80-
81-
### Step 3: Create an Agent in Microsoft Foundry
82-
83-
- Open the Microsoft Foundry portal
84-
- Create a new agent and provide system instructions and choose a deployed Foundry model
85-
- Go to Tools > MongoDB MCP Server > Connect
86-
- Paste the MCP Server remote URL
87-
- Save the agent configuration
88-
89-
Once added, the agent can invoke MongoDB operations through the MCP tool during reasoning.
90-
91-
### Step 4: Configure Agent for vector search
92-
93-
With the previous steps, users can perform database operations but cannot perform vector search since it requires embedding the user queries.
94-
To configure the agent for vector search, follow these steps -
95-
96-
- In the Agent tools, add a new OpenAPI tool
97-
- Paste the Swagger definition generated in Pre-requistes
98-
- In the agent instructions, guide the agent to invoke this function in case of a vector search use-case.
99-
- Save the agent
100-
101-
Once registered, the agent can invoke generateEmbeddings as part of its reasoning chain.
102-
103-
### Step 5: Test retrieval and responses
111+
## Test retrieval and responses
104112

105113
Run prompts that require:
114+
106115
- Semantic search over MongoDB data
107116
- Aggregation queries
108117
- Context-aware responses grounded in Atlas data
109118

110-
Successful responses confirm end-to-end connectivity between Foundry, MCP Server, and MongoDB Atlas.
111-
112-
## Architecture overview
113-
114-
At a high level, the integration includes:
119+
Successful responses confirm end-to-end connectivity between Foundry, the MCP Server, and MongoDB Atlas.
115120

116-
- Microsoft Foundry Agent – Orchestrates reasoning and tool usage
117-
- MongoDB MCP Server – Exposes MongoDB Atlas operations (vector search, aggregation) as an agent tool
118-
- MongoDB Atlas – Stores operational and vectorized data
119-
- Azure hosting – Hosts the MCP server in Azure Container App
121+
## Next steps
120122

121-
For broader Foundry concepts, see the official Foundry documentation.
123+
- [MongoDB MCP Server](https://github.com/mongodb-js/mongodb-mcp-server)
124+
- [What is MongoDB Atlas?](overview.md)
125+
- [Manage MongoDB Atlas](manage.md)

articles/partner-solutions/mongo-db/index.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ landingContent:
3030
url: create.md
3131
- linkListType: how-to-guide
3232
links:
33+
- text: Connect Foundry agents to MongoDB Atlas
34+
url: connect-foundry-agents.md
3335
- text: Manage a resource
3436
url: manage.md
3537
- text: Troubleshoot

articles/partner-solutions/mongo-db/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ items:
1818
- name: How to
1919
expanded: true
2020
items:
21+
- name: Connect Foundry agents to MongoDB Atlas
22+
href: connect-foundry-agents.md
2123
- name: Manage a resource
2224
href: manage.md
2325
- name: Troubleshoot a resource

0 commit comments

Comments
 (0)