MCP Tool Calling Architecture
Interactive flow of an AI Agent using the Model Context Protocol to generate UI.
1
2
3
4
5
1. Agent needs login UI → Analyzes prompt and decides to use external tools.
listTools()
callTool()
ToolResult[]
HTTP POST
JSON + Assets
Forward to Custom
Your Agent
Vercel AI SDK
@ai-sdk/mcp
"I need a Login UI..."
Stitch Proxy
MCP Server
(Handles Auth & Routing)
Stitch AI Engine
🔧 create_project
✨ generate_screen
✏️ edit_screen
📄 get_html
s variants
Your Custom MCP Server
Internal API Tools
(e.g., get_user_data)
</>
</>