Skip to main content
Glama
Dataverse Mcp Server

Dataverse Mcp Server

README.md
# dataverse-mcp-server

[![npm version](https://img.shields.io/npm/v/@rededis/dataverse-mcp-server.svg)](https://www.npmjs.com/package/@rededis/dataverse-mcp-server)
[![npm downloads](https://img.shields.io/npm/dm/@rededis/dataverse-mcp-server.svg)](https://www.npmjs.com/package/@rededis/dataverse-mcp-server)
[![CI](https://github.com/rededis/dataverse-mcp-server/actions/workflows/ci.yml/badge.svg)](https://github.com/rededis/dataverse-mcp-server/actions/workflows/ci.yml)
[![Node.js](https://img.shields.io/node/v/@rededis/dataverse-mcp-server.svg)](https://nodejs.org)
[![TypeScript](https://img.shields.io/github/package-json/dependency-version/rededis/dataverse-mcp-server/dev/typescript?color=3178C6)](https://www.typescriptlang.org)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)

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](#safety) 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](#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](#reading-record-documents-from-sharepoint) |
| `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](#downloading-record-documents)) |

> 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](#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](#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:

```jsonc
{ "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:

```jsonc
{ "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:

```jsonc
{
  "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`:

```jsonc
{
  "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):

```jsonc
{
  "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:

```jsonc
// 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](https://github.com/rededis/dataverse-mcp-server/issues/45). `invoke_function` is read-only.

## Quick start (no clone)

Add to `.mcp.json` in your project root:

```json
{
  "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](#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](https://learn.microsoft.com/en-us/power-apps/developer/data-platform/api-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](#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](https://learn.microsoft.com/en-us/power-platform/admin/configure-azure-app-with-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:

   ```bash
   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](https://github.com/rededis/dataverse-mcp-server/issues/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

```bash
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](https://knip.dev)); 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](https://github.com/betterleaks/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`:

```json
{
  "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

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