Building agents that reach production systems with MCP使用MCP构建达到生产系统的代理https://claude.com/blog/building-agents-that-reach-production-systems-with-mcphttps://claude.com/blog/building-agents-that-reach-production-systems-with-mcpAgents 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.代理的价值取决于其可触及的系统范围。团队通常采用三种方式将代理与外部系统连接——直接API调用、命令行界面(CLI)和微服务控制平面(MCP)。本文阐述了每种方案的适用场景解释了生产环境代理最终多采用MCP的原因并提供了构建这些集成的高效模式。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 youre building. The key distinction is whether theres a common layer between agents and services, and how far that layer reaches.将代理连接到外部系统我们通常看到三种将代理连接到外部系统的方式直接API调用、CLI和MCP。每种方式都有其适用场景具体取决于您构建的内容。关键区别在于代理与服务之间是否存在通用层以及该层的覆盖范围有多大。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 dont 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.直接API调用代理直接调用您的API——要么通过在代码执行沙箱内编写发出HTTP请求的代码要么通过通用函数调用工具。这是大多数团队开始的地方对于单个代理与单个服务通信或少量不需要在多个代理平台间复用的集成场景效果良好。但当规模扩大时挑战就会显现。由于代理与服务之间没有通用层每个代理-服务组合都会变成定制化集成需要各自的身份验证处理、工具描述和边缘案例处理——这就是M×N集成问题。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 theres 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 dont expose a container, and auth is handled by the CLIs own mechanism—usually a credential file on disk. This is best suited to quick, permissive integrations in local environments.命令行界面CLI该代理在shell中运行您的命令行工具。这种方式快速、轻量级且依赖于现有工具链。它非常适合本地环境和沙盒容器——任何具备文件系统和shell的地方。这提供了一个通用层但较为精简。CLI在触及移动端、网页端或无容器暴露的云托管平台时存在明显局限且认证由CLI自身机制处理通常是磁盘上的凭证文件。此方案最适用于本地环境中快速宽松的集成场景。Model Context Protocol (MCP)MCP provides the common layer as a protocol. The agent connects to a server that exposes your systems 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.模型上下文协议MCPMCP作为一种协议提供通用层。智能体通过标准化认证、发现和丰富语义连接到暴露您系统能力的服务器。一个远程服务器即可覆盖任何部署环境中的兼容客户端Claude、ChatGPT、Cursor、VS Code等。它需要稍多些的前期投入但回报是可移植的集成方案并为功能丰富的智能体集成提供所需的语义支持。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 weve 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.生产代理在云端运行生产代理越来越多地在云端运行从而实现弹性扩展和持续运作。它们需要连接的各类系统同样托管在云端包括数据存储中心、工作追踪平台和基础设施运行环境。这些系统通常处于远程且受认证保护的状态而MCP协议正是为此提供了通用连接层。市场采用已印证这一趋势。MCP SDK的月下载量近期突破3亿次年初仅为1亿次在企业级市场和主流智能体平台获得广泛部署。每天有数百万人通过MCP协议使用Claude该协议更是我们近期多项产品发布的技术基石包括Claude协作功能、Claude托管代理服务以及Claude代码频道中的通道功能。随着MCP持续为生产级智能体系统提供支持我们现分享构建优质集成的最佳实践涵盖高级服务端开发、高效上下文客户端设计以及协议与功能扩展的协同方案。注译文通过以下处理实现专业性与可读性平衡cloud-hosted译为托管在云端符合IT行业术语behind auth意译为受认证保护准确传达安全语境channels in Claude Code采用增译法补充功能二字确保技术概念清晰被动语态转换为中文主动句式如were sharing→我们现分享保留专业术语首字母缩写MCP/SDK确保技术文档准确性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—its the only configuration that runs across web, mobile, and cloud-hosted agents, and its 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. Dont 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 wont 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. Cloudflares 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 products 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 authStandardized 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 users 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 ofhowto 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 serverIts 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 layerWe 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 Yanfor their contributions to this blog.--