MCP for Agent Commerce: What Could Go Wrong
Moonshot AI
OpenAI
Alibaba/Qwen
Anthropic
Tutu and Alexander Polyakov released an MCP server for agent-based commerce, enabling AI agents to search real travel data. The article shares seven practical lessons from development, including landing page handling, context optimization (74% reduction), authorization support, and legal considerations.
Alexander Polyakov and the Tutu team released an MCP server to let AI agents search real travel data instead of parsing web pages. The server must distinguish between agent and browser requests: POST/SSE for agents, HTML landing page for humans. Tool descriptions should be self-contained with readOnlyHint, idempotentHint, and openWorldHint annotations. Aggressive context compression reduced typical token usage from 133K to 34K (74%) by paginating results and truncating verbose data. Legal requirements force the final purchase step to happen on the merchant site: the agent selects options but the user accepts the offer, enters personal data, and pays. Authorization supports both OAuth 2.1 (for cloud clients like ChatGPT/Claude) and static key in header (for local clients); keys must never be in URL query strings. Testing uses evals: running live agents on 60+ test scenarios with a second model evaluating behavior. Rate limiting applies only to tool calls, not to the landing page or static assets, to avoid blocking human visitors. The key lesson: MCP servers must serve both human and agent audiences, with clear documentation and self-explaining tools.
- Сокращения
- MCP = Model Context Protocol — протокол контекста модели
- JSON-RPC = JavaScript Object Notation Remote Procedure Call — формат удаленных вызовов на основе JSON
- SSE = Server-Sent Events — события от сервера
- HTTP = Hypertext Transfer Protocol — протокол передачи гипертекста
- API = Application Programming Interface — программный интерфейс приложения
- REST = Representational State Transfer — архитектурный подход к программным интерфейсам
- URL = Uniform Resource Locator — адрес ресурса
- OAuth = Open Authorization — протокол авторизации
Source: Habr — хаб ИИ —
original
