.NET で MCP サーバーからエージェントスキルを動的に発見・ロード
本文の状態
日本語全文を表示中
詳細モードで約11分の本文を読めます。
同じ出来事の情報源
この情報源を基点に整理
Microsoft Agent Framework
マイクロソフトは.NET 環境において、モデル・コンテキスト・プロトコル(MCP)サーバーからエージェントスキルを動的に発見・ロードする機能を Microsoft.Agents.AI.Mcp パッケージとして提供し始めた。
AI深層分析を開く2026年8月4日 16:59
AI深層分析
キーポイント
MCP サーバーによる動的スキル取得の実装
マイクロソフトは、アプリケーション内にスキルを梱包する従来の手法から脱却し、エージェントが MCP サーバーに接続して必要なスキルをオンデマンドで取得する仕組みを .NET で実装した。
中央集権的なガバナンスと一貫性の確保
プラットフォームチームやドメインチームがサーバー上で一度スキルを公開すれば、組織内の全エージェントが再デプロイなしで同一の最新バージョンを利用できるようになり、コンプライアンスやポリシーの一貫性が担保される。
2 つの配布フォーマットへの対応
サーバーは SKILL.md とリソースファイルを個別に提供する「skill-md」形式か、ZIP や TAR などのアーカイブ形式で提供し、フレームワークが両者を統一的なビルダー API で処理する。
プログレッシブ・ディスクロージャーパターンの維持
リモートから取得されるスキルもローカルスキルと同様に、エージェントはまずスキルの概要を認識し、タスクが一致した場合のみ完全な指示やリソースを読み込むという安全なパターンを維持する。
MCP スキル API は実験的である
MCP スキル API は実験的な状態であり、仕様が成熟するにつれて詳細が改訂される可能性がある。
重要な引用
Instead of shipping every skill inside your application or copying skill folders into each deployment, you point an agent at an MCP server and it pulls the skills it needs on demand.
A central team can publish skills once, and every agent across your organization picks them up without a redeploy.
The framework retrieves the referenced skill content through the authenticated MCP connection.
The MCP skills API is experimental and may change in future releases.
編集コメントを表示
編集コメント
エージェントのスキル配布における「開発者体験」と「企業ガバナンス」の両立を可能にする実用的な進展である。マイクロソフトは .NET エコシステム内で MCP の標準的な利用パターンを確立しようとしており、今後の業界標準への影響が注目される。
Source Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
エージェントは、Model Context Protocol (MCP) サーバーから直接スキルを発見してロードできるようになりました。アプリケーション内にすべてのスキルを同梱したり、デプロイごとにスキルフォルダをコピーしたりする必要はありません。エージェントを MCP サーバーに指し示すだけで、必要なスキルをその都度取得します。中央チームが一度スキルを公開すれば、組織内のあらゆるエージェントが再デプロイなしでそれを利用できます。この機能は、.NET において Microsoft.Agents.AI.Mcp パッケージを通じて今日から利用可能です。
開発者にとっては、これは配布の問題を解消するものです。スキルを一处で作成し、多数のエージェントに提供できます。企業リーダーにとって、ドメイン固有の専門知識(経費規定、コンプライアンスワークフロー、データ分析プレイブックなど)を中央で統制し、サーバー上でバージョン管理して、アプリケーションコードを変更せずに一貫して展開できるようになります。
MCP ベースのスキルとは何か
エージェントスキルは、プログレッシブ・ディスクロージャー(段階的開示)パターンを用いて、エージェントに専門的な機能を与えるポータブルなパッケージです。これは、各スキルの短い広告を最初に提示し、タスクが一致した場合のみ完全な指示とリソースを読み込むという仕組みです。
MCP ベースのスキルも同じパターンを採用していますが、スキルはローカルディスクやコード内ではなく、MCP サーバー上に存在します。サーバーは skill://index.json にあるディスカバリードキュメントを通じてスキルを広告し、フレームワークは認証された MCP 接続を介して参照されるスキルコンテンツを取得します。
.NET の実装では、サーバーがスキルを配布する方式として 2 つのモードをサポートしています。
skill-md:サーバーはスキルの SKILL.md ファイルと、それに関連する兄弟リソースを MCP リソースとして公開します。フレームワークは、エージェントがスキルを読み込み、そのリソースを取得する際に、必要に応じてファイルを一つずつフェッチします。
archive:スキルは単一のアーカイブ(ZIP、TAR、または gzip で圧縮された TAR)としてパッケージ化されます。フレームワークはこれをダウンロードし、制御されたディレクトリ内でローカルに展開して、抽出されたファイルを提供します。
どちらのタイプも同じビルダー API を通じて利用されるため、スキルのパッケージ化方法によってエージェント側のコードを変更する必要はありません。
なぜこれが重要なのか
一度作成すればどこでも活用可能。プラットフォームチームやドメインチームが MCP サーバーにスキルを公開するだけで、接続するあらゆるエージェントがそれを取得できます。各エージェントごとのパッケージ作成やフォルダのコピー、再ビルドは不要です。
エージェントの再デプロイなしで更新可能。サーバー側のスキルコンテンツに変更が生じれば、接続されているエージェントは次回スキルを検索した際に自動的に新バージョンを取得します。ポリシーやプレイブックの変更は、サーバー側で行うだけでよく、すべての下流アプリケーションを個別に更新する必要はありません。
多数のエージェント間での一貫性確保。同じソースから同じスキルがすべてのエージェントに提供されます。これは「各チームが経費規定の独自コピーを管理する」状態と、「単一の経費規定があり、全員がそれを利用する」状態との決定的な違いです。
リモートコンテンツへのガードレール。MCP を経由して取得されるスキルは、ローカルスキルと同様の段階的開示の原則に従い、アーカイブの展開やスクリプトの実行に対する明示的な制御が可能になります(後述)。
始め方
MCP ベースのスキルを利用するには、Microsoft.Agents.AI.Mcp NuGet パッケージが必要です。
dotnet add package Microsoft.Agents.AI.Mcp --prerelease
実験的 API
MCP スキル API は実験的な段階にあり、今後のリリースで変更される可能性があります。MCP スキルの仕様はまだ進化途中であり、仕様が成熟するにつれて詳細が改訂される見込みです。
スキルをホストする MCP サーバーにクライアントを接続し、AgentSkillsProviderBuilder の UseMcpSkills 拡張メソッドを使用して、これをソースとして追加します。
using Microsoft.Agents.AI;
using ModelContextProtocol.Client;
// スキルをホストする MCP サーバーに接続する
await using McpClient client = await McpClient.CreateAsync(
new StdioClientTransport(new()
{
Name = "skills-server",
Command = "dotnet",
Arguments = [skillsServerPath, "--server"],
}));
// MCP を介してスキルを検出するスキルプロバイダーを構築する
var skillsProvider = new AgentSkillsProviderBuilder()
.UseMcpSkills(client)
.Build();
このプロバイダーをエージェントのコンテキストプロバイダーに追加することで、フレームワークがサーバーのスキルをエージェントに公開します。これにより、エージェントはローカルスキルと同様に、必要なスキルを読み込んでロードできるようになります。
Azure.AI.OpenAI、Azure.Identity、OpenAI.Responses などの名前空間を読み込みます。
AIAgent agent = new AzureOpenAIClient(new Uri(endpoint), new DefaultAzureCredential())
.GetResponsesClient()
.AsAIAgent(new ChatClientAgentOptions
{
Name = "SkillsAgent",
ChatOptions = new()
{
Instructions = "You are a helpful assistant. Use available skills to answer the user.",
},
AIContextProviders = [skillsProvider],
},
model: deploymentName);
AgentResponse response = await agent.RunAsync(
"Summarize our expense reimbursement limits for international travel.");
Console.WriteLine(response.Text);
エージェントはシステムプロンプトで提示されたスキルを認識し、リクエストが一致した際に該当するコンテンツを読み込みます。skill-md スキルの場合は、エージェントがスキルを読み込む際にサーバーから SKILL.md を取得します。アーカイブスキルの場合は、サーバーからダウンロードしてローカルに展開したスキルアーカイブを使用します。どちらの場合も、参照されるリソースは必要に応じて読み込まれます。
ユースケース:多数のエージェント向けの中央集権型スキルサーバー
プラットフォームチームが会社の運用知識(経費規定、インシデント対応手順書、データ分類ガイドなど)を管理している状況を想定しましょう。これらは MCP サーバー上で skill-md スキルとしてホストされています。財務アシスタント、オンコールヘルパーボット、データガバナンスエージェントはすべて、上記の UseMcpSkills(client) コールを使用して同じサーバーに接続します。
3 つのエージェントはいずれもこれらのスキルをバンドルしていません。プラットフォームチームがサーバー上の経費ポリシーを更新すると、すべてのエージェントは次の検出時にその変更を反映します。これにより、チーム間の調整されたリリースを行うことなく、一貫した更新が可能になります。
UseMcpSkills はビルダーにソースを追加するため、同じプロバイダー内でローカルスキルと組み合わせて使用できます。エージェントは独自のファイルベースのスキルを持ちながら、サーバーから共有スキルも取得可能です:
var skillsProvider = new AgentSkillsProviderBuilder()
.UseFileSkill(Path.Combine(AppContext.BaseDirectory, "local-skills")) // team-owned, on disk
.UseMcpSkills(client) // shared, from the server
.Build();
これには Microsoft Foundry Toolbox も含まれます。組織が Foundry Skills API を通じてスキルを管理し、それをツールボックスに紐付けている場合、UseMcpSkills は他の MCP サーバーと同様に、そのツールボックスの MCP エンドポイントに接続します。Foundry でスキルの作成とバージョン管理を行い、.NET エージェントは追加の統合作業なしで MCP 経由でそれらを検出できます。
ユースケース:アーカイブ形式でスキルを配布し、安全に運用する
いくつかのスキルには、テンプレートや参照テーブル、チェックリストといった複数の関連ファイルが束ねられています。これらを単一のアーカイブエントリとして提供することで、サーバーはパッケージ全体を一度にダウンロードして配信できます。
ただし、アーカイブの展開はリモートコンテンツをローカルディスクに書き込む行為であるため、セキュリティ対策が必要です。想定以上にサイズが大きかったり、解凍時に急激に膨張したり、意図しない数のファイルを含んでいたりする可能性があります。制限を設けない場合、不正なアーカイブによって、エージェントを実行しているマシンのディスク容量、メモリ、CPU が枯渇する恐れがあります。
そのため、AgentMcpSkillsSourceOptions には、アーカイブが展開・提供される前に消費できる量を厳密に制限するためのオプションセットが用意されています。以下は、その設定例です。
using Microsoft.Agents.AI;
var skillsProvider = new AgentSkillsProviderBuilder()
.UseMcpSkills(client, new AgentMcpSkillsSourceOptions
{
ArchiveSkillsDirectory = Path.Combine(AppContext.BaseDirectory, "extracted-skills"),
ArchiveMaxFileCount = 50,
ArchiveMaxSizeBytes = 2 * 1024 * 1024, // ダウンロードサイズの上限を設定
ArchiveMaxUncompressedSizeBytes = 4 * 1024 * 1024, // 展開後の総サイズの上限を設定
})
.Build();
各オプションは、特定の種類の悪用を防ぐために設計されています。
ArchiveMaxSizeBytes は、ダウンロードされるアーカイブのサイズを制限し、過剰なペイロードから守ります。
ArchiveMaxUncompressedSizeBytes は、展開後の総サイズを制限します。これは、ネットワーク上では非常に小さくても、ディスク上でギガバイト単位に膨れ上がる「デコンプレッション・ボム」型のアーカイブから守るためのものです。
ArchiveMaxFileCount は、単一のアーカイブが保持できるファイル数の上限を定義し、過剰なファイル数を持つアーカイブからシステムを守る役割を果たします。
フレームワークはアーカイブをダウンロードし、これらの制限に照らして検証した上で、ArchiveSkillsDirectory 配下に展開します。その後、抽出された SKILL.md ファイルとリソースを提供します。いずれかの上限を超えたアーカイブは無視されるため、信頼できないサーバーがスキル配布機能を利用してホストを過負荷状態に陥らせることはできません。
リモートアーカイブコンテンツに対する信頼境界には、もう一つ重要なルールがあります。
アーカイブ内のスクリプトは決して実行されない
アーカイブ型スキルにバンドルされたスクリプトは一切実行されません。遠隔の MCP サーバーからダウンロードされる実行可能コンテンツは、設計上「信頼できないもの」として扱われます。フレームワークはスキルの指示とリソースのみを提供し、そのスクリプトを実行することはありません。
残りのスキルガバナンスモデルも引き続き適用されます。load_skill、read_skill_resource、run_skill_script といったスキルツールは、デフォルトで承認が必要となっており、エージェントが行動を起こす前に人間によるチェックポイント(ヒューマン・イン・ザ・ループ)を設けることができます。
なぜこれが重要なのか
MCP ベースのスキルにより、Agent Skills は埋め込むものから、配布するものへと進化しました。スキルは一度作成し、MCP サーバーにホストすれば、すべてのエージェントがオンデマンドでそれを発見できます。中央集権的に更新・管理され、skill-md リソースとして届く場合もパッケージ化されたアーカイブとして届く場合も、同じ方法で利用可能です。多数のエージェントを共通のドメイン知識に対して構築するチームにとって、これは「コピーを維持すること」と「単一のソースを維持すること」の違いです。
さらに詳しく知りたい場合は:
MCP ベースのスキルドキュメント
MCP ベースのスキルのサンプル
Microsoft Foundry におけるスキル
.NET 用エージェントスキルが正式リリースされました
.NET のエージェントスキル:3 つの作成方法と、それらを実行する単一のプロバイダー
原文を表示
Your agents can now discover and load Agent Skills directly from a Model Context Protocol (MCP) server. Instead of shipping every skill inside your application or copying skill folders into each deployment, you point an agent at an MCP server and it pulls the skills it needs on demand. A central team can publish skills once, and every agent across your organization picks them up without a redeploy. This is available today in .NET through the Microsoft.Agents.AI.Mcp package.
For makers, this removes a distribution problem: you author a skill in one place and serve it to many agents. For enterprise leaders, it means domain expertise – expense policies, compliance workflows, data-analysis playbooks – can be governed centrally, versioned on a server, and rolled out consistently without touching application code.
What MCP-based skills are
An Agent Skill is a portable package of instructions, resources, and scripts that gives an agent specialized capability using a progressive-disclosure pattern: the agent sees a short advertisement of each skill up front, then loads the full instructions and resources only when a task matches.
MCP-based skills apply that same pattern, but the skills live on an MCP server rather than on local disk or in code. The server advertises its skills through a discovery document at skill://index.json, and the framework retrieves the referenced skill content through the authenticated MCP connection.
The .NET implementation supports two ways a server can distribute a skill:
skill-md – The server exposes the skill’s SKILL.md and its sibling resources as MCP resources. The framework fetches them on demand, file by file, as the agent loads the skill and reads its resources.
archive – The skill is packaged as a single archive (ZIP, TAR, or gzip-compressed TAR). The framework downloads it, unpacks it locally under a controlled directory, and serves the extracted files.
Both types are consumed through the same builder API, so your agent code does not change based on how a skill is packaged.
Why this matters
Author once, serve everywhere. A platform or domain team publishes skills to an MCP server. Any agent that connects picks them up – no per-agent packaging, no copying folders, no rebuild.
Update without redeploying agents. When the server’s skill content changes, connected agents get the new version the next time they discover skills. Policies and playbooks evolve on the server, not in every downstream application.
Consistency across many agents. The same skill, from the same source, reaches every agent. That is the difference between “each team maintains its own copy of the expense policy” and “there is one expense policy, and everyone uses it.”
Guardrails for remote content. Skills that arrive over MCP keep the same progressive-disclosure discipline as local skills, with explicit controls for archive extraction and script execution (covered below).
Getting started
MCP-based skills require the Microsoft.Agents.AI.Mcp NuGet package:
dotnet add package Microsoft.Agents.AI.Mcp --prerelease
Experimental API
The MCP skills API is experimental and may change in future releases. The MCP skills specification is still evolving, and its details may be revised as the specification matures.
Connect an MCP client to the server that hosts your skills, then use the UseMcpSkills extension method on AgentSkillsProviderBuilder to add it as a source:
using Microsoft.Agents.AI;
using ModelContextProtocol.Client;
// Connect to the MCP server that hosts the skills
await using McpClient client = await McpClient.CreateAsync(
new StdioClientTransport(new()
{
Name = "skills-server",
Command = "dotnet",
Arguments = [skillsServerPath, "--server"],
}));
// Build a skills provider that discovers skills over MCP
var skillsProvider = new AgentSkillsProviderBuilder()
.UseMcpSkills(client)
.Build();
Add the provider to an agent through its context providers so the framework advertises the server’s skills to the agent, and the agent can load and read them as it would local skills:
using Azure.AI.OpenAI;
using Azure.Identity;
using OpenAI.Responses;
AIAgent agent = new AzureOpenAIClient(new Uri(endpoint), new DefaultAzureCredential())
.GetResponsesClient()
.AsAIAgent(new ChatClientAgentOptions
{
Name = "SkillsAgent",
ChatOptions = new()
{
Instructions = "You are a helpful assistant. Use available skills to answer the user.",
},
AIContextProviders = [skillsProvider],
},
model: deploymentName);
AgentResponse response = await agent.RunAsync(
"Summarize our expense reimbursement limits for international travel.");
Console.WriteLine(response.Text);
The agent sees the skill advertised in its system prompt and, when the request matches, loads the relevant content. For a skill-md skill, the framework fetches SKILL.md from the server when the agent loads the skill. For an archive skill, it uses the skill archive downloaded from the server and extracted locally. In both cases, referenced resources are read as needed.
Use case: a central skills server for many agents
Suppose a platform team owns the company’s operational knowledge – expense policy, incident-response runbooks, and a data-classification guide. They host these as skill-md skills on an MCP server. A finance assistant, an on-call helper bot, and a data-governance agent all connect to that same server with the same UseMcpSkills(client) call shown above.
None of the three agents bundles any of these skills. When the platform team updates the expense policy on the server, all three agents reflect the change on their next discovery – no coordinated release across teams.
Because UseMcpSkills adds a source to the builder, you can compose it with local skills in the same provider. An agent can carry its own file-based skills and also pull shared ones from the server:
var skillsProvider = new AgentSkillsProviderBuilder()
.UseFileSkill(Path.Combine(AppContext.BaseDirectory, "local-skills")) // team-owned, on disk
.UseMcpSkills(client) // shared, from the server
.Build();
This includes Microsoft Foundry Toolbox – if your organization manages skills through the Foundry Skills API and attaches them to a toolbox, UseMcpSkills connects to that toolbox’s MCP endpoint the same way it connects to any other MCP server. You author and version skills in Foundry, and your .NET agents discover them over MCP without additional integration work.
Use case: distributing a skill as an archive, safely
Some skills bundle several reference files – templates, lookup tables, checklists. Serving them as a single archive entry lets the server ship the whole package in one download. Because archive extraction writes remote content to local disk, it needs guardrails: an archive can be larger than expected, expand dramatically when decompressed, or contain more files than you intend to accept. Without bounds, a malformed or hostile archive could exhaust disk, memory, or CPU on the machine running the agent.
For that reason, AgentMcpSkillsSourceOptions exposes a set of options that let you bound exactly how much an archive is allowed to consume before it is extracted and served:
using Microsoft.Agents.AI;
var skillsProvider = new AgentSkillsProviderBuilder()
.UseMcpSkills(client, new AgentMcpSkillsSourceOptions
{
ArchiveSkillsDirectory = Path.Combine(AppContext.BaseDirectory, "extracted-skills"),
ArchiveMaxFileCount = 50,
ArchiveMaxSizeBytes = 2 * 1024 * 1024, // cap the download size
ArchiveMaxUncompressedSizeBytes = 4 * 1024 * 1024, // cap the total unpacked size
})
.Build();
Each option guards against a specific class of abuse:
ArchiveMaxSizeBytes caps the size of the archive that is downloaded, guarding against oversized payloads.
ArchiveMaxUncompressedSizeBytes caps the total unpacked size, guarding against decompression-bomb archives that are tiny on the wire but expand to gigabytes on disk.
ArchiveMaxFileCount caps how many files a single archive may contain, guarding against excessive-file-count archives.
The framework downloads the archive, validates it against these limits, unpacks it under ArchiveSkillsDirectory, and serves the extracted SKILL.md and resources. An archive that exceeds any of these bounds is skipped, so an untrusted server cannot use skill distribution as a way to overwhelm the host.
There is one more trust boundary around remote archive content:
Archive scripts are never executed
Scripts bundled in archive-type skills are never executed. Executable content downloaded from a remote MCP server is treated as untrusted by design – the framework serves the skill’s instructions and resources, but will not run its scripts.
The rest of the skills governance model still applies. Skill tools such as load_skill, read_skill_resource, and run_skill_script require approval by default, giving you a human-in-the-loop checkpoint before an agent acts.
Why this matters, restated
MCP-based skills turn Agent Skills into something you distribute rather than something you embed. Author a skill once, host it on an MCP server, and let every agent discover it on demand – updated centrally, governed centrally, and consumed the same way whether it arrives as skill-md resources or as a packaged archive. For teams building many agents against shared domain knowledge, that is the difference between maintaining copies and maintaining a source.
To go deeper:
MCP-based skills documentation
MCP-based skills sample
Skills in Microsoft Foundry
Agent Skills for .NET Is Now Released
Agent Skills in .NET: three ways to author, one provider to run them
The post Discover Agent Skills from MCP servers in .NET appeared first on Microsoft Agent Framework.
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み