FRESHBOOKS_SUMMARY.md•2.13 kB
# FreshBooks MCP - Architecture Summary
## 🎯 The Big Picture
You were right! Here's how it works:
### Current Flow (Xano MCP)
1. User connects to MCP → Logs into Xano → Gets `api_key` → Uses Xano tools
### New Flow (FreshBooks MCP)
1. User connects to MCP → Logs into Xano → Gets `freshbooks_key` → Uses FreshBooks tools
**Xano stays as the authentication backend for ALL your MCP tools!**
## 🔑 Key Insights
1. **Xano = User Management System**
- Handles login/authentication
- Stores user profiles
- Stores API keys for various services
2. **FreshBooks = Just Another API**
- User connects FreshBooks on mcp.snappy.ai
- Token stored in their Xano account
- MCP retrieves it like any other user data
3. **No OAuth in MCP**
- All OAuth happens on mcp.snappy.ai
- MCP just reads the stored tokens
- Super clean and simple
## 📝 What Changes in the Code
### Minimal Changes Required:
1. **Props Interface**: Add `freshbooksKey: string | null`
2. **OAuth Callback**: Extract `freshbooks_key` from user data
3. **Tools**: Replace Xano tools with FreshBooks tools
4. **Environment**: Add `FRESHBOOKS_ACCOUNT_ID`
That's it! 95% of the code stays the same.
## 🚀 Saturday Invoice Automation
With this setup, your Saturday routine becomes:
```
You: "Send all draft invoices"
Claude: *uses freshbooks_send_saturday_invoices tool*
Claude: "✅ Sent 3 invoices totaling $4,250"
```
## 🎉 Why This is Brilliant
1. **You already built the hard part** (OAuth with Xano)
2. **Adding new services is trivial** (QuickBooks, Stripe, etc.)
3. **Users manage everything on mcp.snappy.ai**
4. **Each MCP server stays focused** on one API
5. **Ray was right** - build MCP for companies with APIs!
## 📋 Next Steps
1. Copy template → freshbooks-mcp
2. Make the 4 small changes above
3. Deploy to Cloudflare
4. Add FreshBooks OAuth to mcp.snappy.ai
5. Test with your Saturday invoicing
6. Ship it! 🚢
This follows Ray's advice perfectly - take an existing API (FreshBooks) and make it accessible through MCP. The 90-day window is your chance to be the go-to MCP for invoicing!