MCP tools

Model Context Protocol (MCP) is an open-source standard for connecting AI applications to external systems. It establishes a specific set of entities and a defined structure, which acts as a standard way to connect various data sources and tools with AI models.

You can use MCP tools to connect your agent application with an existing MCP server.

Limitations

The following limitations apply:

  • CX Agent Studio only supports StreamableHttpTransport-based servers; SSE transport servers are not supported.

Build or select a MCP server

To build your own MCP server, we recommend using the official MCP SDKs or other reliable third-party SDKs such as FastMCP. Once the MCP server is created, deploy it to a hosting service. You can use Cloud Run or Compute Engine to host the MCP server. Consider following this guide to understand the process end-to-end: Build and Deploy a Remote MCP Server to Google Cloud Run in Under 10 Minutes.

Instead of building an MCP server from scratch, you can also use a prebuilt MCP server, such as a Google Cloud MCP server.

Authentication

MCP tools have the same authentication options as OpenAPI tools.

Test the MCP server independently

Before connecting your agents to the MCP server, we recommend testing the MCP server independently. Servers built using StreamableHttpTransport end with the suffix (/mcp or /mcp/). For example, if the server is hosted at https://example.com, the correct URL to send requests to the server would be https://example.com/mcp.

To test the server locally, consider using curl or Postman (which natively supports MCP connections). This ensures the server is up and running and that the authentication information required to communicate with the server is understood.

Create the MCP Tool

To create an MCP tool from the console:

  1. Click the tool icon on the right side of the agent builder.
  2. Select MCP tool.
  3. Provide a tool name.
  4. Provide a tool description.
  5. Provide the server address for the MCP server.
  6. Select an authentication type.
  7. Click Create.

For servers hosted on Cloud Run, the recommended authentication option is Service Agent ID Token. This method uses the CX Agent Studio service account (of the format: service-{PROJECT_NUMBER}@gcp-sa-ces.iam.gserviceaccount.com) to send requests to the Cloud Run job. Grant the Cloud Run Invoker role to the CX Agent Studio service account , so it can send requests to the server using its own identity.

Before adding additional tools to the agent, we recommend testing at least one tool to ensure the authentication information is set up correctly.