Mcp.Dataverse.Stdio 2025.4.27.2

dotnet tool install --global Mcp.Dataverse.Stdio --version 2025.4.27.2
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local Mcp.Dataverse.Stdio --version 2025.4.27.2
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=Mcp.Dataverse.Stdio&version=2025.4.27.2
                    
nuke :add-package Mcp.Dataverse.Stdio --version 2025.4.27.2
                    

Overview

The objective of this repo is to enable querying of Dataverse environment using SQL. You can use popular AI tools such as GitHub Copilot or Claude Desktop to query Dataverse, provided you add this MCP Server in the configuration.

A big thank you to Mark Carrington for creating Sql4Cds, without whom this project would not exist. 🙏

Prerequisites 🔍

  1. VSCode March (minimum March 2025 version) or Claude Desktop
  2. Azure CLI installed and authenticated on your local machine, if you are not using the DevContainer option. While interactive browser authentication is possible using Azure Identity framework, using Azure CLI to manage the authentication is little easier.
  3. Docker, if you want to run Dev Containers or the MCP Server inside DevContainer.
  4. dotnet 9.0 SDK if you want to install the dotnet tool.

Model Context Protocol (MCP) 📋

This is how Anthropic, the creators of MCP specification, defines Model Context Protocol

MCP is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications. Just as USB-C provides a standardized way to connect your devices to various peripherals and accessories, MCP provides a standardized way to connect AI models to different data sources and tools.

Installation 🚀

Install as dotnet

If the button abobe does not work, paste the below URL to the address bar.

vscode:mcp/install?%7B%0A%20%20%20%20%22name%22%3A%20%22dataverse-mcp-dotnet-tool%22%2C%0A%20%20%20%20%22type%22%3A%20%22stdio%22%2C%0A%20%20%20%20%22command%22%3A%20%22mcp-dataverse%22%2C%0A%20%20%20%20%22env%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22DATAVERSE_ENVIRONMENT_URL%22%3A%20%22https%3A%2F%2Fxyz.crm.dynamics.com%22%0A%20%20%20%20%7D%0A%7D

Install with Docker in VS Code

If the button abobe does not work, paste the below URL to the address bar.

vscode:mcp/install?%7B%0A%20%20%20%20%22name%22%3A%20%22dataverse-mcp-docker%22%2C%0A%20%20%20%20%22type%22%3A%20%22stdio%22%2C%0A%20%20%20%20%22command%22%3A%20%22docker%22%2C%0A%20%20%20%20%22args%22%3A%20%5B%0A%20%20%20%20%20%20%20%20%22run%22%2C%0A%20%20%20%20%20%20%20%20%22--env-file%22%2C%0A%20%20%20%20%20%20%20%20%22%24%7BworkspaceFolder%7D%2F.env%22%2C%0A%20%20%20%20%20%20%20%20%22-i%22%2C%0A%20%20%20%20%20%20%20%20%22--rm%22%2C%0A%20%20%20%20%20%20%20%20%22rajyraman%2Fmcp-stdio-dataverse%22%0A%20%20%20%20%5D%0A%7D

You can click the buttons above to get the MCP Server config settings. You have two options to use this MCP Server:

  1. Docker Container
  2. dotnet tool

Below is the recommendation based on the where you plan to use this MCP

In Client Recommendation
Windows GitHub Copilot dotnet tool. Use Docker/Podman as fallback, if you have auth issues.
Windows Claude Desktop dotnet tool
MacOS Claude Desktop, GitHub Copilot dotnet tool
Linux Claude Desktop, GitHub Copilot dotnet tool
GitHub Codespaces GitHub Copilot dotnet tool

Since this MCP server is built with MCP C# SDK, it is distributed via nuget as a dotnet tool. dotnet 9.0 SDK can be installed in all major OSes.

You can install the Dataverse MCP Server as a global dotnet tool using the command below.

dotnet tool install -g Mcp.Dataverse.Stdio

Configuration

Below is a sample .env file that you can use if you choose to run the MCP Server inside a container. Create the .env on the workspace folder (same level as the README.md).

AZURE_CLIENT_ID=aba9829f-6288-44d7-9168-53eca9a1f4a5
AZURE_CLIENT_SECRET=abcd
AZURE_TENANT_ID=2caa17e6-884b-473b-80c5-c05d8859a2fa
DATAVERSE_ENVIRONMENT_URL=https://abc.crm6.dynamics.com
DOCKER_CONTAINER=true

Sample MCP Config

{
    "servers": {
        "dataverse-mcp-dotnet-tool": {
            "type": "stdio",
            "command": "mcp-dataverse",
            "env": {
                "DATAVERSE_ENVIRONMENT_URL": "https://abc.crm6.dynamics.com"
            }
        }
    }
}

Configuration for GitHub Codespaces

When you create you Codespace make sure you select the devcontainer.json inside the nuget-tool folder. You should also change the dataverse-nosecrets.env so that the DATAVERSE_ENVIRONMENT_URL environment variable is pointing to the right environment URL.

codespace-step-1

codespace-step-2

Prompts

If you are using GitHub Copilot, copilot-instructions.md file should automatically be used.

On Claude Desktop, you can clicking the "Attach from MCP" button.

Select Prompt

Examples

Example 1 - Get Unmanaged Solutions 📦

Unmanaged Solutions

Example 2 - Show Solutions by Publisher 🏢

Solutions by Publisher

Example 3 - Solutions Imported last week 📅

Solutions imported last week

Example 4 - Plugins registered on contact and account 🔌

Plugin Steps

Example 5 - Running SQL directly with #ExecuteSQL tool

Direct SQL

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
2025.4.27.2 134 4/27/2025
2025.4.27.1 83 4/27/2025
2025.4.25.1 100 4/25/2025