Invoice Collector MCP
Pricing
Pay per event
Invoice Collector MCP
Automates invoice collection from Razorpay, PayPal, and Stripe. Generates PDF/JSON exports, emails reports automatically, and supports AI-ready MCP mode for agent workflows.
Pricing
Pay per event
Rating
0.0
(0)
Developer

lalithhh
Actor stats
0
Bookmarked
1
Total users
0
Monthly active users
6 days ago
Last modified
Categories
Share
π InvoiceCollector MCP β Unified Invoice Automation for Razorpay, PayPal & Stripe
InvoiceCollector MCP is a production-grade automation tool designed for businesses, accountants, SaaS vendors, and AI agents who need a fully automated pipeline to fetch, organize, export, and deliver invoices from multiple payment platforms.
It works in two powerful modes:
- NORMAL MODE β Bulk-fetch invoices (PDF/JSON) from selected platforms
- MCP MODE β Runs as a WebSocket MCP server so AI agents (ChatGPT, Claude, LangChain, custom tools) can call it programmatically
Whether you're reconciling payments, filing GST, preparing financial reports, or integrating AI workflows β this Actor gives you a complete, automated invoice pipeline.
β Why This Actor Exists
Modern businesses use multiple payment platforms.
But invoices are scattered, inconsistent, and hard to download in bulk.
π Razorpay doesnβt provide unified bulk exports
π Stripe splits charges, payments, and invoices across APIs
π PayPal separates Invoicing API vs Reporting API
π No single dashboard fetches everything
π No AI-ready automation framework existedβ¦ until now
InvoiceCollector MCP solves this.
It provides:
- Unified fetch across platforms
- Bulk PDF download
- JSON summaries for missing PDFs
- Optional email delivery
- MCP server automation for AI tools
β¨ Key Features
β 3-in-1 Platform Support
No scraping β 100% official API integrations.
| Platform | Fetch Type | PDF Support | Notes |
|---|---|---|---|
| Razorpay | Payments / Invoices | β Yes | Fastest, stable |
| PayPal | Invoicing API + Reports | β Yes | Thick records |
| Stripe | Charges + Hosted Invoices | β Yes | Best metadata |
β Full Invoice Automation Pipeline
β Authenticate
β Fetch date-range transactions
β Download invoice PDFs
β Save JSON summaries when PDFs missing
β Upload results to KV store
β (Optional) Email all invoices
β Return unified flattened output
β AI Automation Ready (MCP Mode)
Run as a WebSocket MCP server the same way ChatGPT tools work:
listPlatformsvalidateCredentialscollectInvoices
Perfect for:
- Accounting bots
- ERP automations
- AI assistants
- Internal finance agents
β Zero UI Scraping β Fully Compliant
All integrations use official APIs, making it:
- Faster
- More reliable
- Safe for enterprise
- Allowed by payment providers
β Built for Pro Use
- Modular adapters
- Scalable architecture
- Clean SDK-based structure
- Extensible for future platforms
π§ Who This Actor Is For
- Founders / Startups
- Fintech apps
- Accounting firms
- CAs & auditors
- No-code automation builders
- ERP developers
- AI agent engineers
- Automation enthusiasts
Anyone dealing with Razorpay, PayPal, or Stripe invoices β this is for you.
π§ Quick Start (Normal Mode)
π¦ Example INPUT
{"mode": "normal","platforms": ["razorpay", "stripe"],"dateFrom": "2024-01-01","dateTo": "2024-12-31","emailTo": "yourname@example.com"}
π Environment Variables (Required)
Set these in Apify β Actor Settings β Environment variables:
| Variable | Purpose |
|---|---|
RAZORPAY_API_KEY | Razorpay access key |
RAZORPAY_API_SECRET | Razorpay secret key |
PAYPAL_CLIENT_ID | PayPal REST API |
PAYLAY_SECRET | PayPal REST API |
STRIPE_API_KEY | Stripe secret key |
SMTP_USER | Gmail address / SMTP user |
SMTP_PASS | Gmail App Password / SMTP key |
SMTP_HOST | Optional β default smtp.gmail.com |
SMTP_PORT | Optional β default 587 |
π€ Output Example
{"mode": "normal","processedPlatforms": "razorpay, stripe","successCount": "2","errorCount": "0","totalInvoices": "14","pdfFiles": "inv001.pdf, inv002.pdf","jsonFiles": "invoice_summary_12.json","emailSent": "yes","emailTo": "yourname@example.com"}
π¨ Email Delivery
If emailTo is provided and invoices were fetched:
β PDFs and JSON summaries are attached
β Message is delivered using SMTP/Gmail
β Skipped automatically if SMTP not configured
π€ MCP Mode β For AI Agents
Turn the Actor into a WebSocket automation backend.
π¦ Example MCP Input
{"mode": "mcp","mcpPort": 8080}
Server launches at:
ws://localhost:8080
Supported Commands (MCP)
| Command | Description |
|---|---|
listPlatforms | Returns: razorpay, paypal, stripe |
validateCredentials | Ensures API keys work |
collectInvoices | Triggers normal invoice flow |
Perfect for:
- ChatGPT MCP tools
- Claude MCP tools
- LangChain tool wrappers
- Internal automation APIs
π¦ Storage Usage
The Actor stores:
π Key-value store
- PDF invoices
- JSON summaries
- Error logs
π Dataset (UI preview)
- Flattened summary table of the run
β Architecture Overview
main.jsβββ normal mode β orchestrator.jsβββ mcp mode β mcp/server.jsorchestrator.jsβββ connectorManager.jsβββ email/sendEmail.jsβββ adapters/βββ razorpayβββ paypalβββ stripe
Adapters follow a strict format:
- connect(credentials)
- bulkDownload(connection, filters)
This ensures the Actor remains easy to extend.
π― Limitations
- Rate limits apply based on API providers
- Some transactions do not have PDFs
- Email requires valid SMTP / Gmail App Password
- MCP mode requires an MCP-enabled client
π Final Notes
This Actor is built to be:
- Reliable in production
- Extensible for more payment gateways
- Fast and stable
- AI-automation-ready
- Useful for accounting + fintech workflows
If you'd like support for Cashfree, RazorpayX, Zoho Books, or Stripe Checkout logs β just ask!


