Skip to main content

Connecting Agents and Case workflows with MCP

A Connect MCP Rule connects a Pega GenAI™ Agent to an external Model Context Protocol (MCP) server and provides access to tools that the server exposes. At run time, the Pega Agent can discover and invoke the tools to retrieve external data, access contextual information, and perform tasks beyond the Agent’s native capabilities.

Connect MCP Rule and configuration

In this architecture, the Pega Agent acts as the MCP client and communicates with the external MCP server through the Connect MCP Rule. In the Connect MCP Rule, you can configure the transport protocol, MCP server URL, custom request headers, and authentication details. You can specify the MCP server URL directly or use Application Settings to define environment-specific values. To provide authentication details, use an Authentication Profile or Application Settings. The Connect MCP Rule supports OAuth 2.0 authentication through client credentials, password credentials, and a JSON Web Token (JWT) bearer token. 

After you associate the Connect MCP Rule with an Agent, the Agent can discover and invoke the tools that the external MCP server exposes at run time. Through these tools, the Agent can access external data and contextual information that complement the capabilities of Pega GenAI. 

For detailed Rule creation and configuration steps, see Connecting an Agent to an MCP protocol

Transport configuration

The Connect MCP Rule can be configured to use the following transport protocols for communication with an external MCP server: 

Streamable HTTP: The Connect MCP Rule uses Streamable HTTP as the default and preferred transport protocol. In Pega Platform™ 26.1, the MCP connector supports request-and-response interactions but does not support streaming responses, progressive updates, or status messages. 

Server-Sent Events: The Connect MCP Rule also supports Server-Sent Events (SSE) as a transport option. Use SSE only for backward compatibility. 
 
The transport protocol is configured on the Service tab of the Connect MCP Rule. 

URL configuration

You can configure the external MCP server URL directly in the Connect MCP Rule or manage it through an Application Setting. 

Provide URL: Select Provide URL when all environments use the same MCP server URL. Then, enter the URL directly in the Connect MCP Rule.

Use Application Setting: Select Use Application Setting when different staging environments require different MCP server URLs. Then, store the URL for each environment in the Application Setting. 

Custom header configuration: In the Header section of the Connect MCP Rule, you can configure custom request headers and pass them to the external MCP server. 

Constant: Select Constant to send a static string value to the external MCP server. 

Clipboard: Select Clipboard to send a dynamic Clipboard value to the external MCP server. 

Authentication configuration

The Connect MCP Rule uses authentication details to establish a secure connection between the Pega Agent and the external MCP server. An Authentication Profile stores the authentication details required by the external MCP server. For environment-specific authentication, use Application Settings to provide the appropriate authentication details for each environment.

Associating Agents with Connect MCP Rule

After you create a Rule, associate it with an Agent in the External agents and tools section of the Agent record. Add the Connect MCP Rule to the MCP configuration of the Agent to connect the Agent to the external MCP server. 

After you associate the Rule, the Agent can communicate with the MCP service and use the tools that the external MCP server exposes. 

MCP Connect Step

The MCP Connect Step, introduced in Pega Infinity™ 26, is an automated step that sends work to a third-party system for processing. It uses the MCP to bring information and tools from outside Pega Platform into the workflow. The step invokes a single tool exposed by an external MCP server through a Connect MCP Rule. It establishes communication by using the transport, URL, header, and authentication settings defined in that Rule. 

By invoking a predefined tool directly from the workflow, the MCP Connect Step avoids Agent-based tool selection. This approach improves execution predictability and can reduce latency. For example, in an expense reports application, an MCP Connect Step can call an external fraud detection service. 

Before using the MCP Connect Step, enable and configure generative AI in the Application Settings, and turn on the EnableGenerativeAI toggle. Then, create a Connect MCP Rule to connect to the external MCP server and make its tools available to the step. 

The image shows the MCP Connect Step configuration within a Case Lifecycle. Select a Connect MCP Rule and an available tool, and map the required tool parameters to values used during workflow processing. 

Step Configuration

 

At run time, when the Case reaches the MCP Connect Step, the application uses the Connect MCP Rule to invoke the selected tool on the external MCP server. 

Check your knowledge with the following interaction:

 


This Topic is available in the following Module:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice