MCP (Model Context Protocol) is an open-source standard for connecting AI applications to external systems. Follow these steps to connect your agent in AI21 Studio to an MCP server.
4.1 Add a URL
Enter the MCP server address in the URL field.
Handling “Invalid URL” Errors
If you see the “Invalid URL” error when adding your MCP server in AI21 Studio, it usually means:
The server is using http:// instead of https://
The server is running on a raw IP address and isn’t exposed as a public HTTPS endpoint
How to fix it: Set up an ngrok tunnel (or a similar tool) to expose your local server over HTTPS, which passes validation.
For full setup instructions, see the MCP Server Setup guide.
4.2 Add a Label
Enter a descriptive Label to identify the MCP server.4.3 Add Authentication
From the Authentication dropdown, select the authentication method (for example, API key or access token) and provide the credentials.
Authorization headers are not saved with the agent. If you save the agent, the headers will not be stored. When you reload the agent, you’ll need to enter the authorization headers again.