MCPを活用し、本番環境に接続するAIエージェントの構築
AnthropicはClaude Blogにて、Model Context Protocol(MCP)を活用してAIエージェントを本番環境の既存システムに安全かつ効率的に接続・運用するための具体的な構築手順とベストプラクティスを公開した。
キーポイント
MCPのアーキテクチャと接続メカニズム
エージェントと外部データソース・ツールの間で標準化された通信プロトコルを定義し、複雑な統合作業を簡素化する仕組みを解説。
本番環境でのセキュリティと認証設計
実運用に必要な認可フロー、シークレット管理、監査ログの取得方法を具体例とともに提示し、セキュリティリスクを最小化する設計指針を示す。
エージェントの運用監視とスケーラビリティ
本番環境での高可用性確保、出力検証プロセス、および負荷増加に対応するスケーリング戦略についての実践的なガイドを提供。
影響分析・編集コメントを表示
影響分析
MCPの普及により、AIエージェントの開発・デプロイメントが標準化され、企業内の既存システムとの統合コストと技術的負債が大幅に削減される。これにより、実務レベルでのAI活用が加速し、業界全体のエージェントエコシステムが成熟する可能性が高い。
編集コメント
技術ブログでありながら実装手順まで網羅している点が高く評価できる。標準プロトコルの普及は、今後はエージェント開発のデファクトスタンダードとなる可能性を秘めている。
エージェントの有用性は、それらが到達できるシステムによって決まります。チームはこれらを外部システムに接続する際、一般的に3つのアプローチに収束します——直接API呼び出し、CLI(コマンドラインインターフェース)、MCP(モデルコンテキストプロトコル)です。本稿では、それぞれがどこに適合するか、なぜ本番環境のエージェントはMCPに落ち着きやすいか、そしてそれらの統合を構築する際のパターンについて解説します。
エージェントを外部システムに接続する
エージェントを外部システムに接続する際、一般的に3つの経路が見られます:直接API呼び出し、CLI(コマンドラインインターフェース)、MCP(モデルコンテキストプロトコル)です。それぞれがどこかで理にかなっており、それはあなたが構築するものによります。重要な区別は、エージェントとサービスの間に共通のレイヤーが存在するか、そしてそのレイヤーがどこまで及ぶかです。
直接API呼び出し
エージェントはあなたのAPIに直接呼び出しを行います——コード実行サンドボックス内でHTTPリクエストを発行するコードを記述するか、汎用の関数呼び出しツールを通じてです。これはほとんどのチームが最初に着手する箇所であり、1つのエージェントが1つのサービスと通信する場合や、エージェントプラットフォーム間で再利用する必要がない少数の統合においては問題なく動作します。
規模が大きくなると課題が顕著になります。エージェントとサービスの間に共通のレイヤーがない場合、各エージェント-サービスペアは独自の認証(auth)処理、ツール説明、エッジケースを持つ個別の統合となり——M×N統合問題が発生します。
コマンドラインインターフェース(CLI)
エージェントはシェル内でコマンドラインツールを実行します。これは高速で軽量であり、既存のツール群に依存しています。ローカル環境やサンドボックス化されたコンテナ——ファイルシステムとシェルが存在するあらゆる場所で非常に効果的です。これは共通のレイヤーを提供しますが、薄いです。CLIはコンテナを公開しないモバイル、Web、またはクラウドホスト型プラットフォームへの到達において厳しい制限にぶつかり、認証はCLI独自のメカニズム——通常はディスク上の資格情報ファイル——によって処理されます。これはローカル環境での迅速で寛容な統合に最も適しています。
モデルコンテキストプロトコル(MCP)
MCPはプロトコルとして共通のレイヤーを提供します。エージェントは、認証(auth)、検出、リッチなセマンティクスが標準化されたサーバーに接続し、あなたのシステムの機能を公開します。1つのリモートサーバーは、あらゆるデプロイメント環境において、互換性のあるすべてのクライアント(Claude、ChatGPT、Cursor、VS Codeなど)に到達します。
初期投資が少しだけ必要です。その見返りとして、統合はポータブルであり、機能豊富なエージェント統合に必要なセマンティクスを提供します。
本番環境のエージェントはクラウドで実行される
本番環境のエージェントはクラウドで実行されることが増えており、これによりスケーリングと継続的な運用が可能になります。それらが到達する必要があるシステムもクラウドホスト型です:データが保存され、作業が追跡され、インフラストラクチャが稼働する場所。これらのシステムは往々にしてリモートにあり、認証(auth)の背後にあるため、MCPが共通のレイヤーを提供します。
すでに採用動向においてこれが見られます。MCP SDKの月間ダウンロード数は最近3億回を超え、年初の1億回から増加しており、企業や人気のあるエージェントプラットフォーム全体で強力な採用が進んでいます。毎日何百万人もの人がClaudeとMCPを使用しており、このプロトコルは最近リリースした機能の基盤を支えています。これにはClaude Cowork、Claude Managed Agents、およびClaude Code内のチャンネルが含まれます。
MCPが本番環境のエージェントシステムをサポートし続ける中で、これらの統合を適切に構築するパターンを共有します:高度なサーバーの構築からコンテキスト効率の高いクライアント、そしてスキルがプロトコルを補完する箇所まで。
効果的なMCPサーバーの構築
当社のディレクトリには200以上のMCPサーバーがあり、毎日何百万人もの人に使用されています。プロトコル上で構築する企業や開発者と密接に連携してきた経験から、エージェントがサーバーをどれだけ確実に使用できるかを決定するいくつかの設計パターンを見出しました。
最大限の到達性を重視してリモートサーバーを構築する
リモートサーバーが配布性を可能にします——これはWeb、モバイル、クラウドホスト型エージェントのすべてで動作する唯一の設定であり、主要なクライアントが消費するために最適化されているのもこれです。エージェントがどこで実行されてもあなたのシステムを利用できるように、リモートサーバーを構築してください。
エンドポイントではなく意図を中心にツールをグループ化する
少数で明確に記述されたツールは、網羅的なAPIの鏡像を一貫して上回ります。あなたのAPIをMCPサーバーに1対1でラップしないでください——意図を中心にツールをグループ化し、エージェントが複数のプリミティブを組み立てるのではなく、数回の呼び出しでタスクを完了できるようにしてください。create_issue_from_threadツール1つが、get_thread + parse_messages + create_issue + link_attachmentよりも優れています。完全なパターンについては、エージェント向けの効果的なツールの作成をご覧ください。
サーフェスが広大な場合はコードオーケストレーションを設計する
Cloudflare、AWS、Kubernetesのように、あなたのサービスが数百の異なる操作を必要とする場合、意図ベースのツールセットではおそらくカバーできません。その代わりに、コードを受け付ける薄いツールのサーフェスを公開してください:エージェントが短いスクリプトを記述し、あなたのサーバーがそれをサンドボックス内でAPIに対して実行し、結果のみが返されます。CloudflareのMCPサーバーが参考例です——2つのツール(検索と実行)で、約1Kトークンにおいて~2,500のエンドポイントをカバーします。
役立つ箇所でリッチなセマンティクスを提供する
MCP Appsは最初の公式プロトコル拡張機能であり、チャート、フォーム、ダッシュボードなどのインタラクティブなインターフェースをツールが返せるようにします。これらはすべてチャットインターフェース内でインラインレンダリングされます。MCPアプリを提供するサーバーは、テキストのみを返すサーバーと比較して、有意に高い採用率とリテンションを示す傾向があります。重要な瞬間にエージェントやエンドユーザーの前にあなたのプロダクトのUIを配置するために使用してください——この拡張機能はClaude.ai、Claude Cowork、および他の主要なAIツールでサポートされています。
エリシテーション(Elicitation)機能により、サーバーはツール呼び出しの途中で一時停止し、ユーザーに入力を求めることができます。フォームモード(Form mode)は単純なスキーマを送信し、クライアントがネイティブフォームをレンダリングします——欠落したパラメータの要求、破壊的なアクションの確認、オプションの曖昧さの解消に使用してください。URLモード(URL mode)はユーザーをブラウザに渡します——ダウンストリームのOAuth完了、決済の処理、またはMCPクライアントを通過すべきではない資格情報の収集に使用してください。どちらもユーザーを設定ページへ遷移させるのではなく、フロー内に留めます。フォームモードは広くサポートされており、URLモードはClaude Codeでサポートされており、他のクライアントも開発中です。
標準化された認証(auth)に依存する
標準化された認証(auth)は、クラウドホスト型エージェントにとってMCPを実用的にします。あなたのサーバーがOAuthを必要とする場合、最新のMCP仕様はクライアント登録のためにCIMD(Client ID Metadata Documents)をサポートしています——これによりユーザーには高速な初回認証フローが提供され、予期しない再認証プロンプトが大幅に減少します。これが当社の推奨する認証アプローチであり、この機能はMCP SDK、Claude.ai、およびClaude Codeでサポートされており、業界全体で広く採用されつつあります。
ユーザーが認証を完了した後、次の課題はクラウドホスト型エージェントがランタイム時にそれらのトークンをどのように保持し再利用するかです。Claude Managed AgentsのVaults(機密情報保管庫)がこれをカバーします:ユーザーのOAuthトークンを1回登録し、セッション作成時にIDで保管庫を参照すると、プラットフォームが各MCP接続に適切な資格情報を注入し、あなたの代わりにトークンを更新します——構築する秘密のストアも、呼び出しごとに渡すトークンも不要です。
MCPクライアントのコンテキスト効率を高める
MCPは、AIエージェント(クライアント)が必要とするツールやデータソース(サーバー)に接続し、連携する方法を標準化します。サーバーは安全な範囲の機能を公開し、クライアントはそれらをオーケストレーションしてコンテキストを管理します。MCPクライアントを構築している場合、段階的開示(progressive disclosure)のパターンを用いてコンテキスト効率を高めましょう。
ツール検索でオンデマンドにツール定義を読み込む
ツール検索は、事前にすべてのツールをコンテキストに読み込むのではなく、読み込みを遅延させます。これにより、エージェントはランタイム時にカタログを検索し、必要に応じて関連するツールを引き込むことができます。当社のテストでは、ツール検索は高い選択精度を維持しつつ、ツール定義のトークンを85%以上削減する傾向があります。
ツール検索によるコンテキスト使用量の削減。出典:高度なツールの使用
プログラムmaticツール呼び出しでコード内でツール結果を処理する
プログラマティックツール呼び出しは、結果をモデルに生で返すのではなく、コード実行サンドボックス内で処理します。これにより、エージェントはコード内で呼び出しをループ、フィルタリング、集計でき、最終出力のみがコンテキストに到達します。当社のテストでは、これは複雑なマルチステップワークフローにおいてトークン使用量を約37%削減します。
これらのパターンを組み合わせると、複数のサーバー間で自然に構成されます:より軽量なコンテキスト、少ない往復通信、高速なレスポンスです。詳細については高度なツールの使用をご覧ください。
MCPサーバーとスキルの組み合わせ
スキルとMCPは補完関係にあります。MCPはエージェントに外部システムからのツールやデータへのアクセスを提供し、スキルはエージェントにそれらのツールを使用して実際の作業を完了する方法に関する手続き型知識を教えます。最も能力の高いエージェントは両方を使用し、スキルによりMCPサーバーは限られた接続の数を超えてスケーリング可能になります。これらを組み合わせる一般的なパターンが2つあります:
スキルとMCPサーバーをプラグインとしてバンドルする
Claude用のプラグインは、開発者がスキル、MCPサーバー、フック、LSPサーバー(言語サーバープロトコル)、および専門的なサブエージェントを1つの簡単に消費できる配布方法にバンドルすることを可能にする有用な抽象化です。このアプローチを使用することは、最小限の摩擦で複数のコンテキストプロバイダーを統合する最善の方法です。MCPサーバーとスキルを組み合わせることで、Claudeはよりドメインスペシャリストのように行動できます。MCP経由でツールを取得し、ワークフローをエンドツーエンドでオーケストレーションするスキルをClaudeに与えてください。Snowflake、Databricks、BigQuery、Hexなどのアプリ向けに10のスキルと8つのMCPサーバーで構成されるCowork向けのデータプラグインを例としてご覧ください。
スキルとMCPの組み合わせ。出典:スキルとMCPサーバーによるClaudeの機能拡張
MCPサーバーからスキルを配布する
プロバイダーがMCPサーバーとともにスキルを公開するケースが増えています。これにより、エージェントは生の機能と、それらを効果的に使用するための確立されたプレイブックの両方を取得します。Canva、Notion、Sentryなどは現在Claudeでこれを行っており、当社のWebディレクトリでコネクターの隣にスキルをリストしています。
その組み合わせをすべてのクライアント間でポータブルにするため、MCPコミュニティはサーバーから直接スキルを提供する拡張機能の開発に積極的に取り組んでいます。これにより、クライアントは関連する専門知識を自動的に継承し、依存するAPIとバージョン管理されます。拡張機能が安定化するにつれて、このパターンは広く採用されると予想しています。
複合レイヤー
冒頭で、エージェントを外部システムに接続する3つの経路について述べました。実際には、成熟した統合はこれらすべてを提供します:基盤としてのAPI、ローカルファースト環境向けのCLI、クラウドベースのエージェント向けのMCPです。
本番環境のエージェントがクラウドへ移行するにつれ、MCPは重要なレイヤーとなり、それが複合効果を生みます。今日、リモートサーバーはあらゆるデプロイメント環境において互換性のあるすべてのクライアントに到達し、認証(auth)、インタラクティブ性、リッチなセマンティクスはプロトコルによって処理されます。より多くのクライアントが仕様を採用し、より多くの拡張機能が実装されるにつれて、同じサーバーは新しいものを提供することなくより高度な能力を獲得します。
統合を構築する際、クラウド内の本番環境エージェントがあなたのシステムに到達することを目標としているなら、MCPサーバーを構築し、上記のパターンを用いてそれを優れたものにしてください。MCP上に構築されたすべての統合はエコシステムを強化します:一人で解決する必要があるエッジケースが減り、維持する必要がある個別の統合も減ります。
謝辞
Den Delimarsky、David Soria Parra、Henry Shi、Felix Rieseberg、Conor Kelly、Molly Vorwerck、Andy Schumeister、Kevin Garcia、Amie Rotherham、Matt Samuels、Angela Jiang、Katelyn Lesse、AJ Rebeiro、Jess Yanの各氏に、本ブログへの貢献に対し感謝申し上げます。
原文を表示
Agents are only as useful as the systems they can reach. Teams tend to converge on three approaches for connecting them to external systems—direct API calls, CLIs, and MCP. This post lays out where each fits, why production agents tend to land on MCP, and the patterns for building those integrations effectively.Connecting agents to external systemsWe generally see three paths for connecting agents to external systems: direct API calls, CLIs, and MCP. Each makes sense somewhere, depending on what you're building. The key distinction is whether there's a common layer between agents and services, and how far that layer reaches.Direct API callsThe agent calls your API directly—either by writing code that issues HTTP requests inside a code-execution sandbox, or through a generic function-calling tool. This is where most teams start, and it works fine for one agent talking to one service, or a small number of integrations that don't need to be reused across agent platforms.The challenges start to hit at scale. With no common layer between agents and services, each agent–service pair becomes a bespoke integration with its own auth handling, tool descriptions, and edge cases—the M×N integration problem.Command-line interface (CLI)The agent runs your command-line tool in a shell. This is fast, lightweight, and leans on pre-existing tooling. It works great for local environments and sandboxed containers—anywhere there's a filesystem and a shell. This provides a common layer, but it’s thin. CLIs hit hard limits reaching mobile, web, or cloud-hosted platforms that don't expose a container, and auth is handled by the CLI's own mechanism—usually a credential file on disk. This is best suited to quick, permissive integrations in local environments.Model Context Protocol (MCP)MCP provides the common layer as a protocol. The agent connects to a server that exposes your system's capabilities, with auth, discovery, and rich semantics standardized. One remote server reaches any compatible client (Claude, ChatGPT, Cursor, VS Code, and more), in any deployment environment.It requires a little bit more upfront investment. The return is that the integration is portable, and provides the semantics needed for a feature-rich agent integration.Production agents run in the cloudProduction agents increasingly run in the cloud, so they can scale and operate continuously. The systems they need to reach are cloud-hosted too: where your data lives, work is tracked, and your infrastructure runs. Often these systems are remote and behind auth, where MCP provides the common layer. We’re already seeing this in adoption. The MCP SDKs recently surpassed 300 million downloads a month, up from 100 million at the start of the year, with strong adoption across enterprises and popular agentic platforms. Millions of people use MCP with Claude every day, and the protocol underpins much of what we've shipped recently, including Claude Cowork, Claude Managed Agents, and channels in Claude Code. As MCP continues to support production agentic systems, we’re sharing patterns for building these integrations well: from building advanced servers to context-efficient clients, and where skills complement the protocol. Building effective MCP serversWe have over 200 MCP servers in our directory, used by millions of people every day. From working closely with enterprises and developers building on the protocol, we’ve spotted a handful of design patterns that determine how reliably agents can use a server.Build remote servers for maximum reachA remote server is what gives you distribution—it's the only configuration that runs across web, mobile, and cloud-hosted agents, and it's what every major client is optimized to consume. Build remote servers so agents can use your system wherever they run. Group tools around intent, not endpointsFewer, well-described tools consistently outperform exhaustive API mirrors. Don't wrap your API into an MCP server one-to-one—group tools around intent, so the agent can accomplish a task in a couple of calls instead of stitching many primitives together. A single create_issue_from_thread tool beats get_thread + parse_messages + create_issue + link_attachment. See writing effective tools for agents to learn more about the full pattern.Design for code orchestration when your surface is largeIf your service requires hundreds of distinct operations, such as Cloudflare, AWS, or Kubernetes, an intent-grouped toolset likely won't cover it. Instead, expose a thin tool surface that accepts code: the agent writes a short script, your server runs it in a sandbox against your API, and only the result returns. Cloudflare's MCP server is the reference example—two tools (search and execute) cover ~2,500 endpoints in roughly 1K tokens.Ship rich semantics where they helpMCP Apps is the first official protocol extension and lets a tool return an interactive interface, such as a chart, form, or dashboard, all rendered inline in the chat interface. Servers that ship MCP apps tend to see meaningfully higher adoption and retention than those that return text alone. Use it to put your product's UI in front of agents or end-users at the moment it matters—the extension is supported in Claude.ai, Claude Cowork, and many other top AI tools.Elicitation lets your server pause mid-tool call to ask the user for input. Form mode sends a simple schema and the client renders a native form—use it to request a missing parameter, confirm a destructive action, or disambiguate options. URL mode hands the user to a browser—use it to complete downstream OAuth, take a payment, or collect any credential that should never transit the MCP client. Both keep the user in the flow instead of sending them to a settings page. Form mode is supported broadly; URL mode is supported in Claude Code, with more clients in progress.Lean on standardized auth Standardized auth makes MCP practical for cloud-hosted agents. If your server requires OAuth, the latest MCP spec supports CIMD (Client ID Metadata Documents) for client registration—it gives users a fast first-time auth flow and far fewer surprise re-auth prompts. This is our recommended approach for auth, the capability is supported in MCP SDKs, Claude.ai, and Claude Code, and is being broadly adopted across the industry.Once a user has authorized, the next question is how a cloud-hosted agent holds and reuses those tokens at runtime. Vaults in Claude Managed Agents covers this: register a user's OAuth tokens once, reference the vault by ID at session creation, and the platform injects the right credentials into each MCP connection and refreshes them on your behalf—no secret store to build, no tokens to pass around per call.Making MCP clients more context-efficientMCP standardizes how AI agents (clients) connect to and work with tools and data sources they need (servers). The server securely exposes a range of capabilities, while the client orchestrates them and manages context. If you’re building an MCP client, make it context-efficient with patterns for progressive disclosure.Load tool definitions on demand with tool searchTool search defers loading all tools into context, rather than loading them upfront. This allows the agent to search the catalog at runtime, pulling in the relevant tools when needed. In our testing, tool search tends to cut tool-definition tokens by 85%+ while maintaining high selection accuracy. Reducing context usage with tool search. Source: advanced tool useProcess tool results in code with programmatic tool callingProgrammatic tool calling processes tool results in a code-execution sandbox, rather than returning them raw to the model. This lets the agent loop, filter, and aggregate across calls in code, with only the final output reaching context. In our testing, this reduces token usage by roughly 37% on complex multi-step workflows.Together, these patterns compose naturally across multiple servers: leaner context, fewer round-trips, faster responses. See advanced tool use for the full breakdown.Pairing MCP servers with skillsSkills and MCP are complementary. MCP gives an agent access to tools and data from external systems, while skills teach an agent the procedural knowledge of how to use those tools to accomplish real work. The most capable agents use both, and skills make MCP servers scale beyond a handful of connections. There are two general patterns for combining them:Bundle skills and MCP servers as a pluginPlugins for Claude are a useful abstraction that allow developers to bundle skills, MCP servers, hooks, LSP servers, and specialized subagents in one easily-consumable distribution method. Using this approach is the best way to unify multiple context providers with minimal friction. Combining MCP servers with skills allows Claude to act more like a domain-specialist. Grab your tools via MCP, and give Claude the skills to orchestrate workflows end-to-end. See our data plugin for Cowork as an example, which consists of 10 skills and 8 MCP servers for apps like Snowflake, Databricks, BigQuery, Hex and more.Combining skills with MCP. Source: Extending Claude’s capabilities with skills and MCP serversDistribute skills from an MCP serverIt's increasingly common for providers to publish a skill alongside their MCP server, so the agent gets both the raw capabilities and an opinionated playbook for using them well. Canva, Notion, Sentry, and more do this today in Claude, listing the skill next to their connector in our web directory.To make that pairing portable across every client, the MCP community is actively working on an extension for delivering skills directly from servers. This way the client inherits the relevant expertise automatically, versioned with the API it depends on. We expect this pattern to see broad adoption as the extension stabilizes.The compounding layer We opened with three paths for connecting agents to external systems. In practice, mature integrations will ship all three: the API as the foundation, a CLI for local-first environments, and MCP for cloud-based agents.As production agents move to the cloud, MCP becomes the critical layer, and it’s the one that compounds. Today, a remote server reaches every compatible client across any deployment environment, with auth, interactivity, and rich semantics handled by the protocol. As more clients adopt the spec and more extensions land in it, that same server gets more capable without you shipping anything new.When building an integration, if your goal is to have production agents in the cloud reach your system, build an MCP server and make it excellent using the patterns above. Every integration built on MCP strengthens the ecosystem: fewer edge cases to solve alone, fewer bespoke integrations to maintain.AcknowledgementsThanks to Den Delimarsky, David Soria Parra, Henry Shi, Felix Rieseberg, Conor Kelly, Molly Vorwerck, Andy Schumeister, Kevin Garcia, Amie Rotherham, Matt Samuels, Angela Jiang, Katelyn Lesse, AJ Rebeiro and Jess Yan for their contributions to this blog.
関連記事
AgentCore Gateway を用いた MCP クライアント向けの安全な認証コードフロー構築
AWS は、Kiro などのエージェント型コーディングアシスタントと企業システム間での安全なアクセスを実現するため、AgentCore Gateway を活用した認証コードフローの構築方法を公開しました。
Amazon Bedrock AgentCore Gateway の MCP サポート拡張
AWS は、企業向けに Amazon Bedrock AgentCore Gateway で Model Context Protocol(MCP)サーバーの運用を支援する機能を強化しました。これにより、大規模環境での細粒度アクセス制御、ツール利用状況の可視化、データ漏洩防止、および集中型認証管理が可能になります。
MCP を活用した時系列データベースとの Amazon Quick 統合による市場インテリジェンスの強化
Amazon は、Model Context Protocol(MCP)を Amazon Quick に統合し、金融アナリストが複雑なデータベースクエリを実行せずに時系列市場データにアクセスできる機能を追加しました。これにより、高頻度取引パターンの分析効率が向上します。