financeops-mcp
v0.1.0
Published
Unified financial intelligence MCP server — Stripe + Xero
Maintainers
Readme
Financial intelligence for AI coding agents. Connect Stripe and Xero, then ask your AI agent anything about your business finances — health checks, P&L, cash flow forecasts, reconciliation, and anomaly detection.
Quick Start · Tools · Pro Features · Security · Architecture
See it in action
Agent "What's our financial health right now?"
FinanceOps financial_health({ providers: ["stripe", "xero"] })
Result:
Financial Health Report
──────────────────────────────────────────────────
MRR $12,450.00 ▲ +8.3% vs last month
ARR $149,400.00
Burn Rate $4,200.00/mo
Runway 29.6 months
Churn Rate 2.1%
Active Customers 187
Stripe balance: $8,320.50 (available)
Xero balance: $41,200.00 (bank)
Status: HEALTHY ✓
Generated in 340ms Agent "Generate a P&L for this quarter"
FinanceOps generate_pnl({
providers: ["stripe", "xero"],
period: "quarter",
date_from: "2026-01-01",
date_to: "2026-03-31"
})
Result:
Profit & Loss — Q1 2026
──────────────────────────────────────────────────
Revenue
Stripe Payments $34,210.00
Xero Invoices $18,940.00
Total Revenue $53,150.00
Expenses
SaaS & Subscriptions $1,840.00
Payroll $9,000.00
Other $2,100.00
Total Expenses $12,940.00
Net Profit $40,210.00 (75.7% margin)Architecture
graph LR
A["AI Agent<br/>(Claude, Cursor, Windsurf)"] -->|MCP Protocol| B["FinanceOps MCP"]
B --> C["Stripe API<br/>(Payments & Billing)"]
B --> D["Xero API<br/>(Accounting & Invoices)"]
B --> E["Analysis Engine<br/>(P&L · Cash Flow · Anomaly)"]
B --> F["Audit Trail<br/>(SQLite)"]
style A fill:#1f2937,stroke:#10b981,color:#f0f6fc
style B fill:#0d1117,stroke:#10b981,stroke-width:2px,color:#10b981
style C fill:#0a1f16,stroke:#635bff,color:#f0f6fc
style D fill:#0a1f16,stroke:#13b5ea,color:#f0f6fc
style E fill:#0a1f16,stroke:#10b981,color:#f0f6fc
style F fill:#161b22,stroke:#30363d,color:#8b949eQuick Start
npx financeops-mcpSet your provider credentials as environment variables:
# Stripe
export STRIPE_SECRET_KEY=sk_live_...
# Xero (OAuth2)
export XERO_CLIENT_ID=...
export XERO_CLIENT_SECRET=...
export XERO_TENANT_ID=...Add to your claude_desktop_config.json:
- macOS / Linux:
~/.config/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"financeops": {
"command": "npx",
"args": ["financeops-mcp"],
"env": {
"STRIPE_SECRET_KEY": "sk_live_...",
"XERO_CLIENT_ID": "...",
"XERO_CLIENT_SECRET": "...",
"XERO_TENANT_ID": "..."
}
}
}
}Add to .cursor/rules/mcp_servers.json in your project root:
{
"mcpServers": {
"financeops": {
"command": "npx",
"args": ["financeops-mcp"],
"env": {
"STRIPE_SECRET_KEY": "sk_live_..."
}
}
}
}Open settings (Cmd+Shift+P / Ctrl+Shift+P then search "MCP") and add:
{
"mcpServers": {
"financeops": {
"command": "npx",
"args": ["financeops-mcp"],
"env": {
"STRIPE_SECRET_KEY": "sk_live_..."
}
}
}
}Set the PRO_LICENSE environment variable to unlock premium analysis tools:
{
"mcpServers": {
"financeops": {
"command": "npx",
"args": ["financeops-mcp"],
"env": {
"STRIPE_SECRET_KEY": "sk_live_...",
"PRO_LICENSE": "your-license-key"
}
}
}
}Or from the command line:
PRO_LICENSE=your-license-key npx financeops-mcpTools
Free Tools (6)
| Tool | Description |
|:-----|:------------|
| list_transactions | Fetch paginated transactions from Stripe or Xero with date range and status filters |
| get_balances | Get current account balances — Stripe available/pending, Xero bank accounts |
| list_invoices | Fetch invoices with status filtering (paid, pending, overdue) and date range |
| revenue_summary | Calculate revenue metrics for a period — total, average transaction, top customers |
| expense_tracker | Categorize and summarize expenses by type with period filtering |
| financial_health | Quick health check across providers — MRR, ARR, burn rate, runway, churn rate |
Pro Features (6)
| Tool | Description |
|:-----|:------------|
| generate_pnl | Full Profit & Loss statement from Stripe + Xero data for any period (PRO) |
| cash_flow_forecast | 3/6/12-month cash flow forecast — conservative, realistic, and optimistic scenarios (PRO) |
| reconcile | Cross-reference Stripe payments with Xero records to find discrepancies (PRO) |
| detect_anomalies | Statistical anomaly detection — flag unusual transactions, spikes, and drops (PRO) |
| tax_summary | VAT/sales tax calculation and period summary by jurisdiction (PRO) |
| multi_currency_report | Consolidated reporting across EUR, USD, GBP with live rate conversion (PRO) |
Feature Comparison
Analysis Algorithms
P&L Generation
Aggregates income transactions from Stripe (charges, refunds) and Xero (invoices, credit notes), subtracts categorized expenses, and produces a structured statement with gross profit, operating expenses, and net profit with margin percentages.
Cash Flow Forecasting
Uses a weighted moving average over the last 3 months of historical data (weights: 1, 2, 3 oldest to newest). Applies a linear trend multiplier derived from first-vs-last net cash flow change. Outputs three scenarios:
| Scenario | Income Adjustment | Use Case | |:---------|:------------------|:---------| | Conservative | −20% | Worst-case planning, fundraising | | Realistic | Baseline trend | Default projection | | Optimistic | +20% | Best-case, growth planning |
Minimum 3 months of historical data required.
Reconciliation
Cross-references Stripe payment_intent IDs against Xero invoice references using fuzzy amount matching (±1% tolerance for currency conversion). Flags unmatched, duplicate, and reversed transactions.
Anomaly Detection
Statistical Z-score analysis over rolling 30-day windows. Configurable sensitivity:
- Low — flags transactions >3σ from mean
- Medium — flags >2σ (default)
- High — flags >1.5σ
Supported Providers
Credentials
# Stripe — secret key from dashboard.stripe.com/apikeys
STRIPE_SECRET_KEY=sk_live_...
# Xero — OAuth2 app from developer.xero.com
XERO_CLIENT_ID=...
XERO_CLIENT_SECRET=...
XERO_TENANT_ID=... # Organisation ID from Xero connectionsSecurity
FinanceOps MCP is read-only by design. It calls provider APIs with read scopes only — it cannot move money, create invoices, or modify accounting records.
| Principle | Details | |:----------|:--------| | Read-only by default | All tools only read data — no write operations, no fund transfers | | No stored credentials | API keys are passed via environment variables and never written to disk | | No telemetry | Zero analytics, zero phone-home. Your financial data stays local | | Audit trail | Every tool call is logged locally in SQLite with timestamp, tool name, provider, and success/failure | | Least privilege | Use restricted Stripe keys (read-only) and Xero connections with Reader scope |
Best Practices
# Use restricted Stripe keys — create at dashboard.stripe.com/apikeys
# Toggle off all write permissions, keep only: Read balance, Read charges, Read invoices
# Use environment variables — never hardcode API keys
STRIPE_SECRET_KEY=sk_restricted_... npx financeops-mcp
# Rotate credentials regularly
# Xero OAuth tokens expire — implement refresh token rotation in productionPro License
Unlock P&L generation, cash flow forecasting, reconciliation, anomaly detection, tax summaries, and multi-currency reporting.
Get your license:
# Activate
export PRO_LICENSE=your-license-key
npx financeops-mcp
# Or inline
PRO_LICENSE=your-license-key npx financeops-mcpBuilt by Craftpipe — AI-powered developer tools
MIT License © 2026 Craftpipe
