# Integrate an Autorun MCP Agent

This tutorial will show you how to create an app analytics dashboard using [Autorun](https://platform.autorun.ai/auth/login) and how to create an MCP agent that will send out order updates using the Infobip SMS MCP server.

## Prerequisites

1. [Infobip account](https://portal.infobip.com/login/?callback=https%3A%2F%2Fportal.infobip.com%2F). If you do not have one, you can create a [free trial account](https://www.infobip.com/signup).
2. Infobip API key with the `sms:message:send` scope. Find out more about [API keys and scopes](https://www.infobip.com/docs/essentials/api-essentials/api-authorization).
3. [Autorun](https://platform.autorun.ai/auth/login) account.
4. SMS Sender. If in free trial, use the Infobip test sender, `ServiceSMS`.
   If you want to configure your custom sender, request a new number or an alphanumeric sender through the [Infobip account](https://portal.infobip.com/channels-and-numbers/channels/sms/overview) or using [Infobip Numbers API](https://www.infobip.com/docs/api/platform/numbers).
5. SMS Destination - a phone number to which the message will be sent. If in free trial, you can only send messages to a verified phone number.

## Create an app

Log in to your [Autorun](https://platform.autorun.ai/auth/login) account to create an app. You'd need to describe your use case to the AI Agent, Mileva that will then create an app based on your conversation.

```bash
I want to sell Infobip developer merchandise that we use in our booth at different developer conferences. I need to track orders and stock. It should be a simple app that will be able to send me information when the stock is low. Low stock equals less than 5 items.
```

```bash
Thank you! Now, let's discuss some features and pages for your app. Here's what I'm thinking:

Features:
Order Management: Track and manage orders placed for merchandise.
Inventory Management: Keep track of stock levels for each merchandise item.
Low Stock Notification: Automatically send notifications when stock levels fall below 5 items.

Pages:
Dashboard: Overview of orders and stock levels.
Orders Page: List and details of all orders.
Inventory Page: List and details of all merchandise items and their stock levels.

Processes:
When Stock Level Changes, Then Check for Low Stock: Automatically check if stock levels are below 5 and trigger a notification if true.
How does this sound? Would you like to add or modify anything?
```

Once you are happy with the outcome of your conversation, trigger the AI Build process. You'll end up with a dashboard and some sample data so that you can go ahead and test the solution straight away.

## Create an MCP Agent for SMS communication

Once you have your app, you can create an AI Agent for SMS messaging that will be connected to your app.

1. Navigate to [Agents](https://platform.autorun.ai/agents) to create a new agent.
2. Fill in the required details. Key points:
    - The **What does this agent help with?** field's content will show as an agent description in your app.
    - Under **Application** select your app from the list to link the agent to the correct app.
    - Use **Data Access (Entities)** to add as many data categories as needed. Since we want our Agent to send SMS messages, we need the agent to access all data related to orders and products, e.g. ProductStatus, Order, OrderStatus, etc. The categories from the list match data available in your app.

3. Navigate to the **MCP Servers** section to add an **Infobip SMS MCP Server**. Key points:
    - **Server name**: Infobip SMS
    - **Server type**: Remote Server (HTTP)
    - **Server endpoint**: https://mcp.infobip.com/sms
    - **Headers**: replace the `${INFOBIP_API_KEY}` variable with the API key from your Infobip account.

NOTE
For the full list of available endpoints, see: the [Infobip MCP servers](https://www.infobip.com/docs/mcp/using-mcp#available-endpoints) documentation.

Once you create an Agent, you'll see data entities and messaging capabilities you've mapped to your agent listed under **Tools**.

## Use the Agent to send SMS

Once you create an Agent, you can access it from your app's dashboard. Use the agent messaging interface to tell it to send an SMS message.

NOTE
If you have more than one sender, you'd need to specify which sender to use in your prompt.

```bash filename="Prompt example"
Send me the list of total orders with their current status. Use this sender: 447491163443 and this destination: 447415774332.
```

The Agents will access data and craft a message to send to the number provided.

## Useful links

- [Infobip MCP docs](https://www.infobip.com/mcp/)
- [SMS API reference](https://www.infobip.com/docs/api/channels/sms)
- [Response status and error codes](https://www.infobip.com/docs/essentials/api-essentials/response-status-and-error-codes)
- [Deliverability](https://www.infobip.com/docs/sms/deliverability)