Skip to main content
Glama
BusinessNone

Dataverse Local MCP

by BusinessNone

Dataverse Local MCP

Claude(または任意のMCPクライアント)をMicrosoft Dataverse / Dynamics 365環境に接続し、データを平易な英語で操作できます。レコードのクエリ、保存済みビューの実行、テーブルと列の探索、行の作成と更新が可能です。

  • いつものようにサインイン — 自分のMicrosoft仕事用アカウントをブラウザで使用し、XrmToolBoxと同じ信頼できるサインインを利用します。すぐに使えます:アプリ登録、APIキー、管理者設定は不要です。

  • 2回目の呼び出しから高速 — 環境のスキーマと保存済みビューは事前取得されローカルにキャッシュされるため、メタデータの質問には即座に回答します。

  • 完全なツールボックス — ODataクエリ、FetchXML(集計と結合)、エンティティCRUD、メタデータ探索を1つのサーバーで提供します。

ガイド: セットアップ · ユーザーガイド

はじめに

1. Node.js 18以降をインストール していない場合。

2. サーバーをインストール します。npmインストールページから:

npm install -g dataverse-local-mcp

(またはインストールをスキップして、以下のコマンドとして npx -y dataverse-local-mcp を使用します。)

3. MCPクライアントに追加 — Claude Desktopの場合は、claude_desktop_config.jsonにこれを追加し、URLを自分の環境のものに置き換えます:

{
  "mcpServers": {
    "dataverse": {
      "command": "dataverse-local-mcp",
      "args": ["https://yourorg.crm.dynamics.com"]
    }
  }
}

4. 一度サインインします。 ツールが初めて実行されると、ブラウザでMicrosoftサインインが開きます。その環境の仕事用アカウントを選択してください。トークンは~/.dataverse-mcp/token-cache.jsonにキャッシュされるため、期限が切れるまで再度求められることはありません。ブラウザで誤ったアカウントでサインインした場合は、常にアカウントピッカーが表示されるので切り替えられます。

試してみる: MCPクライアントにwhoamiツールを実行するよう依頼します。DataverseのUserIdOrganizationIdが返されるはずです。次に「アカウントの保存済みビューを一覧表示」や「名前で上位5件のアカウントを表示」を試してください。

Related MCP server: Dataverse MCP Server

ツール

データ

Tool

説明

whoami

認証を確認:UserIdBusinessUnitIdOrganizationIdを返します

get

/api/data/v9.2/ を基準にした生のOData GET。例:accounts?$select=name&$top=5

fetch_xml

FetchXMLクエリを実行 — 集計、link-entity結合、複雑なフィルター。フォーマット済みの値を返します

create

レコードを作成 — デフォルトでプレビュー。ペイロードは最初にキャッシュされたメタデータに対して検証されます

update

IDまたは1行に一致するフィルターで1レコードを更新。デフォルトでオプティミスティック同時実行制御

delete

1レコードを削除 — プレビューは最初に現在の値を一覧表示します。永続的です

associate / disassociate

ナビゲーションプロパティを通じて2つのレコードを関連付ける、または関連付けを解除

invoke_action

バインドまたはアンバインドのアクションを実行(WinOpportunitySetState、Field Serviceの予約アクション)

invoke_function

バインドまたはアンバインドの関数を実行 — 副作用がないため、確認は不要です

list_saved_queries

システムおよび個人の保存済みビューを参照 — エンティティ、スコープ、名前の部分文字列でフィルタリング

get_saved_query

IDまたは名前で1つの保存済みビュー(FetchXMLを含む)を取得 — fetch_xmlで実行または適応

スキーマ

Tool

説明

list_tables

ローカルキャッシュからテーブルを一覧表示 — カスタム/標準、名前の断片、ソリューションでフィルタリング

describe_table

1つのテーブルを完全に表示:列、型、必須レベル、オプションセット、参照先、リレーションシップ、注釈、サンプリングされた入力率

find_column

キャッシュされた列を名前の断片または表示ラベルで検索。完全にキャッシュされたすべてのテーブルを横断

lookup_reference

標準テーブルに関するMicrosoft Learnドキュメント(Learn MCPがある場合はそちらに委譲)

refresh_metadata

キャッシュを再構築。オプションで名前付きテーブルにスコープ

注釈

Tool

説明

annotate

テーブルまたは列にローカルノートを記録。confirmedまたはinferredとしてマーク

remove_annotation

1つのターゲットのローカルノートを削除

export_annotations

注釈マークダウンを指定したパスに書き出す

import_annotations

マークダウンファイルをインポート — organizationIdが接続環境と一致しない限り拒否されます

check_drift

現在のスキーマに対してすべての注釈を解決:有効、変更、または孤立

promote_annotation

確認済みの注釈をDataverseの説明自体に書き込む — メーカーモードのみ

環境

Tool

説明

environment_info

キャッシュ状態:組織ID、モード、最終同期、テーブル数、サンプリング設定、ドリフト

set_environment_config

フレンドリ名、モード、標準の許可リスト、テーブル上限、行サンプリングを設定

set_storage

ドキュメントとメタデータキャッシュの保存場所を選択 — ローカル、git、Obsidian、OneDrive、Basic Memory、Notion、または任意のフォルダ

安全な書き込み

すべての変更ツールはデフォルトでプレビューします。confirm: trueなしで呼び出すと、何が変更されるかを正確に説明し(解決されたレコードをプライマリ名で指定)、何も呼び出しません。deleteはさらにレコードの現在のフィールド値を一覧表示するため、失われようとしているものを確認できます。

  • 一度に1レコード。 updatedeleteはIDまたはwhereフィルターを受け取り、複数のレコードに一致するものは候補を列挙して拒否され、一括処理はされません。

  • デフォルトでオプティミスティック同時実行制御。 更新と削除にはレコードのETagが含まれるため、読み取り後に変更されたレコードへの書き込みは、他人の作業を静かに上書きする代わりに失敗します。concurrency: falseを渡すとオプトアウトできます。

  • ペイロードは送信前にチェックされます。 不明な列、操作に無効な列、範囲外のオプションセット値、不明な@odata.bindナビゲーションプロパティはすべて、問題を特定するメッセージとともにローカルで失敗します。不透明なプラットフォーム400ではありません。

  • アクションは連鎖します。 Dataverseでの実際の作業の多くはテーブル書き込みではなくアクションを通じて行われ、その影響は呼び出しが示唆する以上に広がります。プレビューは呼び出しを示すだけで、その結果は示しません。結果は実行しないとわかりません。

エラーはDataverseの16進コードとメッセージを表示し、認識された形状(権限拒否、重複検出、ビジネスルールまたはプラグインの拒否、同時実行、不明な列)には平易な言葉の行が前置されます。認識されないものは推測せずにそのまま通過します。

リソース

環境の完全なOData $metadata(CSDL/EDMX)スキーマは、dataverse://metadataapplication/xml、多くの場合数MB)でMCPリソースとして公開されています。

キャッシュの仕組み

stdioハンドシェイクの直後に、サーバーはバックグラウンドでキャッシュを構築します。起動時にブラウザを開くことはありません。プリフェッチはサイレント認証のみを使用するため、キャッシュされたトークンがない場合は待機し、最初のツール呼び出しでサインインした後に再試行します。何もブロックしません。コールドスタートでも動作しますが、最初の呼び出しが遅くなるだけです。

すべてはOrganizationIdでキー付けされます。環境URLではなく、URLは変更されるが組織IDは変更されないためです:

~/.dataverse-mcp/
  token-cache.json
  environments/
    index.json                 # host -> organizationId, so a warm start needs no network
    <organizationId>/
      config.json              # url, friendly name, mode, storage, scope, sampling
      schema.json              # cached metadata          } these two follow
      schema.fingerprint       # hash for drift detection } your storage choice
      annotations.md           # your documentation       }
      metadata.xml             # the $metadata resource   } always local:
      saved-queries.json       #                          } large, derived, cheap to refetch

config.jsonindex.jsonは常にローカルに置かれます。これらはストレージ設定自体を保持するため、説明するバックエンド内に置くことはできません。

スコープ。 すべてのテーブルには安価な名前レベルの概要が用意されます。完全な列とリレーションシップの詳細は、すべてのカスタムテーブルと標準テーブルの許可リスト(デフォルトではField Serviceとコアの営業/サービス)に対してキャッシュされ、maxFullTablesで上限が設定されます。その他は遅延フェッチされ、ツールが初めて触れたときにマージされます。

行サンプリングはデフォルトでオフです。環境ごとに有効にすると、キャッシュは列ごとに入力率と最大20行から最大5つのサンプル値も記録します。説明が空白のテーブルにとって最も有用なシグナルです。実際のデータを読み取るため、オプトインのままであり、型や形式が個人データを示唆する列は、明示的に許可しない限りサンプリングされません。

注釈

Dataverseの説明は頻繁に空白です。環境自体の形状がほとんどの意味を担っており、残りは毎セッション再導出するのではなく蓄積する価値のある人間の知識です。注釈はenvironments/<organizationId>/annotations.mdのプレーンマークダウンに保存されます。人間が編集可能で、差分可能で、エンゲージメントリポジトリにチェックインしても安全です。

## rsm_cipscenariocandidate

Candidate records for capital improvement plan scenario modelling. Populated by
the scenario engine, not by users directly.

_author: ben.vollmer_ · _added: 2026-08-20_ · _confidence: confirmed_ · _provenance: human_

### rsm_scenariotype

Picklist. 1 = replacement, 2 = rehabilitation, 3 = deferral.

_author: ben.vollmer_ · _added: 2026-08-20_ · _confidence: inferred_ · _provenance: human_

各注釈には2つの独立したフィールドがあります。信頼度は、人間が述べた場合にのみconfirmedになります。モデルやツールが導き出したものはすべてinferredです。これこそが、注釈がデフォルトでDataverseの説明に書き戻されない理由です。来歴humanpreflightvelocitymodelのいずれかで、再スキャン時の上書き動作を決定します。作成者は自分の以前のノートを自由に置き換えることができ、人間は何でも置き換えますが、それ以外は上書きされません。再スキャンが人のノートと矛盾する場合、両方が保持され、人間が解決するようにフラグが立てられます。一方が黙って勝つことはありません。

ツールが作成したノートはブロッククォートとしてレンダリングされるため、一目で人から来たものとわかります:

### rsm_scenariotype

> No plugins are registered on this column.

_author: preflight_ · _added: 2026-08-20_ · _confidence: confirmed_ · _provenance: preflight_

共有。 export_annotationsはファイルを任意の場所に書き出します。import_annotationsはそれを読み戻します。フロントマターにはorganizationIdが含まれ、異なる組織へのインポートは拒否され、決してマージされません。両側が同じターゲットに異なるテキストで注釈を付けた場合、両方が保持され、フラグが立てられます。一方が黙って勝つことはありません。

ドリフト。 スキーマのフィンガープリントはキャッシュ時に取得されます。それが移動すると、各注釈はvalidchanged(型またはオプションセットがノートの下で移動)、またはorphaned(ターゲットが消えた)に解決されます。接続時に短い要約がログに記録され、具体的な警告はdescribe_table内でインラインで繰り返されます。自動的に削除されることはありません。

モード。 環境ごとに明示的に設定され、特権から推測されることはありません。特権は通常、意図よりも広いためです。consumer(デフォルト)は注釈をローカルに保ち、メタデータを書き込みません。makerはさらに、確認済みの注釈をDataverseの説明自体に昇格させることを許可します。

Dataverseへのドキュメントの昇格

環境のスキーマを所有している場合、確認済みの注釈は実際のDataverseの説明になります。これは意図的に面倒であり、利便性のために摩擦を減らすべきではありません。makerモード、confirmed注釈(推論は拒否されます)、未解決の競合がないこと、呼び出しごとに1つのターゲット、プレビューを読んだ後の明示的な確認が必要です。

The written text is prefixed with a [dataverse-mcp] marker plus provenance and date. That marker is the point — without it a promoted note becomes indistinguishable from a human-authored description six months later, and something that read as a reasonable guess starts reading as fact.

記述されたテキストには、[dataverse-mcp] マーカーと出典・日付が前置されます。そのマーカーこそが要点です。これがないと、プロモートされたメモは6か月後に人間が書いた説明と区別がつかなくなり、妥当な推測として読まれていたものが事実として読まれるようになります。

Promotion is a metadata write: it creates an unmanaged customization in the active solution layer, which can mask later updates to a managed component, and publishing may be required before the description appears in the UI. The preview says all of this before you confirm, and the tool cannot undo it.

プロモーションはメタデータの書き込みです。アクティブなソリューションレイヤーにアンマネージドのカスタマイズを作成するため、マネージドコンポーネントへの後続の更新を覆い隠す可能性があり、説明がUIに表示される前に公開が必要な場合があります。プレビューは確認前にこれらすべてを表示しますが、ツールはこれを元に戻すことはできません。

Where your documentation lives

ドキュメントの保存場所

By default everything sits under ~/.dataverse-mcp. Point it somewhere else with set_storage and both the annotations and the metadata cache follow — they always travel together, per environment.

デフォルトでは、すべてが ~/.dataverse-mcp の下に置かれます。set_storage で別の場所を指定すると、注釈メタデータキャッシュの両方が追従します。これらは常に環境ごとに一緒に移動します。

Kind

What it does

local

Default. Under ~/.dataverse-mcp/environments/<organizationId>/

git

A repo on disk. Every write is committed, so the documentation carries history and diffs; set autoPush to push each commit

obsidian

Markdown into your vault — defaults to ~/Obsidian, or give an explicit path

onedrive

Into the OneDrive sync folder — $OneDrive or ~/OneDrive

basic-memory

Into the Basic Memory notes directory — defaults to ~/basic-memory

directory

Any other folder you name

notion

The annotation document as a page under a parent page you choose

種類

機能

local

デフォルト。~/.dataverse-mcp/environments/<organizationId>/ の下

git

ディスク上のリポジトリ。すべての書き込みがコミットされるため、ドキュメントには履歴と差分が残ります。各コミットをプッシュするには autoPush を設定します

obsidian

ボールトへのMarkdown — デフォルトは ~/Obsidian、または明示的な path を指定可能

onedrive

OneDrive同期フォルダへ — $OneDrive または ~/OneDrive

basic-memory

Basic Memoryのノートディレクトリへ — デフォルトは ~/basic-memory

directory

指定した任意のフォルダ

notion

選択した親ページの下のページとして注釈ドキュメントを配置

The file-backed kinds are one implementation: an Obsidian vault, a OneDrive sync folder and a Basic Memory directory are all just folders, and git adds a commit step. Each environment gets its own subfolder (dataverse-mcp/<friendlyName>-<orgId prefix>) so a shared vault or repo can hold several without collision.

ファイルベースの種類は1つの実装です。Obsidianボールト、OneDrive同期フォルダ、Basic Memoryディレクトリはすべて単なるフォルダであり、gitはコミットステップを追加します。各環境には独自のサブフォルダ(dataverse-mcp/<friendlyName>-<orgId prefix>)が割り当てられるため、共有ボールトやリポジトリで複数の環境を衝突なく保持できます。

Notion needs an internal integration token in a NOTION_TOKEN environment variable — set it in your MCP client config, not in a file — and a notionPageId for the parent page, which must be shared with your integration. Each markdown line becomes one paragraph block, so the document round-trips exactly and stays readable and editable in Notion. Because Notion is a document store rather than a file store, the schema cache stays on local disk when Notion is selected; the annotations live in Notion.

Notion には、NOTION_TOKEN 環境変数での内部統合トークンが必要です。これはファイルではなくMCPクライアント設定で設定し、親ページ用の notionPageId も必要で、これは統合と共有されている必要があります。各Markdown行は1つの段落ブロックになるため、ドキュメントは正確に往復し、Notion内で読みやすく編集可能な状態を保ちます。Notionはファイルストアではなくドキュメントストアであるため、Notionを選択した場合、スキーマキャッシュはローカルディスクに残り、注釈はNotion内に置かれます。

Switching storage does not copy what you already have — run export_annotations first if you want to carry it across.

ストレージを切り替えても既存の内容はコピーされません。移行したい場合は、先に export_annotations を実行してください。

Upgrading from 0.3.x

0.3.x からのアップグレード

list_entities and describe_entity are replaced by list_tables and describe_table, which read the new cache and fold in annotations and drift warnings. The 0.3.x cache directory ~/.dataverse-mcp/cache/<host>/ is no longer read and can be deleted; the new cache rebuilds itself on first connect. Your token cache is untouched, so no new sign-in is needed.

list_entitiesdescribe_entitylist_tablesdescribe_table に置き換えられました。これらは新しいキャッシュを読み取り、注釈とドリフト警告を組み込みます。0.3.x のキャッシュディレクトリ ~/.dataverse-mcp/cache/<host>/ は読み取られなくなり、削除できます。新しいキャッシュは初回接続時に自動的に再構築されます。トークンキャッシュは変更されないため、新しいサインインは不要です。


Build Spec (for contributors)

ビルド仕様(コントリビューター向け)

Goal

目標

Build a standalone MCP server that talks directly to the Dataverse Web API. Going straight to the Web API keeps the server small and dependency-light, and lets it use the sign-in flow that works most broadly across machines and tenants — including tenants with strict Conditional Access policies. TypeScript, local Node host, no new app registration required.

Dataverse Web API と直接通信するスタンドアロンのMCPサーバーを構築します。Web API に直接アクセスすることで、サーバーを小さく依存関係も軽量に保ち、厳格な Conditional Access ポリシーを持つテナントを含め、マシンとテナント間で最も広く動作するサインインフローを使用できます。TypeScript、ローカルNodeホスト、新しいアプリ登録は不要です。

Why this auth approach

この認証方式を選ぶ理由

This server uses the same proven auth pattern as XrmToolBox and Microsoft's own XRM Tooling samples: a Microsoft-provided, pre-consented public client with a loopback redirect, driven as a standard MSAL auth-code-plus-PKCE flow. It's the ordinary browser sign-in your tenant already trusts — it runs on every OS, satisfies Conditional Access policies that stop device-code flows, and needs no OS-level broker. Anywhere XrmToolBox connects, this connects.

このサーバーは、XrmToolBox や Microsoft 自身の XRM Tooling サンプルと同じ実績のある認証パターンを使用します。ループバックリダイレクトを備えた Microsoft 提供の事前同意済みパブリッククライアントを、標準の MSAL 認証コード+PKCE フローとして駆動します。これはテナントがすでに信頼している通常のブラウザサインインであり、すべてのOSで動作し、デバイスコードフローを阻止する Conditional Access ポリシーも満たし、OSレベルのブローカーも不要です。XrmToolBox が接続できる場所なら、どこでも接続できます。

Client ID: 51f81489-12ee-4a9e-aaae-a2591f45987d
Redirect URI: http://localhost
Authority: https://login.microsoftonline.com/common
Scope: <environmentUrl>/.default
Client ID: 51f81489-12ee-4a9e-aaae-a2591f45987d
Redirect URI: http://localhost
Authority: https://login.microsoftonline.com/common
Scope: <environmentUrl>/.default

This is a Microsoft multi-tenant sample app with user_impersonation delegated permission, no admin consent required. If XrmToolBox already connects successfully in your tenant, this same client ID is proven to already clear Conditional Access there.

これは user_impersonation 委任権限を持つ Microsoft のマルチテナントサンプルアプリであり、管理者の同意は不要です。XrmToolBox がテナントで正常に接続できているなら、この同じクライアントIDはそのテナントで Conditional Access をすでに通過できることが実証されています。

Non-goals for v1

v1 の非目標

  • No custom Entra app registration (use the well-known client ID above)

  • No service principal / CI auth (interactive user auth only)

  • カスタム Entra アプリ登録なし(上記の既知のクライアントIDを使用)

  • サービスプリンシパル / CI 認証なし(対話型ユーザー認証のみ)

Repo layout

リポジトリ構成

packages/
  core/                    @dataverse-platform/core — shared library, private
    src/
      index.ts             public surface
      auth.ts              MSAL interactive + silent acquisition
      cache.ts             atomic read/write helpers
      paths.ts             ~/.dataverse-mcp layout
      environment.ts       per-environment config, OrganizationId resolution
      dataverseClient.ts   Web API calls
      writes.ts            preview/confirm, validation, single-record resolution
      promotion.ts         annotation -> Dataverse description, maker mode only
      errors.ts            Dataverse error translation
      store.ts             $metadata + saved-view warm cache
      metadata/            schema cache: types, fingerprint, build, sampling
      annotations/         markdown model, store, drift detection
      storage/             backends: directory/git presets, Notion
  mcp-server/              dataverse-local-mcp — published to npm
    src/
      server.ts            MCP wiring
      tools/               tool definitions and formatters
    build.mjs              esbuild bundle (inlines core)
    prepack.mjs            stages README/LICENSE for packing
package.json               npm workspaces root
tsconfig.base.json
packages/
  core/                    @dataverse-platform/core — shared library, private
    src/
      index.ts             public surface
      auth.ts              MSAL interactive + silent acquisition
      cache.ts             atomic read/write helpers
      paths.ts             ~/.dataverse-mcp layout
      environment.ts       per-environment config, OrganizationId resolution
      dataverseClient.ts   Web API calls
      writes.ts            preview/confirm, validation, single-record resolution
      promotion.ts         annotation -> Dataverse description, maker mode only
      errors.ts            Dataverse error translation
      store.ts             $metadata + saved-view warm cache
      metadata/            schema cache: types, fingerprint, build, sampling
      annotations/         markdown model, store, drift detection
      storage/             backends: directory/git presets, Notion
  mcp-server/              dataverse-local-mcp — published to npm
    src/
      server.ts            MCP wiring
      tools/               tool definitions and formatters
    build.mjs              esbuild bundle (inlines core)
    prepack.mjs            stages README/LICENSE for packing
package.json               npm workspaces root
tsconfig.base.json

The assessment tools (powerpreflight, velocity) join as further packages/*, calling core directly as a library rather than going through the MCP server.

評価ツール(powerpreflightvelocity)は追加の packages/* として参加し、MCPサーバーを経由せずにコアをライブラリとして直接呼び出します。

Dependencies

依存関係

npm install          # installs every workspace
npm run typecheck    # tsc -b across packages
npm run build        # core via tsc, mcp-server bundled via esbuild
npm run clean        # removes dist and tsbuildinfo
npm install          # installs every workspace
npm run typecheck    # tsc -b across packages
npm run build        # core via tsc, mcp-server bundled via esbuild
npm run clean        # removes dist and tsbuildinfo

Runtime dependencies are @azure/msal-node, @modelcontextprotocol/sdk and open. HTTP calls use Node's built-in global fetch (hence the Node ≥ 18 requirement) — no HTTP client dependency.

ランタイム依存関係は @azure/msal-node@modelcontextprotocol/sdkopen です。HTTP呼び出しはNodeの組み込みグローバル fetch を使用するため(Node ≥ 18 が必要)、HTTPクライアントの依存関係はありません。

Step 1 — Auth module (src/auth.ts)

ステップ1 — 認証モジュール(src/auth.ts

Acquire and cache a token using acquireTokenInteractive, which spins up its own loopback listener, no manual HTTP server needed.

acquireTokenInteractive を使用してトークンを取得・キャッシュします。これにより独自のループバックリスナーが起動するため、手動のHTTPサーバーは不要です。

  • Client ID 51f81489-12ee-4a9e-aaae-a2591f45987d, authority https://login.microsoftonline.com/common

  • Scope <environmentUrl>/.default

  • Token cache persisted to ~/.dataverse-mcp/token-cache.json

  • Silent acquisition from cache first, fall back to interactive (system browser opened via the open package; set DATAVERSE_MCP_NO_OPEN=1 to print the URL instead)

  • Interactive sign-in always shows the account picker (prompt: select_account) so browser SSO can't silently hand back the wrong account's token

  • Concurrent interactive sign-ins are deduped per environment — parallel requests share one browser window

  • A silentOnly mode backs the cache prefetch: it throws instead of opening a browser, so background work never interrupts client startup

  • クライアントID 51f81489-12ee-4a9e-aaae-a2591f45987d、機関 https://login.microsoftonline.com/common

  • スコープ <environmentUrl>/.default

  • トークンキャッシュは ~/.dataverse-mcp/token-cache.json に永続化

  • まずキャッシュからサイレント取得し、失敗したら対話型にフォールバック(open パッケージ経由でシステムブラウザを起動。DATAVERSE_MCP_NO_OPEN=1 を設定すると代わりにURLを表示)

  • 対話型サインインは常にアカウントピッカーを表示(prompt: select_account)するため、ブラウザのSSOが誤ったアカウントのトークンを静かに返すことはありません

  • 同時の対話型サインインは環境ごとに重複排除されます。並列リクエストは1つのブラウザウィンドウを共有します

  • silentOnly モードはキャッシュのプリフェッチを支えます。ブラウザを開く代わりに例外をスローするため、バックグラウンド処理がクライアントの起動を妨げることはありません

Step 2 — Dataverse Web API client (src/dataverseClient.ts)

ステップ2 — Dataverse Web API クライアント(src/dataverseClient.ts

Thin wrapper over the Dataverse Web API (/api/data/v9.2/) sending Authorization: Bearer, OData-MaxVersion: 4.0, OData-Version: 4.0 headers, retrying 429/503 on Retry-After so a bulk metadata build survives service protection limits. Covers whoAmI(), generic get(), record create/update/delete (PATCH sends If-Match: * so updates never silently upsert), FetchXML queries, saved views (savedquery + userquery, following @odata.nextLink), the raw $metadata EDMX, and metadata reads over EntityDefinitions.

Dataverse Web API(/api/data/v9.2/)の薄いラッパーで、Authorization: BearerOData-MaxVersion: 4.0OData-Version: 4.0 ヘッダーを送信し、Retry-After に基づいて 429/503 を再試行するため、一括メタデータビルドがサービス保護制限を乗り越えられます。whoAmI()、汎用 get()、レコードの作成・更新・削除(PATCHIf-Match: * を送信するため、更新が静かにアップサートされることはありません)、FetchXML クエリ、保存済みビュー(savedquery + userquery@odata.nextLink を追跡)、生の $metadata EDMX、および EntityDefinitions を介したメタデータ読み取りをカバーします。

Two Dataverse constraints shape the metadata calls: EntityDefinitions rejects $top and $orderby (it accepts $select and $filter), and DisplayName/Description/RequiredLevel come back as objects rather than scalars, so labels are extracted from UserLocalizedLabel.Label. Option sets need a cast — the client tries the EnumAttributeMetadata base cast (one call for picklist, state, status and multiselect) and falls back to the concrete casts where that isn't supported.

2つの Dataverse の制約がメタデータ呼び出しを形作ります。EntityDefinitions$top$orderby を拒否し($select$filter は受け入れます)、DisplayName/Description/RequiredLevel はスカラーではなくオブジェクトとして返されるため、ラベルは UserLocalizedLabel.Label から抽出されます。オプションセットにはキャストが必要です。クライアントは EnumAttributeMetadata ベースキャストを試し(ピックリスト、状態、ステータス、マルチセレクトの1回の呼び出し)、それがサポートされていない場合は具体的なキャストにフォールバックします。

Step 3 — MCP server entry (src/server.ts)

ステップ3 — MCP サーバーエントリ(src/server.ts

Registers the tools listed in the Tools section above plus the dataverse://metadata resource, and kicks off the background cache prefetch after the transport connects. Uses the standard @modelcontextprotocol/sdk Server class with stdio transport, matching how @microsoft/dataverse mcp itself runs. The environment URL is passed as the first CLI argument.

上記のツールセクションに記載されているツールに加えて dataverse://metadata リソースを登録し、トランスポート接続後にバックグラウンドのキャッシュプリフェッチを開始します。標準の @modelcontextprotocol/sdkServer クラスを stdio トランスポートで使用し、@microsoft/dataverse mcp 自体の実行方法と一致させます。環境URLは最初のCLI引数として渡されます。

Step 4 — First test

ステップ4 — 最初のテスト

npm run build
node dist/server.js https://yourorg.crm.dynamics.com
npm run build
node dist/server.js https://yourorg.crm.dynamics.com

Expected: system browser opens once for interactive sign-in, token caches to ~/.dataverse-mcp/token-cache.json, subsequent runs reuse the cached token silently. Confirm success by calling the whoami tool and checking the returned UserId/BusinessUnitId. After the first sign-in, the background prefetch fills ~/.dataverse-mcp/cache/<org-host>/ with metadata.xml, entities.json, and saved-queries.json; later launches serve metadata and saved-view tools from that cache.

期待される動作: 対話型サインインのためにシステムブラウザが1回開き、トークンが ~/.dataverse-mcp/token-cache.json にキャッシュされ、以降の実行ではキャッシュされたトークンがサイレントに再利用されます。whoami ツールを呼び出し、返された UserId/BusinessUnitId を確認して成功を確認します。最初のサインイン後、バックグラウンドのプリフェッチが ~/.dataverse-mcp/cache/<org-host>/metadata.xmlentities.jsonsaved-queries.json を格納します。以降の起動では、そのキャッシュからメタデータと保存済みビューのツールが提供されます。

Step 5 — Claude Desktop config

ステップ5 — Claude Desktop 設定

{
  "mcpServers": {
    "dataverse": {
      "command": "node",
      "args": ["/full/path/to/DataVerseLocalMCP/dist/server.js", "https://yourorg.crm.dynamics.com"]
    }
  }
}
{
  "mcpServers": {
    "dataverse": {
      "command": "node",
      "args": ["/full/path/to/DataVerseLocalMCP/dist/server.js", "https://yourorg.crm.dynamics.com"]
    }
  }
}
A
license - permissive license
Not graded
quality - not tested
A
maintenance

Maintenance

Maintainers
Response time
Release cycle
1Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables comprehensive management of Microsoft Dataverse environments, including schema operations for tables, columns, and relationships through the Dataverse Web API. It also supports solution management, security role configuration, and the generation of WebAPI calls and Mermaid ERD diagrams.
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables comprehensive schema and solution management for Microsoft Dataverse, including operations for tables, columns, relationships, and security roles via the Dataverse Web API. It also supports PowerPages configuration, automated WebAPI call generation, and schema visualization through Mermaid ERD diagrams.
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    Enables AI agents to query, inspect, and manage Microsoft Dataverse records, metadata, schema, forms, views, and Power Platform environments via the Dataverse OData Web API.
    97
    2
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents to perform CRUD operations, query data, fetch schemas, and execute custom operations on Microsoft Dynamics 365 CRM entities.
    52
    2
    MIT

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/BusinessNone/DataVerseLocalMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server