The Dataverse MCP Server provides a comprehensive interface for managing Microsoft Dataverse schema through the Model Context Protocol (MCP). This server enables you to create and manage tables, columns, relationships, and option sets using the Dataverse Web API.
You need the following before getting started:
Navigate to Dataverse Admin Center
Create Application User
Assign Security Roles
Verify Application User Status
Gather the following information:
https://yourorg.crm.dynamics.com
)npm install
npm run build
index.js
file (e.g., /Users/yourname/path/to/mcp-dataverse/build/index.js
)There are three approaches to configuration:
.env
file by copying .env.example
:cp .env.example .env
{
"mcpServers": {
"dataverse": {
"command": "node",
"args": ["/path/to/mcp-dataverse/build/index.js"],
"disabled": false,
"timeout": 900
}
}
}
Configure environment variables directly in MCP settings:
{
"mcpServers": {
"dataverse": {
"command": "node",
"args": ["/path/to/mcp-dataverse/build/index.js"],
"env": {
"DATAVERSE_URL": "https://yourorg.crm.dynamics.com",
"DATAVERSE_CLIENT_ID": "your-client-id",
"DATAVERSE_CLIENT_SECRET": "your-client-secret",
"DATAVERSE_TENANT_ID": "your-tenant-id"
},
"disabled": false,
"timeout": 900
}
}
}
Before creating schema, set up a publisher and solution:
// 1. Create publisher with custom prefix
await use_mcp_tool("dataverse", "create_dataverse_publisher", {
friendlyName: "XYZ Test Publisher",
uniqueName: "xyzpublisher",
customizationPrefix: "xyz",
customizationOptionValuePrefix: 20000
});
// 2. Create solution linked to publisher
await use_mcp_tool("dataverse", "create_dataverse_solution", {
friendlyName: "XYZ Test Solution",
uniqueName: "xyzsolution",
publisherUniqueName: "xyzpublisher"
});
// 3. Set solution context (persisted across server restarts)
await use_mcp_tool("dataverse", "set_solution_context", {
solutionUniqueName: "xyzsolution"
});
// Create a new custom table
await use_mcp_tool("dataverse", "create_dataverse_table", {
displayName: "Project",
description: "Custom table for managing projects",
ownershipType: "UserOwned",
hasActivities: true,
hasNotes: true
});
// String column with email format
await use_mcp_tool("dataverse", "create_dataverse_column", {
entityLogicalName: "xyz_project",
displayName: "Contact Email",
columnType: "String",
format: "Email",
maxLength: 100,
requiredLevel: "ApplicationRequired"
});
// Integer column with constraints
await use_mcp_tool("dataverse", "create_dataverse_column", {
entityLogicalName: "xyz_project",
displayName: "Priority Score",
columnType: "Integer",
minValue: 1,
maxValue: 10,
defaultValue: 5
});
// Boolean column with custom labels
await use_mcp_tool("dataverse", "create_dataverse_column", {
entityLogicalName: "xyz_project",
displayName: "Is Active",
columnType: "Boolean",
trueOptionLabel: "Active",
falseOptionLabel: "Inactive",
defaultValue: true
});
// Picklist column with local options
await use_mcp_tool("dataverse", "create_dataverse_column", {
entityLogicalName: "xyz_project",
displayName: "Status",
columnType: "Picklist",
options: [
{ value: 1, label: "Planning" },
{ value: 2, label: "In Progress" },
{ value: 3, label: "On Hold" },
{ value: 4, label: "Completed" }
]
});
// Lookup column
await use_mcp_tool("dataverse", "create_dataverse_column", {
entityLogicalName: "xyz_project",
displayName: "Account",
columnType: "Lookup",
targetEntity: "account"
});
// Create a One-to-Many relationship
await use_mcp_tool("dataverse", "create_dataverse_relationship", {
relationshipType: "OneToMany",
schemaName: "new_account_project",
referencedEntity: "account",
referencingEntity: "new_project",
referencingAttributeLogicalName: "new_accountid",
referencingAttributeDisplayName: "Account",
cascadeDelete: "RemoveLink"
});
// Create a global option set
await use_mcp_tool("dataverse", "create_dataverse_optionset", {
name: "new_priority",
displayName: "Priority Levels",
options: [
{ value: 1, label: "Low", color: "#00FF00" },
{ value: 2, label: "Medium", color: "#FFFF00" },
{ value: 3, label: "High", color: "#FF0000" }
]
});
// Generate a simple retrieve operation
await use_mcp_tool("dataverse", "generate_webapi_call", {
operation: "retrieve",
entitySetName: "accounts",
entityId: "12345678-1234-1234-1234-123456789012",
select: ["name", "emailaddress1", "telephone1"]
});
// Generate a create operation with return preference
await use_mcp_tool("dataverse", "generate_webapi_call", {
operation: "create",
entitySetName: "accounts",
data: {
name: "Test Account",
emailaddress1: "[email protected]",
telephone1: "555-1234"
},
prefer: ["return=representation"]
});
// Export custom schema only
await use_mcp_tool("dataverse", "export_solution_schema", {
outputPath: "my-solution-schema.json"
});
// Export with system entities included
await use_mcp_tool("dataverse", "export_solution_schema", {
outputPath: "complete-schema.json",
includeSystemTables: true,
includeSystemColumns: true,
includeSystemOptionSets: true
});
Authentication Failed
Permission Denied
Entity Not Found
For verbose logging, set the DEBUG
environment variable:
DEBUG=true node build/index.js
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "dataverse" '{"command":"node","args":["/path/to/mcp-dataverse/build/index.js"],"env":{"DATAVERSE_URL":"https://yourorg.crm.dynamics.com","DATAVERSE_CLIENT_ID":"your-client-id","DATAVERSE_CLIENT_SECRET":"your-client-secret","DATAVERSE_TENANT_ID":"your-tenant-id"},"disabled":false,"alwaysAllow":[],"disabledTools":[],"timeout":900}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"dataverse": {
"command": "node",
"args": [
"/path/to/mcp-dataverse/build/index.js"
],
"env": {
"DATAVERSE_URL": "https://yourorg.crm.dynamics.com",
"DATAVERSE_CLIENT_ID": "your-client-id",
"DATAVERSE_CLIENT_SECRET": "your-client-secret",
"DATAVERSE_TENANT_ID": "your-tenant-id"
},
"disabled": false,
"alwaysAllow": [],
"disabledTools": [],
"timeout": 900
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"dataverse": {
"command": "node",
"args": [
"/path/to/mcp-dataverse/build/index.js"
],
"env": {
"DATAVERSE_URL": "https://yourorg.crm.dynamics.com",
"DATAVERSE_CLIENT_ID": "your-client-id",
"DATAVERSE_CLIENT_SECRET": "your-client-secret",
"DATAVERSE_TENANT_ID": "your-tenant-id"
},
"disabled": false,
"alwaysAllow": [],
"disabledTools": [],
"timeout": 900
}
}
}
3. Restart Claude Desktop for the changes to take effect