mcpField
P
powerplatform mcp/cli

powerplatform mcp/cli

ローカル
github.com/michsob開発ツール446 週間前に更新

powerplatform mcp/cli について

PowerPlatform MCP / CLI は、PowerPlatform と Dataverse 環境を照会・設定するための MCP サーバー兼スタンドアロンのコマンドラインツールです。複数環境に対応しています。Power Platform の環境探索や設定の自動化を行う開発者や管理者向けです。

主な機能

  1. 01複数環境の設定と切り替え
  2. 02エンティティ、レコード、プラグイン、フロー、ソリューションの照会
  3. 03環境設定を自動化する書き込み操作
  4. 04CLI による結果のファイルシステムへのキャッシュ

活用シーン

  1. 01AI クライアントでの Dataverse エンティティとプラグインステップの探索
  2. 02大量の照会結果をディスクに出力して後続分析
  3. 03カスタム API、環境変数、セキュリティロールの作成自動化

MCP 対応

MCP サーバーとして、エンティティ、レコード、プラグイン、Power Automate フロー、ソリューション、セキュリティロールなどに関する約 67 のツールを AI クライアントに提供します。

設定

ローカルサーバーの設定はどのクライアントでも共通です。コピーしてクライアントの MCP 設定ファイルに貼り付けてください。

mcp.json · 共通設定
{
"mcpServers": {
"powerplatform": {
"command": "npx",
"args": [
"-y",
"powerplatform-mcp"
],
"env": {
"POWERPLATFORM_ENVIRONMENTS": "<POWERPLATFORM_ENVIRONMENTS>",
"POWERPLATFORM_DEV_URL": "<POWERPLATFORM_DEV_URL>",
"POWERPLATFORM_DEV_CLIENT_ID": "<POWERPLATFORM_DEV_CLIENT_ID>",
"POWERPLATFORM_DEV_CLIENT_SECRET": "<POWERPLATFORM_DEV_CLIENT_SECRET>",
"POWERPLATFORM_DEV_TENANT_ID": "<POWERPLATFORM_DEV_TENANT_ID>",
"POWERPLATFORM_UAT_URL": "<POWERPLATFORM_UAT_URL>",
"POWERPLATFORM_UAT_CLIENT_ID": "<POWERPLATFORM_UAT_CLIENT_ID>",
"POWERPLATFORM_UAT_CLIENT_SECRET": "<POWERPLATFORM_UAT_CLIENT_SECRET>",
"POWERPLATFORM_UAT_TENANT_ID": "<POWERPLATFORM_UAT_TENANT_ID>"
}
}
}
}
起動コマンドnpx -y powerplatform-mcp
設定が必要な環境変数
POWERPLATFORM_ENVIRONMENTS
POWERPLATFORM_DEV_URL
POWERPLATFORM_DEV_CLIENT_ID
POWERPLATFORM_DEV_CLIENT_SECRETシークレット
POWERPLATFORM_DEV_TENANT_ID
POWERPLATFORM_UAT_URL
POWERPLATFORM_UAT_CLIENT_ID
POWERPLATFORM_UAT_CLIENT_SECRETシークレット
POWERPLATFORM_UAT_TENANT_ID

ローカルサーバーにはマシン上の実行環境(Node.js 18 以上など)が必要です。設定ファイルの場所はクライアントごとに異なります。

パッケージ
npmpowerplatform-mcp

ツール

ツール一覧はまだ取得されていません

ローカルサーバーのツールはマシン上で起動して初めて取得できます。メンテナーはまだツール一覧を提供していません。

詳細

PowerPlatform MCP / CLI

PowerPlatform / Dataverse 環境を照会および構成するための Model Context Protocol(MCP)サーバーとスタンドアロン CLI です。複数の環境、エンティティのメタデータ、レコード、プラグイン、フロー、ソリューション、ワークフロー、ビジネスルール、セキュリティロール、カスタム API、Web リソースなどに対応し、自動化された環境セットアップのための書き込み操作も含まれます。

MCP + CLI を選ぶ理由

MCP は AI クライアント(Claude、Cursor、GitHub Copilot)と直接連携し、環境を対話形式で探索できます。

CLI は、結果をインラインで返す代わりにファイルシステムキャッシュに書き込みます。MCP ツールの応答は AI クライアントのコンテキストウィンドウによる制約を受けるため、数百ものエンティティ、フロー、プラグインステップを含む環境を照会する際に、結果が切り捨てられたり、品質が低下したりすることがあります。CLI は結果全体をディスクに保存することでこの制限を回避し、コンテキストへの負荷をかけずに、その後の分析で利用できるようにします。どちらのインターフェースも、同じツールと機能を共有しています。

インストール

Node.js 22+(25 未満)が必要です。

MCP サーバー
npm install -g powerplatform-mcp
# or
npx powerplatform-mcp
CLI
npm install -g powerplatform-cli
# or
npx powerplatform-cli
Docker
# MCP Server
docker pull ghcr.io/michsob/powerplatform-mcp
docker run --env-file .env ghcr.io/michsob/powerplatform-mcp

# CLI
docker pull ghcr.io/michsob/powerplatform-cli
docker run --env-file .env ghcr.io/michsob/powerplatform-cli entity-attributes account

構成

このツールは複数の環境に対応しています。環境変数を使って定義します。

POWERPLATFORM_ENVIRONMENTS=DEV,UAT,PROD

# For each environment, set:
POWERPLATFORM_DEV_URL=https://dev-org.crm.dynamics.com
POWERPLATFORM_DEV_CLIENT_ID=your-client-id
POWERPLATFORM_DEV_CLIENT_SECRET=your-client-secret
POWERPLATFORM_DEV_TENANT_ID=your-tenant-id

POWERPLATFORM_UAT_URL=https://uat-org.crm.dynamics.com
POWERPLATFORM_UAT_CLIENT_ID=...
POWERPLATFORM_UAT_CLIENT_SECRET=...
POWERPLATFORM_UAT_TENANT_ID=...

ローカルで開発する場合は、.env.example を .env にコピーし、認証情報を入力してください。

MCP サーバー

MCP サーバーは、AI を活用したクライアント(Claude、Cursor、GitHub Copilot)向けに設計されています。

利用可能な MCP ツール(67)

すべてのツールで、特定の環境を対象にするための environment パラメーターを任意で指定できます(既定では、最初に構成された環境が対象になります)。

エンティティ
ツール説明必須パラメーター任意
get-entity-metadataエンティティのメタデータを取得entityName
get-entity-attributesすべての属性/フィールドを一覧表示entityName
get-entity-attribute特定の属性を取得entityName、attributeName
get-entity-relationships1:N および N:N のリレーションシップを取得entityName
create-entity-string-attribute単一行テキスト列を作成entityName、schemaName、displayNamemaxLength、requiredLevel、description、solutionName
get-entity-keysエンティティの代替キーを一覧表示entityName
create-entity-alternate-key代替キーを作成entityName、schemaName、displayName、keyAttributessolutionName
レコード
ツール説明必須パラメーター任意
get-recordID でレコードを取得entityNamePlural、recordId
query-recordsOData クエリentityNamePlural、filtermaxRecords(既定値 50)
プラグイン
ツール説明必須パラメーター任意
get-plugin-assembliesプラグインアセンブリを一覧表示includeManaged、maxRecords
get-plugin-assembly-complete型、ステップ、イメージを含むアセンブリassemblyNameincludeDisabled
get-entity-plugin-pipelineエンティティで実行されるプラグインentityNamemessageFilter、includeDisabled
get-plugin-trace-logsプラグイントレースログentityName、messageName、correlationId、pluginStepId、exceptionOnly、hoursBack、maxRecords
get-all-plugin-stepsすべての SDK メッセージ処理ステップincludeDisabled、maxRecords
get-plugin-typeクラス名でプラグインの型を検索typeName
get-sdk-message名前で SDK メッセージを検索messageName
create-plugin-stepプラグインステップを登録name、pluginTypeId、sdkMessageId、stage、moderank、supportedDeployment、description、configuration、sdkMessageFilterId、solutionName
フロー(Power Automate)
ツール説明必須パラメーター任意
get-flowsクラウドフローを一覧表示します(スマートフィルタリング)activeOnly、maxRecords、nameContains、excludeSystem、excludeCustomerInsights、excludeCopilotSales
search-workflowsワークフローとフローを検索しますname、primaryEntity、description、category、statecode、includeDescription、maxResults
get-flow-definition完全な定義または解析済みの概要を取得しますflowIdsummary
get-flow-runsフローの実行履歴を取得しますflowIdstatus、startedAfter、startedBefore、maxRecords
get-flow-run-detailsアクションレベルのエラーを含む実行の詳細を取得しますflowId、runId
cancel-flow-run実行中または待機中の実行をキャンセルしますflowId、runId
resubmit-flow-run失敗した実行を再試行しますflowId、runId
scan-flow-health一括ヘルススキャンを実行します(成功率)daysBack、maxRunsPerFlow、maxFlows、activeOnly
get-flow-inventory軽量なフローインベントリを取得しますmaxRecords
ソリューション
ツール説明必須パラメーター任意
get-publishers読み取り専用ではない発行元を一覧表示します
get-solutions表示可能なソリューションを一覧表示します
get-solution一意の名前でソリューションを取得しますuniqueName
get-solution-componentsソリューション内のコンポーネントを一覧表示しますsolutionUniqueName
export-solutionソリューションをエクスポートします(base64)solutionNamemanaged
add-solution-componentソリューションにコンポーネントを追加しますsolutionUniqueName、componentId、componentTypeaddRequiredComponents
publish-customizationsエンティティまたはすべてのカスタマイズを公開しますentityLogicalName
ワークフロー(クラシック)
ツール説明必須パラメーター任意
get-workflowsクラシックワークフローを一覧表示しますactiveOnly、maxRecords
get-workflow-definitionXAML 定義または概要を取得しますworkflowIdsummary
get-ootb-workflowsバックグラウンド、BPF、アクション、オンデマンドを取得しますmaxRecords、categories
ビジネスルール
ツール説明必須パラメーター任意
get-business-rulesビジネスルールを一覧表示しますactiveOnly、maxRecords
get-business-ruleXAML を含むビジネスルールを取得しますworkflowId
オプションセット
ツール説明必須パラメーター
get-global-option-setグローバルオプションセットの定義を取得しますoptionSetName
構成
ツール説明必須パラメーター任意
get-connection-references接続参照を取得しますmaxRecords、managedOnly、hasConnection、inactive
get-environment-variables環境変数の定義と値を取得しますmaxRecords、managedOnly
create-environment-variable環境変数の定義を作成しますschemaName、displayName、typedefaultValue、description、solutionName
set-environment-variable-value環境変数の値を設定または更新しますdefinitionId、valueexistingValueId
カスタム API
ツール説明必須パラメーター任意
get-custom-apisカスタム API 定義の一覧を取得maxRecords, includeManaged
get-custom-api一意の名前でカスタム API を取得uniqueName
create-custom-apiカスタム API 定義を作成uniqueName, name, displayName, bindingType, isFunction, isPrivate, allowedCustomProcessingStepTypedescription, pluginTypeId, pluginTypeName, boundEntityLogicalName, solutionName
get-custom-api-response-propertiesレスポンスプロパティの一覧を取得customApiId
create-custom-api-response-propertyレスポンスプロパティを作成customApiId, uniqueName, name, displayName, typedescription, logicalEntityName, isOptional, solutionName
get-custom-api-request-parametersリクエストパラメーターの一覧を取得customApiId
create-custom-api-request-parameterリクエストパラメーターを作成customApiId, uniqueName, name, displayName, typedescription, logicalEntityName, isOptional, solutionName
Web リソース
ツール説明必須パラメーター任意
get-web-resourcesWeb リソースの一覧を取得maxRecords, webResourceType, nameFilter
get-web-resource名前で Web リソースを取得name
create-web-resource新しい Web リソースをアップロードname, displayName, webResourceType, contentdescription, solutionName
セキュリティロール
ツール説明必須パラメーター任意
get-security-rolesカスタマイズ可能なセキュリティロールの一覧を取得solutionUniqueName, excludeSystemRoles, includePrivileges, maxRecords
get-security-role-privilegesロールの特権(名前、accessright、深度マスク)roleIdentityFilter, accessRightFilter
list-privilegesシステム特権カタログを参照し、privilegeId GUID とサポートされている深度を確認entityFilter, accessRightFilter, maxRecords
create-security-role新しいロールを作成(既定ではルート BU)。solutionUniqueName を指定すると、1 回の操作でソリューションに追加namebusinessUnitId, description, solutionUniqueName
clone-security-role特権を含めてロールを複製。CloneAsRole を使用し、アクションが利用できない場合は作成後にコピーする方式にフォールバックsourceRoleIdnewName, targetBusinessUnitId, solutionUniqueName
update-security-roleロールの名前、説明、またはビジネスユニットを更新roleIdname, description, businessUnitId, solutionUniqueName
delete-security-roleロールを削除(破壊的操作 — confirm: true が必要)roleId, confirm
add-security-role-privilegesロールに特権を追加(AddPrivilegesRole — 既存の特権はそのまま保持)roleId, privileges[]
remove-security-role-privilegesロールから特権を削除(RemovePrivilegeRole を繰り返し実行)roleId, privilegeIds[]
replace-security-role-privileges特権一式を消去して置き換え(ReplacePrivilegesRole — 破壊的操作、confirm: true が必要)roleId, privileges[], confirm

privileges[] の各項目は { privilegeId, depth, businessUnitId? } です。深度は Basic(ユーザー)、Local(BU)、Deep(BU と子 BU)、Global(組織)のいずれかです。

依存関係
ツール説明必須パラメーター
check-component-dependencies削除を妨げる依存関係を確認componentId, componentType
check-delete-eligibilityコンポーネントを削除できるか確認componentId, componentType
サービスエンドポイント
ツール説明任意
get-service-endpointsService Bus、webhook、Event Hub、Event GridmaxRecords
MCP プロンプト
プロンプト説明必須引数
entity-overview主要な属性とリレーションを含むエンティティの概要entityName
attribute-details属性の詳細情報(型、形式、要件)entityName、attributeName
query-templateフィルターの例を含む OData クエリテンプレートentityName
relationship-map1:N および N:N リレーションの完全なマップentityName

CLI

MCP サーバーと同じツールを使用しますが、大規模なデータセットでも完全な出力を得られるよう、結果はファイルシステムにキャッシュされます。

グローバルオプション

--env <name> — 対象の環境(設定済みの最初の環境がデフォルトです)。

コマンド
エンティティ
entity-metadata <entityName>
entity-attributes <entityName>
entity-attribute <entityName> <attributeName>
entity-relationships <entityName>
entity-keys <entityName>
create-entity <schemaName> <displayName> <displayCollectionName>  [--primary-name-schema <name>] [--primary-name-display <name>] [--description <desc>] [--ownership <UserOwned|OrganizationOwned>] [--has-activities] [--has-notes] [--solution <name>]
create-entity-string-attribute <entityName> <schemaName> <displayName>  [--max-length <n>] [--required-level <level>] [--description <desc>] [--solution <name>]
create-entity-memo-attribute <entityName> <schemaName> <displayName>  [--max-length <n>] [--required-level <level>] [--description <desc>] [--solution <name>]
create-entity-file-attribute <entityName> <schemaName> <displayName>  [--max-size-kb <n>] [--required-level <level>] [--description <desc>] [--solution <name>]
create-entity-integer-attribute <entityName> <schemaName> <displayName>  [--min <n>] [--max <n>] [--required-level <level>] [--description <desc>] [--solution <name>]
create-entity-decimal-attribute <entityName> <schemaName> <displayName>  [--precision <n>] [--min <n>] [--max <n>] [--required-level <level>] [--description <desc>] [--solution <name>]
create-entity-money-attribute <entityName> <schemaName> <displayName>  [--precision-source <0|1|2>] [--precision <n>] [--min <n>] [--max <n>] [--required-level <level>] [--description <desc>] [--solution <name>]
create-entity-boolean-attribute <entityName> <schemaName> <displayName>  [--true-label <label>] [--false-label <label>] [--default-value <true|false>] [--required-level <level>] [--description <desc>] [--solution <name>]
create-entity-datetime-attribute <entityName> <schemaName> <displayName>  [--format <DateOnly|DateAndTime>] [--behavior <UserLocal|DateOnly|TimeZoneIndependent>] [--required-level <level>] [--description <desc>] [--solution <name>]
create-entity-picklist-attribute <entityName> <schemaName> <displayName>  [-o <value:label>]... [--required-level <level>] [--description <desc>] [--solution <name>]
create-entity-lookup <referencingEntity> <referencedEntity> <relationshipSchemaName> <lookupSchemaName> <displayName>  [--required-level <level>] [--description <desc>] [--cascade-delete <NoCascade|RemoveLink|Restrict|Cascade>] [--solution <name>]
create-entity-alternate-key <entityName> <schemaName> <displayName> <keyAttributes...>  [--solution <name>]
delete-entity-attribute <entityName> <attributeName>
レコード
record <entityNamePlural> <recordId>
query-records <entityNamePlural> <filter>  [--max <n>]
create-record <entityNamePlural> <jsonBody>
update-record <entityNamePlural> <recordId> <jsonBody>
delete-record <entityNamePlural> <recordId>
associate-records <entityNamePlural> <recordId> <navigationProperty> <relatedEntityNamePlural> <relatedRecordId>
disassociate-records <entityNamePlural> <recordId> <navigationProperty> [relatedRecordId]
プラグイン
plugin-assemblies                          [--include-managed] [--max <n>]
plugin-assembly <assemblyName>             [--include-disabled]
plugin-packages                            [--include-managed] [--max <n>]
plugin-type <typeName>
entity-pipeline <entityName>               [--message <msg>] [--include-disabled]
plugin-trace-logs                          [--entity <name>] [--message <msg>] [--correlation-id <id>] [--step-id <id>] [--hours <n>] [--max <n>] [--exceptions-only]
all-plugin-steps                           [--include-disabled] [--max <n>]
sdk-message <messageName>
register-plugin-package <filePath>         [--pkg-version <version>] [--solution <name>]
update-plugin-package <filePath>           --plugin-package-id <id> [--pkg-version <version>]
create-plugin-step <name> <pluginTypeId> <sdkMessageId>  [--stage <n>] [--mode <n>] [--rank <n>] [--supported-deployment <n>] [--description <desc>] [--configuration <cfg>] [--message-filter-id <id>] [--solution <name>]
create-plugin-step-image <stepId>          [--name <name>] [--entity-alias <alias>] [--image-type <0|1|2>] [--message-property-name <name>] [--attributes <csv>]
フロー
flows                                      [--active] [--name <contains>] [--include-managed] [--max <n>]
flow-definition <flowId>                   [--summary]
flow-inventory                             [--max <n>]
flow-runs <flowId>                         [--status <s>] [--after <iso>] [--before <iso>] [--max <n>]
flow-run-details <flowId> <runId>
flow-health                                [--days <n>] [--max-runs <n>] [--max-flows <n>] [--active]
search-workflows                           [--name <name>] [--entity <entity>] [--category <n>] [--active] [--max <n>]
create-cloud-flow <clientDataFile>         [--primary-entity <entity>] [--solution <name>]
activate-flow <flowId>
deactivate-flow <flowId>
ソリューション
solutions
solution <uniqueName>
solution-components <uniqueName>
publishers
add-solution-component <solutionUniqueName> <componentId> <componentType>  [--add-required]
publish-customizations                     [--entity <logicalName>]
ワークフロー
workflows                                  [--active] [--max <n>]
workflow-definition <workflowId>           [--summary]
ootb-workflows                             [--categories <0,1,2,3,4>]
ビジネスルール
business-rules                             [--active] [--max <n>]
business-rule <workflowId>
オプションセット
optionset <optionSetName>
依存関係
check-dependencies <componentId> <componentType>
構成
connection-references                      [--managed-only] [--has-connection] [--no-connection] [--inactive] [--max-records <n>]
create-connection-reference <logicalName> <displayName> <connectorId>  [--description <desc>] [--solution <name>]
environment-variables                      [--managed-only] [--max-records <n>]
create-environment-variable <schemaName> <displayName>  [--type <type>] [--default-value <val>] [--description <desc>] [--solution <name>]
set-environment-variable-value <definitionId> <value>   [--existing-value-id <id>]
カスタム API
custom-apis                                [--include-managed] [--max <n>]
custom-api <uniqueName>
create-custom-api <uniqueName> <displayName>  [--binding-type <n>] [--bound-entity <name>] [--is-function] [--is-private] [--processing-type <n>] [--plugin-type-id <id>] [--plugin-type-name <name>] [--description <desc>] [--solution <name>]
custom-api-response-properties <customApiId>
create-custom-api-response-property <customApiId> <uniqueName> <displayName>  [--type <n>] [--description <desc>] [--solution <name>]
custom-api-request-parameters <customApiId>
create-custom-api-request-parameter <customApiId> <uniqueName> <displayName>  [--type <n>] [--description <desc>] [--optional] [--solution <name>]
Web リソース
web-resources                              [--type <n>] [--name <contains>] [--max <n>]
web-resource <name>
create-web-resource <name> <displayName> <filePath>  [--type <n>] [--description <desc>] [--solution <name>]
set-entity-icon <entityName> <svgFilePath>  [--solution <name>] [--web-resource-name <name>] [--display-name <name>] [--no-publish]
フォームとビュー
entity-forms <entityName>                  [--type <n>]
entity-form-fields <formId>
add-form-field <entityName> <formId> <attributeName>
remove-form-field <entityName> <formId> <attributeName>
entity-views <entityName>
add-view-column <entityName> <viewId> <attributeName>   [--width <n>]
set-view-columns <entityName> <viewId> <columns...>     [--order-by <attr>] [--desc]
remove-view-column <entityName> <viewId> <attributeName>
PAC 統合
pac-auth                                   Authenticate pac CLI using environment credentials
generate-models <outdirectory>             [--settings <path>] [--entities <filter>] [--namespace <ns>]
deploy-plugin <pluginFile>                 --plugin-id <id> [--type <Nuget|Assembly>] [--configuration <config>]
セキュリティロール
security-roles                             [--solution <name>] [--include-system] [--include-privileges] [--max-records <n>]
security-role-privileges <roleId>          [--entity <name>] [--access-right <type>]
privileges                                 [--entity <name>] [--access-right <type>] [--max-records <n>]
create-security-role                       --name <name> [--bu <id>] [--description <desc>] [--solution <name>]
clone-security-role <sourceRoleId>         [--name <name>] [--target-bu <id>] [--solution <name>]
update-security-role <roleId>              [--name <name>] [--description <desc>] [--bu <id>] [--solution <name>]
delete-security-role <roleId>              --yes
add-role-privileges <roleId>               --privileges <spec>     # JSON array or shorthand <guid>:<Basic|Local|Deep|Global>,...
remove-role-privileges <roleId>            --privileges <id,id,id>
replace-role-privileges <roleId>           --privileges <spec> --yes
サービスエンドポイント
service-endpoints                          [--max <n>]

開発

git clone https://github.com/michsob/powerplatform-mcp.git
cd powerplatform-mcp
npm install
cp .env.example .env   # fill in credentials
npm run build
npm run inspector      # test with MCP Inspector

リリース

新しいバージョンを公開するには:

  1. package.json の version を更新します
  2. 変更を main にコミットします
  3. バージョンタグを作成してプッシュします:
    git tag v1.0.2
    git push origin v1.0.2
    

GitHub Actions により、次のパッケージが自動的に公開されます:

パッケージnpmGitHub PackagesDocker(GHCR)
MCP サーバーnpm i powerplatform-mcpnpm i @michsob/powerplatform-mcpghcr.io/michsob/powerplatform-mcp
CLInpm i powerplatform-clinpm i @michsob/powerplatform-clighcr.io/michsob/powerplatform-cli

npm での公開には Trusted Publishing (OIDC) を使用するため、トークンやシークレットは不要です。GitHub Packages と GHCR では、組み込みの GITHUB_TOKEN が自動的に使用されます。

ライセンス

MIT

PowerPlatform MCP サーバー

MseeP.ai Security Assessment Badge

コメント

MCP は初めてですか?

プロトコルの概要から最初のサーバーの導入まで、よくある疑問にまとめて答えます。

AI アプリケーションが外部のツールやデータソースに統一的な方法で接続するためのオープンなプロトコルです。クライアントはモデルとの対話を担い、MCP サーバーはツール・リソース・プロンプトテンプレートを提供します。標準メッセージでやり取りするため、1 つのサーバーを複数のクライアントで再利用できます。