Skip to main content
Glama
Dataverse Mcp Server

Dataverse Mcp Server

dataverse-mcp-server

npm version npm downloads CI Node.js TypeScript License: MIT

MCP (Model Context Protocol) server for Microsoft Dataverse — the data platform behind Dynamics 365 CRM (Sales, Customer Service) and Power Apps — with safe-by-default configuration. Works with any Dataverse / Dynamics 365 environment.

Tools

Data operations

Tool

Description

list_entities

List Dataverse tables with optional prefix and solution filters

list_solutions

List Dataverse solutions (use uniquename to filter list_entities)

get_entity_metadata

Get attributes of a specific table — choice columns carry an option_set summary

get_attribute_metadata

Get the definition of one column with its type-specific limits (MaxLength, MinValue/MaxValue, Format, …)

query_records

Query records with OData $filter, $select, $orderby, $expand, and either $top or a page size; a result longer than one page returns a cursor for the next page

get_record

Get a single record by ID

aggregate_records

Count, sum, average, min and max of records, grouped by columns and by year, quarter, month, week or day of a date, computed by Dataverse (at most 50,000 rows and one page of groups per query: 5000, or 500 on an elastic table)

create_record

Create a record

update_record

Update a record

delete_record

Delete a record (disabled by default, see Safety)

list_record_documents

List the files in a record's SharePoint folder, as its Documents tab shows them: name, path, type, size, modified date and by whom, URL. Needs a one-time admin setup

download_record_document

Get one file from a record's SharePoint folder by its path, without its content passing through the tool's result. Off unless enabled; needs a read-only Microsoft Graph permission (setup)

Note: solution / DATAVERSE_SOLUTION_NAME only scopes list_entities (schema browsing). Data tools (query_records, get_record, create_record, …) keep full access to any table regardless of solution membership — shared tables like account or contact remain reachable.

Schema operations

Tool

Description

create_entity

Create a new table with attributes

add_attribute

Add a column to an existing table (Choice columns can bind to a Global OptionSet)

update_attribute

Update column metadata (display name, required level, bounds, …)

delete_attribute

Delete a column (disabled by default, see Safety)

get_attribute_dependencies

List CRM components (forms, views, workflows, …) that reference a column — use after delete_attribute fails with 0x8004f01f

create_relationship

Create relationships between tables (1:N, N:N)

list_entity_keys

List alternate keys on a table (returns key_attributes, entity_key_index_status, …)

add_entity_key

Create an alternate key (single or composite) — enables race-safe keyed-PATCH upserts

delete_entity_key

Delete an alternate key and its supporting unique index (disabled by default, see Safety)

Dataverse does not allow changing a column's logical name or type. To "rename" or change type: create a new column, migrate data via update_record, then delete_attribute on the old one.

Choice columns: local values or a shared Global OptionSet

A Picklist attribute takes exactly one of two fields. options defines the values inline and produces a Local OptionSet owned by that single column:

{ "logical_name": "contoso_source", "type": "Picklist", "display_name": "Source",
  "options": [ { "label": "Website", "value": 909890000 } ] }

global_option_set instead binds the column to an existing Global OptionSet by name, so several columns across several tables share one list and cannot drift apart:

{ "logical_name": "contoso_source", "type": "Picklist", "display_name": "Source",
  "global_option_set": "contoso_sourceset" }

Supplying both is rejected. That check is not cosmetic: Dataverse itself accepts the pair and then silently ignores the binding, leaving a local copy that looks bound. An unknown set name fails as Global OptionSet not found: '<name>' before anything is created — including in create_entity, which resolves names and validates every attribute before the table exists, so a rejected column cannot leave a half-built table behind.

Verify the result with get_picklist_options: a bound column reports is_global: true and the global set's own metadata_id.

Picklist option management

Tool

Description

get_picklist_options

Read a Local or Global OptionSet — its identity plus [{ value, label }]; for a Status column also each option's state and transitions (the status transition matrix)

add_picklist_option

Add an option to an existing OptionSet (InsertOptionValue)

update_picklist_option

Rename an option on an OptionSet (UpdateOptionValue)

delete_picklist_option

Remove an option from an OptionSet (DeleteOptionValue)

Picklist tools accept either entity_logical_name + attribute_logical_name (a column) or option_set_name (a Global OptionSet) — the two modes are mutually exclusive. Write operations require Customizer or System Administrator role on the connected service principal. Deleting an option does not update existing records that hold its numeric value — they are left with an orphan integer.

Telling a Global OptionSet from a local copy

get_picklist_options returns the set's identity alongside its options:

{
  "option_set": {
    "name": "contoso_origin",
    "is_global": true,                                   // bound to a shared Global OptionSet
    "metadata_id": "77777777-7777-7777-7777-777777777777"
  },
  "options": [ { "value": 909890000, "label": "Website" }, /* … */ ]
}

is_global is the answer to "does this column reuse an org-wide list, or does it own a private copy?" — matching values prove nothing on their own, and a column with a local set reports an auto-generated name like opportunity_prioritycode with is_global: false. To confirm which global set a column is bound to, compare its metadata_id against the one returned by get_picklist_options { option_set_name: … }.

The lookup covers Choice, Status, State and MultiSelect columns, so statecode / statuscode can be read the same way as a custom choice column.

get_entity_metadata reports the same identity per column as a compact option_set summary with an option_count instead of the values themselves — read the values for a single column with get_picklist_options:

{
  "LogicalName": "contoso_origin",
  "AttributeType": "Picklist",
  "option_set": { "name": "contoso_origin", "is_global": true, "metadata_id": "77777777-…", "option_count": 6 }
}

Status transitions

A table can restrict which status reason a record may move to. For a Status column (statuscode), get_picklist_options returns that matrix: enforce_state_transitions (the table's EnforceStateTransitions) next to options, and on each option its state (the statecode value it belongs to) and transitions (the status reason values a record may move to from it):

{
  "option_set": { "name": "contoso_ticket_statuscode", "is_global": false, "metadata_id": "…" },
  "enforce_state_transitions": true,
  "options": [
    { "value": 1, "label": "New", "state": 0, "transitions": [2, 3] },
    { "value": 2, "label": "In Progress", "state": 0, "transitions": [3] },
    { "value": 3, "label": "Closed", "state": 1, "transitions": [] }
  ]
}

transitions: [] means no move from that status reason is allowed. When enforce_state_transitions is false, the matrix does not apply, whatever transitions holds: null, or a list the option still stores. A transition may lead to a status reason of another state. To get one record's allowed transitions, read its statuscode with get_record, then take that option's transitions. When update_record refuses a status change with 0x8004f00e ("does not have valid status code"), the transition may be one the matrix forbids.

Other choice columns return no state, transitions or enforce_state_transitions.

Actions & functions

Tool

Description

invoke_action

Invoke a Web API action (POST), bound or unbound — for operations outside plain CRUD (e.g. PublishDuplicateRule, QualifyLead)

invoke_function

Invoke a Web API function (GET), bound or unbound — read-only operations exposed as functions (e.g. WhoAmI)

Pass entity_set + id for a bound call (POST /<entity_set>(<id>)/Microsoft.Dynamics.CRM.<name>); omit both for an unbound call (POST /<name>). For invoke_action, parameters is the JSON request body; for invoke_function, parameters is inlined as OData function arguments. Bare operation names are namespaced automatically for bound calls — pass a fully-qualified name to override.

Examples:

// Publish a draft duplicate-detection rule.
// PublishDuplicateRule is a BOUND action on duplicaterule (returns an async job).
invoke_action({ name: "PublishDuplicateRule", entity_set: "duplicaterules", id: "<guid>" })

// Unpublish is an UNBOUND action taking DuplicateRuleId — note the asymmetry.
invoke_action({ name: "UnpublishDuplicateRule", parameters: { DuplicateRuleId: "<guid>" } })

// Qualify a lead into Account/Contact/Opportunity (bound action on lead).
invoke_action({ name: "QualifyLead", entity_set: "leads", id: "<guid>",
                parameters: { CreateAccount: true, CreateContact: true, CreateOpportunity: true, Status: 3 } })

Whether an operation is bound or unbound is defined in the Web API $metadata, not by intuition — e.g. PublishDuplicateRule is bound but UnpublishDuplicateRule is unbound. Check $metadata (look for IsBound="true" and the binding Parameter) if a call returns 404 "Resource not found for the segment".

⚠️ invoke_action can perform arbitrary mutating operations. It is currently ungated by design; capability-based access control (a safe-by-default policy gating writes/actions) is tracked separately in #45 / #46. invoke_function is read-only.

Related MCP server: xrm-mcp

Quick start (no clone)

Add to .mcp.json in your project root:

{
  "mcpServers": {
    "dataverse": {
      "command": "npx",
      "args": ["-y", "@rededis/dataverse-mcp-server"]
    }
  }
}

Create a .env file next to it with the four required variables (see Environment variables below) and restart your MCP client. The -y flag tells npx to auto-confirm the package install.

Setup

Environment variables

DATAVERSE_TENANT_ID=your-azure-tenant-id
DATAVERSE_CLIENT_ID=your-app-registration-client-id
DATAVERSE_CLIENT_SECRET=your-client-secret
DATAVERSE_RESOURCE_URL=https://your-org.crm.dynamics.com
DATAVERSE_ENTITY_PREFIX=contoso_          # optional, default prefix filter for list_entities
DATAVERSE_SOLUTION_NAME=MySolution        # optional, default solution unique name for list_entities
DATAVERSE_ALLOW_DELETE=true               # optional, enable delete operations (disabled by default)
DATAVERSE_REQUEST_TIMEOUT_MS=30000        # optional, per-request timeout in ms for Dataverse and token calls (default 30000, max 120000)
DATAVERSE_MAX_CONCURRENCY=8               # optional, requests sent to Dataverse at once (default 8, 1 to 100)
DATAVERSE_MAX_QUEUE_LENGTH=100            # optional, requests that may wait for a free slot (default 100, 0 to 10000)
DATAVERSE_MAX_QUEUE_WAIT_MS=10000         # optional, longest wait for a free slot in ms (default 10000, max 120000)
DATAVERSE_MAX_ATTEMPTS=3                  # optional, times a throttled request is sent, the first try included (default 3, 1 to 10)
DATAVERSE_MAX_RETRY_WAIT_MS=15000         # optional, longest wait on throttling per request in ms (default 15000, max 120000)
DATAVERSE_DOCUMENTS_DOWNLOAD=true         # optional, register download_record_document (needs a Graph permission, see Downloading record documents)
DATAVERSE_DOCUMENT_MAX_BYTES=26214400     # optional, largest file download_record_document gets, in bytes (default 26214400 = 25 MiB, max 1 GiB)
DATAVERSE_DEFAULT_PAGE_SIZE=5000          # optional, rows per query_records page when the call names neither top nor page_size (default 5000; 50 on the HTTP server)
DATAVERSE_MAX_PAGE_SIZE=5000              # optional, largest top or page_size a query_records call may name (default 5000; 200 on the HTTP server; 1 to 5000)

The Graph requests of download_record_document use DATAVERSE_REQUEST_TIMEOUT_MS, DATAVERSE_MAX_ATTEMPTS and DATAVERSE_MAX_RETRY_WAIT_MS too. A file's download has no limit on its total time; it fails when no data arrives for DATAVERSE_REQUEST_TIMEOUT_MS. Only the stdio package reads DATAVERSE_DOCUMENTS_DOWNLOAD and DATAVERSE_DOCUMENT_MAX_BYTES; the HTTP server takes its limit from its config file.

DATAVERSE_REQUEST_TIMEOUT_MS bounds how long a tool call waits for Dataverse. Dataverse itself cancels any operation after 2 minutes, hence the maximum. Schema changes such as create_entity with many columns can take longer than the 30-second default. When that happens the tool reports a timeout, but Dataverse still finishes the change, so check before retrying, or raise the value.

query_records returns {"records": [...], "more": ..., "cursor": "..."}. A result longer than one page has "more": true and a cursor; the agent calls query_records again with the same entity_set and only that cursor to read the next page, until "more" is false. The cursor is signed, and one changed in any way is refused. The stdio package signs with a key it makes when it starts, so its cursors end with the process; the HTTP server signs with DATAVERSE_CURSOR_KEY, so its cursors survive a restart and work on every instance with the same key. The page size is the call's page_size, or DATAVERSE_DEFAULT_PAGE_SIZE. A call with top gets at most top records and no cursor: when exactly top come back, "more" is "unknown". top and page_size above DATAVERSE_MAX_PAGE_SIZE are refused, and so is a default page size above the maximum. Dataverse never returns more than 5000 rows per page (500 for elastic tables).

Service protection limits

Dataverse throttles each user with service protection limits and answers 429 Too Many Requests when one is reached. Parallel tool calls can reach them even from one machine. The server handles this in two ways, and the five variables that control it (DATAVERSE_MAX_CONCURRENCY to DATAVERSE_MAX_RETRY_WAIT_MS above) are optional:

  • It limits what it sends. At most DATAVERSE_MAX_CONCURRENCY requests are in flight; the rest wait in arrival order. A request is turned away with a "Dataverse is busy" error when DATAVERSE_MAX_QUEUE_LENGTH requests are already waiting, or when it has waited DATAVERSE_MAX_QUEUE_WAIT_MS without getting a slot.

  • It retries a 429. The server waits for as long as the Retry-After header says, then resends, up to DATAVERSE_MAX_ATTEMPTS sends in total. While it waits, no other request is sent either, because Dataverse extends the wait for a client that keeps sending. Other requests are held back for the wait Dataverse asked for, but never longer than DATAVERSE_MAX_RETRY_WAIT_MS: a Retry-After of several minutes fails the call that received it and does not stop the rest for that long. If the waits of one request would add up to more than DATAVERSE_MAX_RETRY_WAIT_MS, the tool call fails at once with an error that says in how many seconds to retry.

With the defaults, these limits add at most 25 seconds of waiting to one request: 10 in the queue and 15 on throttling. With one request at the default 30-second timeout that makes 55 seconds, inside the 60 seconds a client built on the MCP TypeScript SDK waits for an answer unless configured otherwise. That figure assumes a 429 arrives promptly, and it does not always: in a live test, heavy requests that hit the execution-time limit were answered with 429 only after 28 to 75 seconds. The bound that holds whatever happens is 115 seconds: the 25 seconds of waiting plus three sends that each take the whole request timeout. A request that slow is cut off by DATAVERSE_REQUEST_TIMEOUT_MS first and reported as a timeout, not retried. A tool that sends several requests can take that long for each of them. If you raise the waits or DATAVERSE_REQUEST_TIMEOUT_MS, raise the tool-call timeout of your MCP client to match.

The concurrency limit alone does not prevent throttling, since Dataverse also limits combined execution time. The defaults are deliberately conservative choices of this server, not values published by Microsoft. A value that is set but out of range is reported through dataverse_setup, like a missing variable.

Azure App Registration

  1. Register an app in Azure AD

  2. Add API permission: Dynamics CRM > user_impersonation (or Application permissions)

  3. Create a client secret

  4. Grant the app a security role in Dataverse (e.g. System Administrator for full access)

  5. Optional, for download_record_document: a Microsoft Graph application permission, read-only (see Downloading record documents)

Reading record documents from SharePoint

list_record_documents reads a record's files through Dataverse's sharepointdocument table, which is what the Documents tab of a model-driven app shows. It needs server-based SharePoint integration, set up so that the Documents tab already shows files to users, and document management enabled for the record's table. Outside the Documents tab, Dataverse reads SharePoint only after a one-time setup by an administrator, described in Microsoft's Configure Azure app for SharePoint access. Without it the tool fails with 0x800608b4 (SharePointAuthorizationFailure).

The setup gives Dataverse an Entra app of its own for SharePoint. That app has no secret: Dataverse gets its tokens through a federated credential. The app this server signs in with is not changed. Keep the two apps separate, so that this server's client secret does not also carry access to SharePoint.

  1. Register an app in Microsoft Entra ID for accounts in your directory only. Under API permissions, add SharePoint → Application permissions → Sites.FullControl.All, then Grant admin consent. Microsoft names Sites.Selected as the narrower option: it reaches only the SharePoint sites granted to the app, which here is the site that holds the document libraries. This server was tested with Sites.FullControl.All.

  2. Create two rows in Dataverse with the Web API, as a System Administrator (with the stdio package, create_record can send them):

    • in managedidentities: applicationid is the new app's client id, tenantid the directory (tenant) id, credentialsource is 2 and subjectscope is 1. Note the managedidentityid of the new row;

    • in sharepointmanagedidentities: uniquename is new_ppmiforsharepointauth, name is Managed Identity For SharePoint Auth, and ManagedIdentityId@odata.bind is /managedidentities(<managedidentityid>). Note the sharepointmanagedidentityid of the new row.

  3. Add a federated credential to the app: Certificates & secrets → Federated credentials → Add credential, scenario Other issuer, audience left at its default (api://AzureADTokenExchange):

    • issuer: https://login.microsoftonline.com/<tenant id>/v2.0;

    • subject identifier: /eid1/c/pub/t/<encoded tenant id>/a/<encoded app id>/Env/<environment id>/sharepointmanagedidentity/<sharepointmanagedidentityid>.

    Build the subject the way the article's PowerShell script does, which is the form that worked with this server; the article's text describes it differently. <encoded app id> encodes the fixed Power Platform app id 58e835ab-2e39-46a9-b797-accce6633447, not your app's client id. <environment id> is the Power Platform environment id, not the organization id: it is EnvironmentId in the answer of the RetrieveCurrentOrganization function, and also shown in the Power Platform admin center. An encoded id is the GUID's bytes in .NET order, in base64url without padding:

    node -e 'const b = Buffer.from(process.argv[1].replace(/-/g, ""), "hex");
      b.subarray(0, 4).reverse(); b.subarray(4, 6).reverse(); b.subarray(6, 8).reverse();
      console.log(b.toString("base64url"))' 58e835ab-2e39-46a9-b797-accce6633447
    # qzXoWDkuqUa3l6zM5mM0Rw

Then call list_record_documents for a record whose Documents tab shows files.

A limitation, until #202: with a folder structure based on Account or Contact in the document management settings, the folders of related records sit inside the folder of their account or contact. The list for such an account or contact then includes the files of those related records too, and the caller's access to them is not checked.

Downloading record documents

Dataverse keeps the documents of a record in SharePoint, and knows only where the record's folder is. download_record_document finds that folder from the record's document location in Dataverse, and gets the file through Microsoft Graph, with the same app registration. The agent names a file only by its path inside the folder (Contracts/offer.pdf), as list_record_documents returns it; it cannot name a site, a library, a URL or another folder. The file's content never appears in the tool's result or in a log:

  • stdio saves the file in the system's temporary folder, under dataverse-mcp-server/ (the folder is 0700, the file 0600), and returns its absolute path, size and MIME type. An existing file is never overwritten: the new one gets (1), (2), … before its extension. Compressed files are saved as they are. Move a file elsewhere if you need to keep it.

  • The HTTP server returns a resource_link. Reading it with resources/read checks the record and the file again and returns the file as one base64 blob, with progress notifications; nothing is written to disk. Claude.ai does not document support for following such a link from a tool result.

What is checked:

  • The record is read first, as the caller (with actAs, as that Dataverse user), and so are its document locations. Only the check for other records' folders nested in this one's reads locations as the application user: it only refuses, and read as the caller it would miss the locations the caller may not see. A caller who cannot read the record gets an error and no file. SharePoint's own permissions are not applied: the file is read with the app registration's Graph permission, so anyone who may read the record may read its files. The folder is the one the record's document location names, and in many orgs ordinary users may create and change document locations (Basic User often has Create and Write on them). Such a user can point a location of a record they may read at another folder of the same library, and then read its files. Check who holds those privileges before you grant the group to a token that acts on behalf of users.

  • A table without document management, a record with no folder or with more than one, and a location that is not a folder in a document library of a SharePoint site are errors that name the case. A record whose folder sits inside another record's, as with a folder structure based on Account or Contact, is such a location and is not supported.

  • A path into the folder of another record nested in this one's (an opportunity's folder inside its account's) is refused: reading the account says nothing of access to the opportunity.

  • A path with .., ., an empty segment, a backslash, a colon, a control character or an encoded separator is refused before any request, and an item Graph places outside the record's folder is never returned.

  • A file above the size limit (25 MiB by default) is refused before its content is read.

  • The server uses only GET on Graph: it has no way to upload, change or delete anything in SharePoint.

To enable it:

  1. Give the app registration a Graph application permission. Recommended: Sites.Selected with a read grant on the SharePoint site that holds the documents (the one in the Dataverse document management settings). Admin consent is needed for the permission. The grant itself is made with another credential, not this app's: one that holds Sites.FullControl.All (an administrative app, or an administrator signed in who is a member of the site), e.g. POST https://graph.microsoft.com/v1.0/sites/{site-id}/permissions with {"roles": ["read"], "grantedToIdentities": [{"application": {"id": "<client id>", "displayName": "<name>"}}]}. The broader alternative is Sites.Read.All, which reads every site of the tenant. Never grant write: the server needs none.

  2. stdio: set DATAVERSE_DOCUMENTS_DOWNLOAD=true, and optionally DATAVERSE_DOCUMENT_MAX_BYTES. The HTTP server: add documents-download to a role's groups, and optionally set the limit in the config file as "documents": { "maxBytes": 26214400 } (1 byte to 256 MiB; stdio allows up to 1 GiB, since it writes the file to disk as it arrives). The server holds a file in memory while it serves it: the file itself, then as base64 and in the response, about three times its size at the peak, for each read running at once. Keep the limit to what its memory allows. "maxBytesInFlight" in the same block bounds the bytes all reads running at once may hold, four times maxBytes by default (1 byte to 4 GiB, and not below maxBytes). A read holds its share from before the download until its response has been written out or the client went away, more if the file turns out longer than Graph reported; a read that does not fit is refused at once with a message to try again, not queued. The audit line of each read gives inFlightBytes, the budget taken when it started, and rssBytes, the process's memory once its result was ready, base64 included but before the response is serialized and written, so the two limits can be set from what an installation actually sees.

Build

npm install
npm run build

CI runs npm run check (lint, typecheck, tests with coverage, both builds); the pre-commit hook runs only npm run lint and npm run typecheck. CI also runs npm run knip, which fails on unused or unresolved code and dependencies and duplicate exports in src/ (Knip); tests and scripts are not checked. An export that only a test uses is tested through the public entry instead; a pure function tested case by case may keep its export, marked @internal with the reason. The pre-push hook scans the commits being pushed for environment hosts and tenant or client IDs with Betterleaks, if it is installed (brew install betterleaks, or the release binary); without it the push goes through with a warning and CI runs the scan. The same scan flags any GUID but a placeholder built from repeated digits (11111111-1111-1111-1111-111111111111), and the maintainer's private terms, read from private-terms in the git directory (git rev-parse --git-common-dir), one term or regex per line; without that file the terms are not checked before the push, only in CI. A git client that runs hooks with its own PATH may not find an installed Betterleaks; husky reads ~/.config/husky/init.sh, where PATH can be set.

A new git worktree gets dependencies of its own: the post-checkout hook runs npm ci in it. Without them, Node would take packages from the checkout that holds the worktree, so the tests and the pre-commit hook stop with "run npm ci" instead.

Claude Code configuration (local build)

If you cloned the repo instead of using npx:

{
  "mcpServers": {
    "dataverse": {
      "command": "node",
      "args": ["./dist/index.js"]
    }
  }
}

Create a .env file with your credentials (see .env.example).

Safety

Destructive operations are disabled by default to prevent accidental data loss. All four delete tools are gated behind the same DATAVERSE_ALLOW_DELETE=true flag:

  • delete_record — removes a row and all its data

  • delete_attribute — removes a column along with ALL values across every record (no recovery short of a full environment restore)

  • delete_picklist_option — removes an option from an OptionSet; records that hold the option's integer value are left with an orphan number (no label in UI, broken reports)

  • delete_entity_key — drops an alternate key and its supporting unique index; any keyed-PATCH upsert flows relying on it stop working

When the flag is off, each tool registers as a stub that returns an instructional error instead of performing the delete. To enable, add DATAVERSE_ALLOW_DELETE=true to your .env file and restart the MCP server.

License

MIT

Available Tools

26 tools
add_attributeA

Add one column to an existing table and return the new column's URL. A table that does not exist or a logical name that is taken is an error; get_entity_metadata shows both. To create a table together with its columns use create_entity, and to change a column later update_attribute. The column lands in the Default Solution; it is in your solution only if its table was added there with all its subcomponents, otherwise add it to the solution by hand.

Inputs: attribute (required), entity_logical_name (required).

add_entity_keyA

Create an alternate key on a Dataverse table (composite supported via key_attributes). Use for race-safe upserts via keyed-PATCH or to enforce a uniqueness constraint that the primary key doesn't cover. NOTE: Dataverse builds the supporting unique index asynchronously — the key is not usable for keyed lookups until its EntityKeyIndexStatus becomes 'Active'. Poll with list_entity_keys.

Inputs: display_name (required), logical_name (required), key_attributes (required), entity_logical_name (required), +1 more.

add_picklist_optionA

Add an option to an existing Local or Global OptionSet (Dataverse InsertOptionValue action). Requires Customizer or System Administrator role; HTTP 403 otherwise.

Inputs: label (required), value, description, language_code, +4 more.

aggregate_recordsA

Count, sum, average, or take the minimum or maximum of records of one table (entity set), optionally grouped by columns and by parts of a date, computed by Dataverse; only reads. Use it instead of reading records with query_records to count or add them up. Returns { rows: [...] }: one row per group, holding every group's and aggregate's as, ordered by order. A value that is missing is null: a group of rows where the column is empty, or an aggregate over no non-null values (count gives 0). A group by a lookup, a choice or a yes/no column also has _label, the record's name or the choice's label (null for the empty group). A date grouping gives a part of the date as a number, not a period: month is 1 to 12, week the week of the year, quarter the quarter of the fiscal year, day the day of the month; so month, quarter and week are refused unless the same column is also grouped by year, and day unless by year and month. Weeks are counted from 1 January, so the week around the new year is split into two groups, the last week of one year and week 1 of the next; for whole weeks, filter by dates. year is the calendar year: with a fiscal year that does not start on a calendar quarter, one year and quarter group can hold the ends of two fiscal quarters, so group by year and month instead. The parts are in the time zone of the user the call runs as, the one that user sees in Dynamics. Only rows that user may read are counted. Dataverse computes totals over at most 50,000 rows: a query that matches more is an error, to be narrowed by the filter, for example to a date range. One page of groups comes back, 5000 (500 on an elastic table): a query with more groups is an error, to be narrowed by the filter or by coarser groups. A Money column is summed as stored, in each record's currency: over records in several currencies, aggregate its _base instead, in the base currency, or group by transactioncurrencyid. countcolumn does not work on a Money column; use count with a not-null filter on it. An unknown entity set or column is an error.

Inputs: aggregates (required), entity_set (required), order, filter, +1 more.

create_entityA

Create a custom table with its primary name column and, optionally, additional columns; add_attribute adds columns later and create_record adds records. Returns the new table's URL; a name that is taken is an error. If a column fails, the error says which columns were created and how to add the rest. The table lands in the Default Solution, not in yours, so list_entities filtered by your solution, by default or by its solution field, does not show it.

Inputs: display_name (required), logical_name (required), display_collection_name (required), has_notes, +6 more.

create_recordA

Create a record in a table (entity set) from column values keyed by logical name; get_entity_metadata lists the columns and their types. Returns the new record's URL, which ends in its id, not the record itself. An unknown table or column, or a value already taken under an alternate key, is an error. Every call creates a new record, so a retry after an error that may have reached Dataverse can create a duplicate.

Inputs: data (required), entity_set (required).

create_relationshipA

Create a relationship between two tables. OneToMany adds a lookup column on related_entity that points to one primary_entity record; ManyToMany links records on both sides through an intersect table. Returns the relationship's URL; a schema_name that is taken is an error. This server has no tool to list or delete relationships.

Inputs: type (required), schema_name (required), primary_entity (required), related_entity (required), +2 more.

delete_attributeA

Delete a column from a table. This tool is disabled on this server: a call fails with a message on how to enable it. Setting DATAVERSE_ALLOW_DELETE=true and restarting the server turns it on.

Inputs: entity_logical_name (required), attribute_logical_name (required).

delete_entity_keyA

Delete an alternate key from a table. This tool is disabled on this server: a call fails with a message on how to enable it. Setting DATAVERSE_ALLOW_DELETE=true and restarting the server turns it on.

Inputs: key_logical_name (required), entity_logical_name (required).

delete_picklist_optionC

Remove an option from a Local or Global OptionSet. This tool is disabled on this server: a call fails with a message on how to enable it. Setting DATAVERSE_ALLOW_DELETE=true and restarting the server turns it on.

Inputs: value (required), option_set_name, entity_logical_name, solution_unique_name, +1 more.

delete_recordA

Delete a record from a table. This tool is disabled on this server: a call fails with a message on how to enable it. Setting DATAVERSE_ALLOW_DELETE=true and restarting the server turns it on.

Inputs: id (required), entity_set (required).

get_attribute_dependenciesA

List CRM components that reference a column — forms, views, workflows, business rules, plugins. Call this when delete_attribute fails with 0x8004f01f, or before any destructive change to a column. Component names are best-effort: resolved for common types, null otherwise. Backed by the Dataverse RetrieveDependenciesForDelete function.

Inputs: entity_logical_name (required), attribute_logical_name (required).

get_attribute_metadataA

Read the definition of one column, read-only, as the JSON Dataverse returns for its type (@odata.type), with every property of that type. Its limits come with it: MaxLength for String and Memo columns, the length a write is checked against (not DatabaseLength); MinValue and MaxValue for numbers, rounded to ±9223372036854776000 for BigInt; Precision, Format and the rest. Choice options are not included; read them with get_picklist_options, which also returns the status transitions of a Status column. A table or column that does not exist is an error. Use it before writing a value whose size the column may limit; get_entity_metadata lists all columns of a table.

Inputs: entity_logical_name (required), attribute_logical_name (required).

get_entity_metadataA

Get attributes (columns) of a specific Dataverse table. Choice-style columns (Choice, Status, State, MultiSelect) carry an option_set summary with is_global and option_count, so one dump shows which choice lists are shared org-wide. Read the option values per column with get_picklist_options. A table that does not exist is an error. For the length and other limits of one column, use get_attribute_metadata.

Inputs: entity_logical_name (required).

get_picklist_optionsA

Read a Local or Global OptionSet as { option_set: { name, is_global, metadata_id }, options: [{ value, label }] }. Use is_global to tell whether a column holds a local copy of the values or is bound to a shared Global OptionSet — matching values alone do not prove a binding. Works for Choice, Status, State and MultiSelect columns; a column or option set that does not exist is an error. get_entity_metadata shows which columns of a table are choices. A Status column (statuscode) also returns the table's status transition matrix: enforce_state_transitions next to options, and on each option state (the statecode value it belongs to) and transitions (the status reason values a record may move to from it). transitions [] means no move from that status reason is allowed. When enforce_state_transitions is false the matrix does not apply, whatever transitions holds: null, or a list the option still stores. To get one record's allowed transitions, read its statuscode with get_record, then take that option's transitions.

Inputs: option_set_name, entity_logical_name, attribute_logical_name.

get_recordA

Read one record by its GUID from a table (entity set), optionally only the select columns and the expand relations; returns the record as JSON. An id that is not a GUID is refused before the request; a record that does not exist is a 404 error from Dataverse. To find records by their values rather than by id, use query_records.

Inputs: id (required), entity_set (required), expand, select.

invoke_actionA

Invoke a Dataverse Web API action (POST) — bound or unbound. Use for operations that are not plain CRUD, e.g. PublishDuplicateRule (bound to a duplicaterule) or QualifyLead (bound to a lead), or UnpublishDuplicateRule (unbound, takes DuplicateRuleId). Whether an action is bound is defined in the Web API $metadata. Pass entity_set+id for bound actions, neither for unbound. parameters becomes the JSON request body.

Inputs: name (required), id, entity_set, parameters.

invoke_functionA

Invoke a Dataverse Web API function (GET) — bound or unbound. Use for read-only operations exposed as functions, e.g. WhoAmI (unbound) or RetrieveDuplicates. Pass entity_set+id for bound functions, neither for unbound. parameters are inlined into the URL as OData function arguments.

Inputs: name (required), id, entity_set, parameters.

list_entitiesA

List tables, read-only, as a JSON array of LogicalName, DisplayName, EntitySetName, Description and IsCustomEntity. The prefix and solution filters have server defaults (see each field); with no filter in effect, the list holds every table in the org and is very large. A solution that does not exist is an error. EntitySetName is the entity_set of the record tools; get_entity_metadata shows a table's columns.

Inputs: prefix, solution.

list_entity_keysA

List alternate keys defined on a Dataverse table. Returns a flat array of { logical_name, schema_name, display_name, key_attributes, entity_key_index_status, metadata_id }. entity_key_index_status reflects the background index build (Pending → Active, or Failed) — alt keys are not usable for keyed-PATCH upserts until Active.

Inputs: entity_logical_name (required).

list_record_documentsA

List the files in a record's SharePoint document folder, the ones its Documents tab shows, files in subfolders included; only reads. Returns { files: [{ name, path, file_type, size_bytes, modified_on, modified_by, url }], total }: at most 100 files, most recently modified first, where path is relative to the record's folder and url is the file's SharePoint address as Dataverse gives it; when the folder holds more files, a note says so, and total gives their number when Dataverse could count them all (up to 5000). A record without a document folder the caller can see gets a message saying so instead of a list. An unknown entity set, a table with document management off, a record that does not exist or that the caller may not read, and a missing one-time admin setup for reading SharePoint documents through the Dataverse API are errors. With a folder structure based on Account or Contact, the list for an account or contact also holds the files in the folders of its related records, and the caller's access to those records is not checked. It returns no file content: download_record_document, where it is enabled, gets a file by its path. To read the record itself, use get_record.

Inputs: id (required), entity_set (required).

list_solutionsA

List the visible solutions with solutionid, uniquename, friendlyname, version and ismanaged; unmanaged only unless include_managed is true. Read-only. A uniquename is the solution filter of list_entities.

Inputs: include_managed.

query_recordsA

Read records from a table (entity set) with optional OData select, filter, orderby and expand, and either page_size or top; returns a JSON object {records, more, cursor}. Records come one page at a time, page_size rows or 5000 when neither page_size nor top is given: while more is true, call query_records again with the same entity_set and only the returned cursor to get the next page; the last page has more false and no cursor. For stable pages, end orderby with a unique column such as the table's id. top caps the whole result and cannot be continued: when exactly top records come back more is "unknown", so do not count or sum over such a result; to count, sum or group records, use aggregate_records, which Dataverse computes without reading them. With one level of expand, an expanded collection is not paged and brings up to 5000 related rows per record; bound it with $top inside expand. With an expand nested in another, only $select and $filter are allowed inside expand, and without top every expanded collection is cut to the page size; its rest cannot be read through cursor. An unknown entity set, a bad OData expression, a bad cursor or a filter with too many conditions across relationships is an error; for a long list of ids use Microsoft.Dynamics.CRM.In(...) instead of an or chain. To read one record by its id, use get_record.

Inputs: entity_set (required), top, cursor, expand, +4 more.

update_attributeA

Update metadata of an existing column: display name, description, required level, max length, min/max value, precision. Dataverse fixes a column's type and logical name at creation — to change either, add_attribute a new column, migrate the values with update_record, then delete_attribute the old one.

Inputs: type (required), entity_logical_name (required), attribute_logical_name (required), required, +10 more.

update_picklist_optionA

Update an existing option's label/description on a Local or Global OptionSet (Dataverse UpdateOptionValue action). Requires Customizer or System Administrator role.

Inputs: label (required), value (required), description, merge_labels, +5 more.

update_recordA

Change the given columns of an existing record by its GUID; columns not in data keep their values. A record that does not exist is a 404 error: this tool never creates one (use create_record). Returns a confirmation text, not the record; read it back with get_record if needed. When a change of statuscode fails with 0x8004f00e ("does not have valid status code"), the table may forbid that transition: read the allowed ones in transitions of get_picklist_options on the statuscode column.

Inputs: id (required), data (required), entity_set (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 26 tools

    Disambiguation4/5

    Each tool targets a clearly bounded resource+action: entity metadata (get_entity_metadata), one column's type details (get_attribute_metadata), and choice values (get_picklist_options) are separated explicitly in their descriptions, as are query_records vs get_record and aggregate_records vs query_records. The only mild overlaps are the three metadata readers and invoke_action vs invoke_function, but the descriptions draw sharp boundaries (POST vs GET, table vs column vs option set).

    Naming Consistency5/5

    Every tool follows a strict snake_case verb_noun pattern (list_entities, get_record, create_record, update_attribute, delete_picklist_option, invoke_function), with consistent verb semantics across resources. No camelCase mixing, no vague verbs like 'process' or 'run'.

    Tool Count4/5

    The 26 tools cover genuinely distinct sub-domains (data CRUD, table/column metadata, option sets, alternate keys, relationships, solutions, documents, and generic Web API invocation), so most earn their place. It is slightly heavy and inflated by four tools that are disabled by default (delete_record, delete_attribute, delete_entity_key, delete_picklist_option), but the breadth justifies the size.

    Completeness3/5

    Record and column lifecycles are largely covered, but there are real gaps: create_entity exists with no update/delete table tool, create_relationship exists with no list/delete relationship tool (the description even admits this), and list_record_documents references a download_record_document tool that is not in the surface. Destructive operations also exist only behind a disabled-by-default flag, which agents will hit as dead ends.

    Maintenance

    ActivityActive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      C
      maintenance
      A minimal MCP server that gives AI coding agents clean read and write access to Microsoft Dataverse environments via the Dataverse Web API v9.2. It works as a drop-in alternative to Microsoft's own MCP server, without requiring Copilot Credits or managed environments.
      8
      21
      -
    • A
      license
      A
      quality
      C
      maintenance
      Model Context Protocol (MCP) server for Microsoft Dynamics 365 Business Central. Provides AI assistants with direct access to Business Central data through properly formatted API v2.0 calls.
      6
      10
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server for OData v4 endpoints, especially Microsoft Dataverse/Dynamics 365, enabling authentication, schema discovery, querying, CRUD, and more via natural language.
      MIT