What is MCP?
MCP is a protocol that lets AI agents talk to external tools and resources in a consistent way. Servers expose tools and resources; clients (agents) can discover and call them.
A developer-friendly primer on building interoperable tools and UI surfaces for AI agents. Learn the essentials of MCP servers, tools, and widgets—by example.
MCP is a protocol that lets AI agents talk to external tools and resources in a consistent way. Servers expose tools and resources; clients (agents) can discover and call them.
Tools are typed operations an agent can call—for example, “add_todo” or “complete_todo”. They return human-readable content and structured data the UI can render.
Widgets are small UI views attached to tool output. They render structured results, stay in sync with updates, and can call tools directly when permitted.
MCP standardizes how agents integrate with systems. It reduces bespoke glue code, improves safety via schemas, and enables richer experiences with minimal friction.
MCP establishes a consistent contract between agents and external systems. Servers expose tools and resources; agents discover, validate, and invoke them using schemas and well-defined protocol messages.
Agents connect and list available capabilities: tools (operations) and resources (data or templates). Clear metadata makes orchestration predictable and safe.
Inputs are validated against schemas; outputs include human-readable content and structured data. This duality ensures clarity for both users and UIs.
Widgets render structured results from tools. They stay synchronized with agent updates and can call permitted tools directly to continue workflows.
Servers typically speak HTTP(S) for portability. Small, stateless exchanges keep integrations simple while remaining robust under scale.
Design to be composable: prefer small tools with clear boundaries over monolithic actions. Emphasize validation and explicit responses for reliability.
The goal is predictability: schemas, consistent outputs, and minimal side effects help agents reason and users stay informed.