Model Context Protocol (MCP) tools in Elastic Agent Builder

Agent Builder MCP tools enable calling a remote MCP server's tools in your agent chat. For example, you can import a documentation-lookup tool from an external service so your agent can fetch current library docs during a conversation. When your agent calls an MCP tool, it executes the associated tool on the MCP server and returns its result.

Note

On this page, Elastic Agent Builder acts as the MCP client: your agents connect to an external MCP server to use its tools. To instead let external MCP hosts use your Elastic Agent Builder tools, refer to Elastic Agent Builder MCP server.

To use external MCP tools, you first need to set up an MCP connector. This interface enables Agent Builder MCP tools to communicate with a remote MCP server.

You can import MCP tools individually or in bulk.

After you set up an MCP connector, click + New tool on the Tools page and select the MCP tool type. The following screenshot shows an example configuration:

Example configuration for a new MCP tool with the Context7 MCP server, including the Require user confirmation policy set to Never.

Individual MCP tools have the following configuration settings:

MCP Server
The MCP connector to interface with.
Tool
The specific tool on MCP server to create an Agent Builder MCP tool for.
After you select a tool, the Tool ID and Description fields automatically populate with the tool name and description provided by the MCP server.
Require user confirmation
Controls whether the agent asks you to approve a call to this tool before it runs. Select Never (default) to run without a prompt, Once to prompt the first time the agent calls the tool in a conversation, or Always to prompt on every call. For details, refer to Require confirmation before a tool runs.

To import multiple tools at once, go to the Tools page and select Bulk import MCP tools from the Manage MCP dropdown. The following screenshot shows where to find this option:

How to bulk import MCP tools from an MCP server.

Configure the following fields:

MCP Server
The MCP connector to interface with.
Tools to import
The specific tools from the MCP server to import.
Namespace
A string to prepend to the tool name to aid in searching and organization. A namespace must start with a letter and contain only lowercase letters, numbers, and hyphens.

The following screenshot shows an example bulk import from the Context7 MCP server:

Example configuration for bulk importing MCP tools from the Context7 MCP server.

After you click Import tools, Agent Builder creates an MCP tool for each selection.

Each tool's ID is generated as namespace.tool-name (for example, context7.resolve-library-id), and descriptions are populated automatically from the MCP server.

Bulk import doesn't configure confirmation, so each imported tool starts with Require user confirmation set to Never. To require confirmation for an imported tool, edit it after import.

When an agent calls an MCP tool:

  1. Agent Builder retrieves the tool's input schema from the MCP connector.
  2. Agent Builder calls the MCP server tool with the required parameters.
  3. The MCP server returns the result directly to the LLM with no post-processing.
  4. The LLM interprets the result for the user.

MCP tools have built-in health monitoring. Tools that are unhealthy display an icon next to their IDs on the Tools page.

An MCP tool is marked "unhealthy" when:

  • The MCP tool's associated MCP connector is unavailable. The tool shows this icon:

    Connector unavailable icon.
  • The MCP tool's associated tool on the MCP server no longer exists. The tool shows this icon:

    Tool not found icon.
  • The MCP tool's execution failed. The tool shows this icon:

    Tool execution failed icon.