How fernandogarzaaa/paypilot works
PayPilot turns a user’s natural-language commerce request into PayPal operations: the web agent or an MCP client invokes shared tools, which validate and dispatch invoice, payment-search, refund, and account-summary actions through a PayPal client and configurable transport. The web surface can hold money-moving actions for human confirmation. The README and excerpts establish these main paths; detailed web routing and some tool implementations were not fully sampled.
Main entry points: paypal_client.py PayPal REST client · tools.py Tool dispatcher · web.py Web API · agent.py Agent loop
Components 16
Access surfaces
- Chat UI
webui/index.html - Web API
paypilot/web.py - MCP server
paypilot/mcp_server.py
Agent workflow
- Agent loop
paypilot/agent.py - Model client
paypilot/agent.py
Commerce operations
- Tool dispatcher
paypilot/tools.py - Invoice operations
paypilot/paypal_client.py - Payment search and refunds
paypilot/paypal_client.py - Account summary
paypilot/tools.py
PayPal connectivity
- PayPal REST client
paypilot/paypal_client.py - HTTP transport
paypilot/transport.py - Mock PayPal backend
paypilot/transport.py
Other components
- User
- MCP client
- Chat model
- PayPal API
Connections 17
- User → Chat UI: sends request
README.md - Chat UI → Web API: posts chat
paypilot/web.py - Web API → Agent loop: runs agent
paypilot/web.py - Agent loop → Model client: requests completion
paypilot/agent.py - Model client → Chat model: calls endpoint
paypilot/agent.py - Agent loop → Tool dispatcher: executes calls
paypilot/agent.py - Web API → Tool dispatcher: executes confirmed actions
paypilot/web.py - User → MCP client: requests operation
README.md - MCP client → MCP server: calls tools
README.md - MCP server → Tool dispatcher: dispatches tools
paypilot/mcp_server.py - Tool dispatcher → PayPal REST client: calls operations
paypilot/tools.py - PayPal REST client → HTTP transport: sends requests
paypilot/paypal_client.py - HTTP transport → PayPal API: calls REST API
README.md - PayPal REST client → Mock PayPal backend: uses when configured
paypilot/paypal_client.py - PayPal REST client → Invoice operations: implements invoices
README.md - PayPal REST client → Payment search and refunds: implements search and refunds
README.md - Tool dispatcher → Account summary: builds summary
paypilot/tools.py