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

# MCP tools

Connect agents to external tools and services using the Model Context Protocol.

MCP (Model Context Protocol) is an open standard that lets AI agents interact with external tools and services through a single, consistent interface. Instead of building a custom integration for each tool, agents connect to MCP servers and access all the tools they expose through one standardized protocol. [Learn More](https://modelcontextprotocol.io/docs/getting-started/intro).

**Without MCP:** Connecting to multiple external services requires a separate integration with custom logic for each one.

**With MCP:** The agent communicates with all services through a single interface, dramatically reducing development complexity.

## When to use

MCP is particularly suited for tools hosted on external servers, shared toolsets across teams, and cases where you want clear separation between tool logic and agent logic.

| Use case | Why MCP works |
| - | - |
| CRM integration | Connect to the CRM provider's MCP server |
| Enterprise tools | Share tools across multiple apps |
| Third-party services | Use pre-built MCP tool providers |
| Microservices | Each service exposes tools via MCP |

## How MCP works

MCP uses a client-server architecture with three components:

| Component | Role |
| - | - |
| **MCP Server** | Hosts and exposes tools to clients |
| **MCP Client** | The Platform, discovers available tools and invokes them |
| **MCP Protocol** | Standardized communication layer (HTTP or SSE) between client and server |

```mermaid actions={false} theme={null}
%%{init: {'theme': 'base', 'themeVariables': {'background': 'transparent', 'primaryColor': '#EAF8E4', 'primaryTextColor': '#1a1a1a', 'primaryBorderColor': '#5CC83A', 'lineColor': '#5CC83A', 'secondaryColor': 'transparent', 'tertiaryColor': 'transparent', 'clusterBkg': 'transparent', 'clusterBorder': '#5CC83A', 'titleColor': '#1a1a1a', 'clusterLabelBackground': 'transparent', 'edgeLabelBackground': '#EAF8E4'}}}%%
flowchart LR
    subgraph Project["Project"]
        MCPClient["MCP Client <br /> (built into the Platform)"]
    end
    MCPClient -- "MCP Protocol (HTTP/SSE)" --> MCPServer
    subgraph ExternalSystem["External System"]
        MCPServer["MCP Server"]
        MCPServer --> ToolA["Tool A"]
        MCPServer --> ToolB["Tool B"]
        MCPServer --> ToolC["Tool C"]
        MCPServer --> ToolD["Tool D"]
    end
```

### Interaction workflow

1. **Tool Discovery** - Agent Platform MCP client connects to the MCP server and retrieves the list of available tools.
2. **Intent Detection** - The LLM receives the user query and the tool list, then identifies the appropriate tool.
3. **Tool Invocation** - The client sends a structured request with the tool name and required parameters.
4. **Execution** - The server runs the tool and returns results to the client.
5. **Response Generation** - The agent uses the tool output to formulate a natural language response.

```mermaid actions={false} theme={null}
%%{init: {'theme': 'base', 'themeVariables': {'background': 'transparent', 'primaryColor': '#EAF8E4', 'primaryTextColor': '#1a1a1a', 'primaryBorderColor': '#5CC83A', 'lineColor': '#5CC83A', 'secondaryColor': 'transparent', 'tertiaryColor': 'transparent', 'clusterBkg': 'transparent', 'clusterBorder': '#5CC83A', 'titleColor': '#1a1a1a', 'clusterLabelBackground': 'transparent', 'edgeLabelBackground': '#EAF8E4'}}}%%
sequenceDiagram
    actor User
    participant LLM
    participant MCP Client
    participant MCP Server

    MCP Client->>MCP Server: 1. Tool Discovery (pre query execution)
    MCP Server-->>MCP Client: 2. Tool metadata list

    User-->>MCP Client: 3. User Query
    MCP Client-->>LLM: 4. Tool list & user query
    LLM->>MCP Client: 5. Selected Tool
    MCP Client->>MCP Server: 6. Invoke selected tool
    MCP Server-->>MCP Client: 7. Response
    MCP Client-->>LLM: 8. Tool Response
    LLM-->>User: 9. User friendly answer
```

### Example

```text theme={null}
User: "What's the weather in Dubai today?"

1. MCP Client connects to the MCP server and discovers available tools during configuration.
2. Agent identifies need for weather data and selects: `getWeatherForecast`.
3. Invokes with: { "location": "Dubai" }
4. Server returns: "36°C, Partly cloudy, Wind: 15 km/h"
5. Agent responds: "The weather in Dubai today is partly cloudy
   with a temperature of 36°C and light winds."
```

## Configure MCP server

Navigate to **Tools** > **MCP Servers**, provide the following and **Register Server**.

| Field | Description |
| - | - |
| Server name | A unique, meaningful name for the MCP server |
| Transport | The transport protocol — SSE (Server-Sent Events) or Streamable HTTP. **SSE (Server-Sent Events)**: Streaming responses for real-time updates using server sent events. **Streamable HTTP**: Unified HTTP transport to handle bidirectional streaming interactions between clients and servers over a single endpoint. |
| Server URL | The endpoint URL of the MCP server |
| Authentication | Expand the Authentication section to configure secure access. Enable **Use Auth Profile** to use a predefined profile. Supported methods: - API Key - OAuth - Bearer Token - Basic Authentication |
| Advanced Settings -> TLS profile | Select a TLS profile to secure connections to the MCP server. The selected profile applies the configured client certificate or CA certificate to all requests made to the server. |
| Variable Namespaces | Select the project variable namespaces that the MCP server can use to resolve variables in the server URL and request headers during design-time tool discovery, tool import, and runtime execution. |
| Environment variables | Use the Environment Variables section to define key-value pairs required by the MCP server at runtime. Click **Add** to configure them. |

Do the following after successfully registering an MCP server:

* Configure connection settings.
* Test server connectivity.
* View discovered tools.
* Import tools into the platform.

### Configure connection settings

| Field | Description |
| - | - |
| **Transport** | Select the transport protocol used to communicate with the MCP server. |
| **Server URL** | The endpoint URL of the MCP server that the platform connects to for tool discovery and execution. |
| **Authentication** | Select the authentication profile used to securely connect to the MCP server. Authentication profiles store credentials separately from the server configuration. |
| **Custom Headers** | Adds HTTP headers that are included with every request sent to the MCP server. Header values can be resolved dynamically at runtime. |
| **Parameters** | Define input parameters that are shared across tools hosted by the MCP server. Parameters can be parsed from incoming requests or added manually to establish the tool's input contract. |
| **Environment Variables** | Configure encrypted environment variables that are securely injected into MCP requests at runtime. These variables are not exposed in the server configuration. |
| **Priority** | Defines the execution priority of the MCP server relative to other configured servers. Higher-priority servers can be preferred during tool selection, depending on the runtime configuration. |
| **Connection Timeout (ms)** | Specifies how long the platform waits to establish a connection to the MCP server before timing out. |
| **Request Timeout (ms)** | Specifies the maximum time to wait for a response after a request is sent to the MCP server. Requests exceeding this duration fail with a timeout. |
| **Rate limit** | Specifies the maximum number of requests per minute that can be sent to the MCP server. This limit is enforced at the MCP server level and is **shared across all tools** exposed by the server. Leave this field empty to allow **unlimited requests**. |
| **Auto Reconnect** | Automatically attempts to re-establish the connection if communication with the MCP server is interrupted. |
| **Reuse connections** | When enables, keeps one connection open per conversation instead of reconnecting for every tool call, so tool calls are faster, especially on voice. Turn off if this server does not support long-lived sessions. |
| **Max Reconnect Attempts** | Specifies the maximum number of reconnection attempts before the platform stops trying to reconnect to the MCP server. |
| **UCP mode** | Enables Universal Commerce Protocol (UCP) mode for the MCP server. When enabled, the platform injects the UCP agent metadata into every request and returns the complete UCP response payload. |
| **Agent profile URI** | Specifies the URI of the agent profile used for UCP discovery and interoperability. Applicable only when UCP mode is enabled. |
| **Idempotent tools** | Select the tools that can safely be retried. The platform assigns a unique idempotency key to each invocation to help downstream services identify and safely process retry requests. |
| **Tags** | Add tags to categorize and organize MCP servers. Tags can help filter and identify servers within the project. |

**Dynamic URLs and parameters**

An MCP server URL can use `{{env.<name>}}`, `{{config.<name>}}`, and `{{input.<name>}}` references. Custom headers can use `{{input.<name>}}` references. In the server configuration, choose **Parse** to find input references in the URL and headers and add them to the server's parameter list. Add environment and config variables in their respective variable settings; they are resolved at run time and are not added as input parameters. You can also add input parameters manually.

* Server parameters can have default values. If a tool call omits a value, the configured default is used for URL and header placeholders.
* Every parameter used in the URL must have a default. Studio marks its default field as required and prevents saving the server without one.
* Studio uses the default URL for tool discovery, import, and connection testing. It shows this URL on the Configuration and Tools tabs. For example, a URL of `https://{{input.region}}.example.com/mcp` with `region` defaulted to `us` uses `https://us.example.com/mcp` for those actions.
* At run time, the platform resolves `{{env.<name>}}` and `{{config.<name>}}` references using the session's environment before substituting `{{input.<name>}}` values. For example, `https://{{env.MCP_HOST}}/{{config.API_VERSION}}/{{input.region}}/mcp` resolves to `https://mcp.example.com/v1/eu/mcp` when the session resolves `MCP_HOST` to `mcp.example.com`, `API_VERSION` to `v1`, and the call supplies `eu` for `region`. This works for `{{env.<name>}}` in a server URL even when the server does not link a variable namespace.
* Input values are inserted after environment and config references are resolved. A caller-supplied value does not get interpreted as another `{{env.<name>}}` or `{{config.<name>}}` reference. The final URL is checked before the platform connects; a URL that fails the safety check is rejected.
* If a call supplies no value and no default is available, the call fails.

When **Connection reuse** is enabled, calls to the same resolved URL in a conversation can reuse that URL's MCP session. Calls to different resolved URLs use separate sessions. This also lets an agent and workflows it starts reuse the session for the same URL.

## Test connection

Click **Test** to verify server connectivity and validate the current configuration. This confirms server reachability, authentication validity, transport configuration, and request handling.

## Discover and import tools

After registering a server, the platform automatically discovers the tools it exposes. You can then:

* Click **Import** next to a specific tool to add it individually
* Click **Import All** to add all discovered tools at once

Once imported, tools can be attached to one or more agents.

## View and test tools

Click on a tool to view its description, metadata, input and output parameters and to test the tool. Go to **Testing** and select **Run Test**, choose the environment (**Dev**, **Staging**, or **Production**) under **Run context**, enter sample values for the input fields, and verify the response. Any environment variables in the tool's headers use the values of the environment you choose.

> [!NOTE]
>
> **Custom header precedence:** Headers configured on the MCP server apply to all its requests. A header configured on an individual tool binding overrides the server header with the same name. Header names are matched case-insensitively, so `X-API-Key` and `x-api-key` are the same header. Headers present in only one configuration are retained. For example, if the server sets `X-API-Key: shared-value` and the tool sets `x-api-key: tool-value`, the request uses `tool-value`. The server and tool settings remain separate in configuration; they are combined when the request is prepared.

## Refresh MCP server

Use the **Refresh** icon to rediscover tools from the server. Do this when new tools are added, existing tools are updated, or tool metadata changes. Tool definitions are fetched at configuration time and aren't automatically synced.

## Attach MCP tools to an agent

Go to the selected agent, then navigate to **Tools** > **Attach Tool**. Select tools from the list. MCP tool names are prefixed with the MCP server name when attached to an agent.

You can also attach tools via the ABL file using the `/mcp-tool` insert command:

```yaml theme={null}
TOOLS:
  get_weather(location: string) -> {temp: number, conditions: string}
    type: mcp
    server: "weather-service"
    tool: "get_current_weather"
    description: "Get current weather for a destination"
```

where,

* server - MCP server name
* tool - Tool name on the MCP server


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