Skip to content

Commit f1fef38

Browse files
committed
feat: Add MCP (Model Context Protocol) sample implementation
This commit adds a new MCP binding sample for UCP, enabling AI agents to interact with UCP-compliant merchants through the Model Context Protocol. New files: - mcp/python/ucp_mcp_server.py: FastMCP server exposing UCP capabilities - Tools: list_products, create_checkout, add_to_checkout, complete_payment, etc. - Resources: catalog, checkout sessions, orders, discovery profile - Prompts: shopping assistant, order confirmation, product recommendations - Supports stdio, HTTP, and SSE transports - mcp/python/ucp_mcp_client.py: Example client demonstrating complete shopping flow - Connects via MCP protocol - Demonstrates happy path: browse -> checkout -> pay -> track - mcp/python/README.md: Comprehensive documentation - Architecture diagram - Quick start guide - Claude Desktop integration - Development guide - mcp/python/pyproject.toml: Project configuration with dependencies Updated: - README.md: Added MCP binding section with comparison table This sample enables conversational commerce experiences by allowing LLMs like Claude, GPT, and Gemini to perform shopping operations through the standardized MCP protocol.
1 parent 1b83acf commit f1fef38

File tree

5 files changed

+1778
-2
lines changed

5 files changed

+1778
-2
lines changed

README.md

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ Universal Commerce Protocol (UCP).
2121

2222
## Sample Implementations
2323

24-
### Python
24+
### REST Bindings
25+
26+
#### Python (REST)
2527

2628
A reference implementation of a UCP Merchant Server using Python and FastAPI.
2729

@@ -39,7 +41,7 @@ A reference implementation of a UCP Merchant Server using Python and FastAPI.
3941
* A script demonstrating a full "happy path" user journey (discovery ->
4042
checkout -> payment).
4143

42-
### Node.js
44+
#### Node.js (REST)
4345

4446
A reference implementation of a UCP Merchant Server using Node.js, Hono, and
4547
Zod.
@@ -49,6 +51,41 @@ Zod.
4951
* Demonstrates implementation of UCP specifications for shopping,
5052
checkout, and order management using a Node.js stack.
5153

54+
### MCP Binding (Model Context Protocol)
55+
56+
A reference implementation using the [Model Context Protocol](https://modelcontextprotocol.io/)
57+
for AI agent integration.
58+
59+
* **Server & Client**: [Documentation](mcp/python/README.md)
60+
61+
* Located in `mcp/python/`.
62+
* Exposes UCP shopping capabilities as MCP tools and resources.
63+
* Enables AI agents (Claude, GPT, etc.) to perform commerce operations.
64+
* Includes example client demonstrating complete shopping flow.
65+
66+
**Key Features:**
67+
* Tools for product discovery, checkout, payment, and order management
68+
* Resources for read-only access to catalogs, sessions, and orders
69+
* Prompts for reusable conversation patterns
70+
* Support for stdio, HTTP, and SSE transports
71+
72+
### A2A Binding (Agent-to-Agent)
73+
74+
An example Business A2A Agent implementing the UCP Extension.
75+
76+
* **Agent & Client**: [Documentation](a2a/README.md)
77+
* Located in `a2a/`.
78+
* Demonstrates agent-to-agent communication for commerce operations.
79+
* Includes chat client for interactive testing.
80+
81+
## Protocol Binding Comparison
82+
83+
| Binding | Use Case | Transport | Best For |
84+
|---------|----------|-----------|----------|
85+
| REST | Traditional APIs | HTTP | Web/mobile apps, service integration |
86+
| MCP | AI Agents | stdio/HTTP/SSE | LLM integration, conversational commerce |
87+
| A2A | Agent Communication | HTTP | Multi-agent systems, automated workflows |
88+
5289
## Getting Started
5390

5491
Please refer to the specific README files linked above for detailed instructions

0 commit comments

Comments
 (0)