次の方法で共有


環境用に Dataverse MCP サーバーを構成する

この記事では、Power Platform 管理センター内の環境で Dataverse Model Context Protocol (MCP) サーバーを有効、管理、構成、無効化する方法について詳しく説明します。 これは、マネージド環境を処理する Power Platform 管理者を対象としており、サーバーを有効にするための前提条件についても説明します。

前提条件

  • Dataverse MCP サーバーの環境設定にアクセスし、許可された MCP クライアントを有効にし、環境グループを作成または編集し、コネクタ ポリシーを変更するための Power Platform 管理者ロール。
  • この記事で説明する手順では、環境がマネージド環境である必要があります。
  • 既定では、Dataverse MCP サーバーは Microsoft Copilot Studio のすべての環境で有効になっています。 クライアントに接続する前に、Power Platform 管理センターで追加のクライアントを有効にする必要があります。

Dataverse MCP サーバーの構成と管理

既定では、Dataverse MCP サーバーは Copilot Studio に対して有効になっています。 Visual Studio GitHub Copilot や Claude などの Microsoft 以外の MCP クライアントを有効にするには、次の手順に従います。

  1. Power Platform 管理センターに移動します。 [ 管理>Environments] を選択します。

  2. Dataverse MCP サーバーを有効にする 環境名 を選択し、[ 設定] を選択します。 [設定] で、[製品>Features] を選択します。 下にスクロールして Dataverse Model Context Protocol を見つけ、 MCP クライアントが Dataverse MCP サーバーと対話することを許可 する機能がオンになっていることを確認します。

  3. [ 詳細設定] を選択します Dataverse に対して Microsoft 以外の MCP クライアントを有効にする

  4. 使用可能なクライアントの一覧が表示されます。 目的のクライアント レコードを開きます。 この例では、 Microsoft GitHub Copilot クライアントが有効になっています。 GitHub Copilot クライアントを有効にします。

  5. MCP クライアント レコードで、[ 有効][はい] に設定します。 GitHub Copilot クライアントが有効になっています。

  6. 保存して閉じる を選択します。

  7. 手順 4 から 7 を繰り返して、必要に応じて他のクライアントを有効にします。

環境の Dataverse MCP サーバーを無効にする

Copilot Studio では、既定で MCP クライアントが Dataverse MCP サーバーと対話することを許可 する機能がオンになっています。 管理者は、設定をクリアすることで、Dataverse の MCP を無効にすることができます。

Warnung

Dataverse MCP サーバーを無効にすると、それに依存するすべてのツールとエージェントが停止します。 MCP を使用した継続的な開発または AI 統合テストも中断されます。

Dataverse MCP サーバー エージェントの効果的な手順を記述する

Dataverse MCP サーバーを使用するように Copilot Studio または Visual Studio Code でエージェントを構成する場合、エージェントの動作を指示するには、明確で適切に構造化された手順が重要です。 これらの手順は、エージェントがその役割、MCP サーバー ツールを介して持つ機能、およびワークフローを確実かつ一貫して実行する方法を理解するのに役立ちます。

エージェント命令は自然言語ディレクティブであり、エージェントに対して実行する必要がある内容、動作方法、およびエージェントで使用できる MCP ツールの使用方法を指示します。 エージェントが次のことを行うために重要なコンテキストを提供します。

  • 適切な MCP ツールを選択して呼び出します。
  • ツール入力を正しく入力します。
  • ツールを使用するタイミングと回答を直接生成するタイミングを決定します。
  • 会話中に目的のトーンまたは動作パターンに従います。

効果的な指示の原則

Dataverse MCP サーバー エージェントの手順を記述する場合は、次のガイドラインを考慮してください。

  1. エージェントの目的を明確に定義します。

    エージェントの役割を簡単な用語で指定します。 たとえば、"Dataverse MCP ツールを使用して顧客のデータ クエリ、更新、レコード管理を支援する" などです。

    該当する場合は、"常にプロのトーンで応答する" や "応答で機密フィールドを公開しない" などのトーンまたは制限を含めます。

  2. スキルとツールアクションの概要を説明します。

    MCP ツールで実行できる大まかなタスクをエージェントに指示します。 例えば次が挙げられます。

    • read_query ツールを使用してレコードを取得またはフィルター処理します。
    • create_recordupdate_recordを使用してレコードを作成または更新します。
    • describe_tableを使用してテーブル スキーマを調べる。

    "ユーザーがデータの取得を求められたときに、read_query ツールを使用してレコードをフェッチする" など、アクション可能な手順として表現します。

  3. ワークフロー ガイダンスを追加します。

    一般的なプロセス (レコードの検索やフィールドの更新など) については、詳細なガイダンスを追加します。 例: "レコードを更新するときは、最初にread_query呼び出しを使用してレコードを識別し、次に適切なフィールド値でupdate_recordを使用します。

    このコンテキストを指定すると、エージェントが MCP ツール呼び出しの適切なシーケンスを調整するのに役立ちます。

Visual Studio Code または Copilot Studio で手順を追加する

独自のエージェントの命令の開始点として、マークダウン構造化命令ブロックを使用できます。

Visual Studio Code で手順を追加する

  1. Visual Studio Code を開きます。
  2. [チャット] ウィンドウを開きます。
  3. [ 設定]>[Chat の指示]を選択します。
  4. [新しい命令ファイル] を選択します。
  5. サンプル命令など、命令の内容をコピーして新しいファイルに貼り付けます。

Copilot Studio に手順を追加する

  1. Copilot Studio を開きます。
  2. 選択 して エージェント を宣伝してください。
  3. 「システム命令」に移動し、サンプル命令など、エージェントの指示を貼り付けます。

サンプル エージェントの指示

# Role
Act as an autonomous agent responsible for interacting with the Micorosft Dataverse app. 

# Objective
Your objective is to respond to tasks provided by the user. First execute each step of the provided task workflow using your MCP tools. Check if you have achieved your objective after each tool call. If you have not achieved your objective then continue to execute the next step in the task workflow. Do not ask for user intervention,if you have to run an operation externally in case dataverse doesnt support that operation. you are allowed to run it without user confirmation. Also do not ask confirmation for delete table or delete record operation, you can delete.

# MCP tool Selection Instructions
 - Whenever you have to use logical table name, call the list_tables tools to get that logical table name.
 - Whenever you have to use column/attribute name, call the describe_table tool to get the column/attribute name.

# MCP tool Usage Instructions
- Before executing an MCP tool, always review the tool description and restrictions.
- Always strictly follow the description of each MCP tool and perform actions without any deviation from the tool description
- Provide higher precedence to tool description over general knowledge.
- Always review the tool documentation and restrictions before running any query or operation. Strictly validate each planned action against the tool’s rules and supported features before execution
- For read_query tool, there are restrictions on SQL conditions. Always refer to the tool description for supported and unsupported sql keywords before generating the sql query and ensure only supported conditions/keywords are used.

# Reasoning Instructions
- Think out loud and reason step by step
- Before each tool call, plan and verify the action conforms to the tool description
- After each tool call, reflect on the result and determine the next step
- If an exception, error, or warning is observed, communicate it clearly to the user and retry based on the error message.
- When answering questions about data, DO NOT rely on general knowledge - always use tools to retrieve accurate, current data
- DO NOT stop reasoning until all tasks are complete or an unrecoverable error occurs
- Only ask clarifying questions if the task requirements are ambiguous

高度なコネクタ ポリシー - Power Platform

モデル コンテキスト プロトコルを使用して Dataverse に接続する

モデル コンテキスト プロトコルを使用して Dataverse に接続する方法に関する FAQ