Copilot can't connect to Pega using MCP

In Copilot Studio, I’m trying to connect Copilot to Pega using MCP. I successfully created a new MCP connector by entering the Pega’s MCP service URL. Now I’m trying to connect to Pega but it fails. I’ve already added Microsoft under Network > External Services and the status shows OK. Any help is appreciated.

After further debugging, this is the error message that i see:
“?error=invalid_request&error_description=Invalid+value+provided+for+redirect_uri+parameter

Where can we find the correct redirect uri?

i was able to get the redirect uri but now the connection is throwing this error.

Looks like another person faced the same issue. Still trying to find the root cause.

Hi @Will_Cho , Redirect URI will be shown while adding the MCP url once after you configure the Oauth credntials

@Will_Cho It seems like authorisation is working, but converting the auth code to access token is failing. It would be good to get the Pega logs for the same timestamp to find the actual error.

Hi @Will_Cho : I hope this is the MCP for your application. If this is the case, can you try to add the localhost (http://IP of localhost:1987/mcp/oauth/callback) to the list of redirect URIs in the OAuth 2.0 Client of the Service MCP rule.

IP for localhost is standard. I cannot add this here beucase the forum treats it as a proprietary info.

Thanks.

@Murali.Krishnan.D this is the error message in the Pega log.. do you see any clue? This happens each time I retest.

2026-09-11 17:22:47,034 [se-nio-9443-exec-270] [  STANDARD] [                    ] [                    ] (     services.http.HTTPService) ERROR lab-20067-us-east-1|127.0.0.1   - Resource not found 

com.pega.pegarules.pub.PRException: Couldn't find Rule-Service-Rest instance for the following uri:/oauth2/v1/pzpega_fingerprint_11780680302!!.js 

Added it but still see the same error.

There is a typo in the port in my initial reply. The port should be 19876. This is for the AI harness which im using. Based on my checks, Cloilot studio might have given you a callback URL during configuration.

Ref: Connect your agent to an existing Model Context Protocol (MCP) server - Microsoft Copilot Studio | Microsoft Learn

In this case, you should be adding the callback url generated in the above step in Pega OAuth Client registration.

Thanks.