> ## Documentation Index
> Fetch the complete documentation index at: https://knowledge.bitbybit.studio/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect MCP servers and HTTP requests

> Let your AI agent use tools from an MCP server or read data from your own API with an HTTP request, then test and enable them.

Connectors let your AI agent use data and actions that live outside bitbybit. Connect an **MCP server** to give the agent a set of ready-made tools, or add an **HTTP request** to read data from your own API, such as an order's shipping status. You manage both on the **Connectors** tab of your agent.

| Connector | Use it when |
| - | - |
| **MCP server** | You already run a remote MCP server that publishes its own tools. |
| **HTTP request** | You want the agent to call one specific API endpoint, using values it collects from the conversation. |

> [!NOTE]
>
> To connect a coding assistant to bitbybit instead, see [How to connect a coding agent to bitbybit](https://knowledge.bitbybit.studio/settings/how-to-connect-a-coding-agent.md).

## Prerequisites

* You have a saved AI agent in AI Studio.
* For an MCP server: the server's **https** URL and, if the server requires one, a bearer token or an API key.
* For an HTTP request: an **https** endpoint on a public host, and the key it requires, if any.

## Connect an MCP server

**1. Add the server**

* Open your agent in **AI Studio > AI agent studio**, then select **Connectors**.
* Under **MCP servers**, select **Add server**.
* Enter a **Server name** and the **MCP server URL**, for example `https://mcp.example.com/mcp`.
* If the server needs credentials, set **Authentication**. For a bearer token, enter the **Bearer token**. For an API key, enter the **Header name** (for example `x-api-key`) and the key.
* Save the connection.

**2. Wait for the connection check**

* bitbybit checks the server in the background. The server shows **Connecting to server**, then **Discovering tools**.
* You can keep working while it checks. The agent only uses servers that connected successfully.

**3. Choose the tools your agent can use**

* Open the server and turn tools on or off. Changes apply immediately.
* Turn on only the tools your agent needs. If every tool is off, the server shows **All tools are turned off**.
* If you see **No tools found**, check the URL and confirm the server publishes tools.

**4. Test with a real question**

* Ask your agent a question that needs one of the tools. [Test it in Playground](https://knowledge.bitbybit.studio/ai-studio/test-your-ai-agent-in-playground.md) before customers see the change.

### Edit, pause, or remove a server

* Select **Server settings** to change the name, URL, or credentials.
* Turn off **Server enabled** to stop the agent from using the server without deleting it.
* Select **Remove server** and confirm **Remove MCP server?** to delete it.

### Fix a failed connection

| What you see | What to do |
| - | - |
| **Authentication failed** | Select **Update credentials** and enter a valid bearer token or API key. |
| **Couldn’t connect to server** | Check the URL and authentication, confirm the server is online, and make sure it is reachable over https. |
| **Couldn’t discover tools** | The server responded, but the tools it returned are not valid. Check the URL path, which often ends in `/mcp`, and the server's tool list. |
| **Couldn’t refresh tools** | Your previously discovered tools and selections are saved. Check the URL or credentials, then retry. |

## Add an HTTP request

**1. Create the request**

* Open **Connectors** and find **HTTP requests**, then select **Add HTTP request**.
* Enter a **Request name**, for example `Check order status`.
* In **When should the agent use this?**, describe the situation, for example `Use when a customer asks where their order is or wants a shipping update.` The agent decides when to call the request from this text, so be specific.

**2. Set the method and URL**

* Choose the **Method**. Use **GET** to read data and **POST** to send data.
* Enter the **Request URL**, for example `https://api.example.com/orders/{{order_id}}`.
* Wrap each value the agent should fill in with double braces, such as `{{order_id}}`. You cannot use placeholders in the domain.

**3. Add authentication**

* Under **Authentication type**, choose **Bearer token**, **API key header**, or **No authentication**.
* For **API key header**, enter the **Header name**, for example `x-api-key`.
* Credentials are stored securely and are not shown again after you save.

**4. Define the agent inputs**

* Add one input for each placeholder. Enter the **Variable name**, such as `order_id`, and choose the **Type**: **Text**, **Number**, or **Boolean**.
* Turn on **Required** if the request cannot run without the value.
* In **How should the agent get this value?**, tell the agent what to ask, for example `Ask the customer for their order number.`
* You can add up to 20 inputs.

**5. Set the request body (POST only)**

* GET requests have no body, so this step does not apply to them.
* Choose a **Body format**: **None**, **JSON**, **Form URL-encoded**, **Multipart form data**, or **Raw text / XML**.
* For **JSON** and **Raw text / XML**, write the **Body template** and use `{{variable_name}}` where the agent's values go. For **Raw text / XML**, also set the **Content-Type**, for example `application/xml`.
* For **Form URL-encoded** and **Multipart form data**, add each **API field** with its value. You can add up to 30 fields.

> [!WARNING]
>
> Multipart requests support text fields only. **Binary file** bodies and **File** inputs are not supported yet.

**6. Test the request**

* Under **Test inputs**, enter sample values. They are used for this test only.
* Select **Test request**, then check **Last test** for the result.
* You must pass a test before you can enable the request. If you change the configuration afterwards, **Test result is out of date** appears and you need to test again.

**7. Enable the request**

* Turn on **Enable request** so your agent can use it.
* [Test it in Playground](https://knowledge.bitbybit.studio/ai-studio/test-your-ai-agent-in-playground.md) with a question that should trigger the request.

### Limits and behavior

* Requests must use **https** and go to public addresses. Internal and private addresses are blocked.
* bitbybit does not follow redirects. Use the final URL.
* A request times out after 15 seconds, and a response larger than 1 MB fails.
* The agent reads the first 8,000 characters of the response, so return only the fields it needs.
* You can create up to 20 HTTP requests.
* If a POST request times out, your system may still have processed it. Check on your side before you ask the customer to try again.

## Related

* [Configure AI agent skills](https://knowledge.bitbybit.studio/ai-studio/how-to-setup-skillset-in-ai-studio.md)
* [Test an AI agent safely in Playground](https://knowledge.bitbybit.studio/ai-studio/test-your-ai-agent-in-playground.md)
* [Write advanced prompts](https://knowledge.bitbybit.studio/ai-studio/best-practice-to-prompt-your-ai-agent.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.