Formerly known as Azure AI Services or Azure Cognitive Services is a unified collection of prebuilt AI capabilities within the Microsoft Foundry platform
Hello Manish,
Thank you for your response.
I'd like to explain the two approaches we identified and tested in Foundry.
Option 1: Default Dataverse MCP Connector
Configuration
- We used the endpoint: https://agent365.svc.cloud.microsoft/agents/servers/Dataverse/{DataverseMCPServerName}
- The connector only allows the {DataverseMCPServerName} parameter to be modified. The rest of the endpoint is fixed and cannot be edited. Because of this limitation, we are unable to use the endpoint https://agent365.svc.cloud.microsoft/mcp/environments//servers/.
- For {DataverseMCPServerName}, we used the alias assigned when publishing the server. We did this because the documentation indicates that publishing the server links the main Dataverse server to a specific environment. The command used was: 365 develop-mcp publish --server-name msdyn_DataverseMCPServer --environment-id <DEVELOPMENT_ID> --alias dataverse-dev --display-name "Dataverse MCP - Development"
Results
- After publishing the server, an approval request appeared in the Admin Center. However, the process eventually returned the following error: "Could not find 'McpServers.Dataverse.All' scope on app ea9ffc3e-8a23-4a7d-836d-234d7c7565c1. API permissions not added."
- Despite the error, the server was successfully approved.
Additional Information
- It is important to mention that we used msdyn_DataverseMCPServer as the first-party server when publishing to Agent 365 because our goal was to associate it with a specific Dataverse environment. The connector's fixed endpoint does not provide any way to specify the target environment.
- We tested both Managed OAuth Authentication and Custom OAuth Authentication for the tool, but neither option worked.
- Our preferred approach is Managed OAuth Authentication because it would allow the tool to inherit the permissions of the signed-in user.
- We also registered the MCP client "Agent365" under the Allowed MCP Clients configuration.
Option 2: Custom MCP Connector
After many attempts, this approach worked, but only when using Custom OAuth Authentication.
Configuration
- Endpoint used: https://org.crm4.dynamics.com/api/mcp
- Custom OAuth Authentication using an Entra ID application. Managed Identity is not available in this scenario, meaning the tool cannot use the user's delegated identity.
- A Dynamics Application User was created for the Entra ID application.
- The MCP client was added to the Allowed MCP Clients section in the environment's Advanced Settings.
Issues with This Option
Although this approach works, it presents several significant challenges:
- Users do not inherit permissions from their delegated identity.
- The tool must be approved again in every session.
- We frequently encounter HTTP 401 errors because the tool does not automatically reauthenticate.
- In many cases, the page must be refreshed several times before the tool requests consent and allows the user to authenticate again.
Our preferred solution is Option 1, as it would allow the tool to operate using the user's delegated permissions and provide a much better user experience. Could you please advise whether our configuration is correct and what may be causing the missing 'McpServers.Dataverse.All' scope error? We would also appreciate confirmation of the expected configuration for using the default Dataverse MCP connector with Agent365.
Thank you for your assistance. Any guidance on resolving the issues preventing Option 1 from working would be greatly appreciated.
Best regards,
Sergio Villaescusa Moreno