# Build a no-code SMS agent with Microsoft Azure AI Foundry and Infobip

As an outcome of this guide, you will have a working AI agent inside Microsoft Azure AI Foundry that can send SMS messages on demand through the Infobip SMS MCP server.

## Scenario overview [#scenario-overview]

[MCP servers](https://modelcontextprotocol.io/) let AI agents call external services as tools. Microsoft Azure AI Foundry can connect to the [Infobip SMS MCP server](https://www.infobip.com/docs/mcp) directly from its Tools catalog to make it available to any agent you build in the platform.

In this guide, you will build an agent called `sms-communicator` that accepts natural-language requests, fetches live data, and sends the results in an SMS message.

Foundry supports two ways to authenticate the MCP server connection, API key and OAuth. This guide covers both, so you can choose the right one for your use case.

## Choose your authentication method [#choose-auth]

Foundry supports two authentication methods for MCP server connections. Read the comparison below and pick one before starting.

| | OAuth Identity Passthrough | API key |
|---|---|---|
| **How it works** | Each user signs in to their own Infobip account via a browser popup on first use. | A single Infobip API key is stored in Foundry and used for all requests. |
| **Setup effort** | N/A | Requires creating a scoped API key in the Infobip account. |
| **Best for** | Agents used by individual users who each have their own Infobip account. | Shared or automated agents where one service account sends on behalf of everyone. |
| **Credential management** | None. Microsoft manages the OAuth app. | You own the key lifecycle (rotation, expiry, revocation). |
| **Runtime prompt** | Sign-in popup on first use per session. | No prompt. Seamless for the end user. |

## Prerequisites [#prerequisites]

- [Infobip account](https://www.infobip.com/signup). Free trial accounts can only send messages to the phone number registered at signup.
- A Microsoft Azure account with access to [Azure AI Foundry](https://ai.azure.com/) and an existing Foundry project.
- A deployed LLM model in your Foundry project (for example, `gpt-4o-mini`).
- A destination phone number in international format (e.g., `447415774332`).
- **API key only:** an  [Infobip API key](https://portal.infobip.com/dev/api-keys) with the `sms-manage` scope. Find out more about [API keys and scopes](https://www.infobip.com/docs/essentials/api-essentials/api-authorization).

## Difficulty level [#difficulty-level]

Beginner. No programming knowledge required. You should be comfortable navigating web-based admin portals.

## Summary of the steps [#steps-summary]

- Create an agent in Azure AI Foundry and configure its model and instructions.
- **API key only:** Generate a scoped Infobip API key in the Infobip account.
- Connect the Infobip SMS MCP server using your chosen authentication method.
- Add Bing Web Search to the agent for live data lookups.
- Test the agent by requesting an SMS.
- Verify the SMS is delivered to the destination phone number.

---

## Step 1. Create the agent [#step-1-create-agent]

1. Go to [ai.azure.com](https://ai.azure.com/) and open your Foundry project.
2. In the left navigation, select **Agents**.
3. Select **Create agent**.
4. Enter `sms-communicator` as the agent name and select **Create**.

Once the agent is created, the agent playground opens up.

## Step 2. Configure the agent [#step-2-configure-agent]

Do the following steps in the `sms-communicator` playground.

### Set up the model [#step-2-model]

Select a deployed model for your project. `gpt-4o-mini` is a good default for this use case.

### Write the system instructions [#step-2-instructions]

In the **Instructions** field, enter:

```
You are an expert communicator. You use Infobip's MCP server to send SMS text messages to user's phones. You are using InfoSMS sender for those SMS messages.
```

NOTE
The `InfoSMS` sender name used in this guide is a shared sender you can use for testing. For live traffic, check your Infobip account for available senders to purchase.

You will add tools in the steps below.

## Step 3. Connect the Infobip SMS MCP server [#step-3-connect-mcp]

The connection steps differ depending on the authentication method you chose. Follow the section that matches your choice.

OAuth Identity Passthrough

Step 3A. Connect with OAuth Identity Passthrough [#step-3a-oauth]

No Infobip account setup is required. Foundry handles the OAuth flow using a Microsoft-managed app.

You can access this step from the left menu

1. Click **Tools** in the left menu bar, and select **Connect a tool**.
2. Open the **Catalog** tab and search for `sms`.
3. Select **Infobip SMS MCP server** and click **Create**.

This opens up a connect the tool setup.

4. Leave the tool's **Name** field as `Infobip SMS MCP server`.
5. Under **Authentication**, confirm that **OAuth Identity Passthrough** is selected.
6. Under **OAuth Provider**, select **Managed** and click **Connect**.

Foundry will now create a project-scoped connection. The MCP server connection is shared across all agents in the project. You only need to connect it once.

API key

Step 3B. Generate an Infobip API key [#step-3b-generate-key]

Before connecting, create a dedicated API key in the Infobip account with the minimum required scope.

1. Open a new browser tab and go to [portal.infobip.com](https://portal.infobip.com/login).
2. Sign in with your Infobip credentials.
3. In the left navigation, go to **Developer Tools** > **API Keys**.
4. Select **CREATE API KEY**.

5. Fill in the key details:
   - **Name**: `foundry-sms-communicator-agent` (or any name you will recognize).
   - **Expiration date**: set an appropriate expiry for your use case.
6. Under **API Scopes**, search for `sms-manage` which grants access to all SMS API endpoints.
7. Select **CREATE**.

Copy your key now
API keys are only visible for 2 days. Copy the key value immediately and store it somewhere safe.

Connect to Foundry with key-based authentication [#step-3b-connect]

1. Return to the Azure AI Foundry tab and navigate back to your agent's playground.
2. Under **Tools**, expand the **Add** menu button and choose **Browse all tools**.
3. Open the **Catalog** tab, search for `sms`.
4. Select **Infobip SMS MCP server** and click **Connect**.

This opens up a connect the tool setup.

1. Leave **Name** as `Infobip SMS MCP Server`.
2. Under **Authentication**, select **Key-based**.
3. Under **Authorization**, enter your API key in this exact format:

    ```bash
    App <your_api_key>
    ```

4. Select **Connect**.

Foundry will store the API key as a project-level credential and will connect to the Infobip SMS MCP server.

## Step 4. Add Bing Web Search [#step-4-bing-search]

Adding Bing Web Search lets the agent fetch live data, such as weather forecasts, before composing an SMS.

1. In the **Tools** section of your agent's playground, expand the **Add** menu button and enable **Web search**.
2. Select **Search the web with Bing Search** and select **Add**. The agent now has two tools: **Infobip SMS MCP server** and **Bing Web Search**.
3. **Save** your progress.

## Step 5. Test the agent [#step-5-test]

1. From within your agent's playground, select **Preview** to open the agent chat interface.
2. Type a prompt that includes a destination phone number, for example:

    ```bash
    What's the weather going to be like in Redmond tomorrow? Send it to my phone on number 13859993791711
    ```

3. The agent will search the web for weather data, then display the SMS API call for review.
    For OAuth only, the first call in each session triggers an Infobip sign-in popup. Enter your Infobip credentials and select **SIGN IN**.

4. Review the payload and select **Approve**.

Tool call approval in production
In the agent playground, each tool call requires manual approval. When deploying the agent via the Foundry API or embedding it in an application, you can configure automatic approval for trusted tools.

## Track message delivery [#track-message-delivery]

After approval, the SMS is sent immediately. Check the destination phone. The message should arrive within seconds.

To monitor delivery programmatically, use the Infobip Delivery Reports API. See [SMS API reference](https://www.infobip.com/docs/api/channels/sms) for details on querying delivery status by `messageId` or `bulkId`.

You can also view sent messages and delivery status in the [Infobip account](analyze/logs).