Metadata-Version: 2.4
Name: crowe-sweep
Version: 0.1.0
Summary: Crowe Sweep. Moves cleared Stripe revenue into your financial account or bank the minute Stripe releases it, on instant rails when your account has them.
Author-email: "Crowe Logic, Inc" <support@crowelogic.com>
License: Proprietary
Project-URL: Homepage, https://crowelogic.com/sweep
Project-URL: Documentation, https://crowelogic.com/sweep/docs
Keywords: stripe,payouts,treasury,financial account,mcp,agent
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Topic :: Office/Business :: Financial
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Provides-Extra: mcp
Requires-Dist: mcp<2,>=1.2; extra == "mcp"
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"

# Crowe Sweep

Cleared Stripe revenue, moved into your financial account or bank the minute Stripe releases it.

Stripe holds card money for its settlement delay, then pays it out once a day on its own schedule.
Crowe Sweep watches the balance and pays it out the moment it turns available. If your payout
destination is a Stripe financial account, the money is there the same second, spendable on your
Stripe card. If it is a bank, the instant rail is used whenever your account has it.

Built by Crowe Logic, Inc. See `SPEC.md` for the product decisions and `stripe-app/`, `worker/` for
the Dashboard app and the hosted service.

## The self-hosted tool

```
uv tool install crowe-sweep            # or: pip install crowe-sweep
crowe-sweep doctor                     # key, endpoints, payout method, log
crowe-sweep status
crowe-sweep preview                    # what run would do, moves nothing
crowe-sweep run                        # sweep, then the bank leg if enabled
```

Key resolution: `CROWE_SWEEP_STRIPE_KEY`, then `STRIPE_MONEY_KEY` in `~/.config/crowe/secrets.env`,
then `STRIPE_SECRET_KEY` in `~/.config/crowe/control-plane.env`, then `STRIPE_SECRET_KEY` in the
environment. Use a restricted key: Balance read, Payouts write, and (for the bank leg) Money
Management financial accounts read, payout methods read, outbound transfers write.

Policy lives in `~/.config/crowe/sweep.json`:

```json
{ "bank_leg": false, "float_cents": 0, "min_cents": 100,
  "financial_account": null, "payout_method": null }
```

`bank_leg: false` keeps money in the financial account (the default, and what Crowe Logic runs).
`bank_leg: true` adds a v2 OutboundTransfer to the first instant-capable bank payout method,
trying explicit RTP first and falling back to Stripe's `automatic` delivery, in chunks of at most
$9,999. `float_cents` is what stays behind for card spend. Every `CROWE_SWEEP_*` env var overrides
the file (`CROWE_SWEEP_DRY_RUN=1` moves nothing and logs what would).

Every action is one JSON line in `~/.local/state/crowe-sweep/sweep.log`; `crowe-sweep history`
reads it back.

### Run it every ten minutes

```
cp launchd/com.crowelogic.crowe-sweep.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/com.crowelogic.crowe-sweep.plist
```

The agent also fires at 17:00 and 17:03 local time, which is 00:00 UTC, when Stripe releases the
day's settled card money for US accounts.

## The MCP server

`crowe-sweep-mcp` is a stdio MCP server with `sweep_status`, `sweep_preview`, `sweep_now`,
`instant_payout`, `sweep_run`, `sweep_history`, `sweep_policy`. Reads are free; anything that moves
money takes `confirm=true` and otherwise returns a preview. Any MCP host can launch it:

```json
{ "mcpServers": { "crowe-sweep": { "command": "crowe-sweep-mcp" } } }
```

In the Crowe Logic Foundry CLI the same tools are native (`tools/crowe_sweep.py`), and the server is
also reachable as `mcp_list_tools("crowe_sweep.mcp_server", package_type="pypi")`.

## Pricing

| Plan | Price | Includes |
| --- | --- | --- |
| Starter | $0 | Balance view in the Stripe Dashboard, one-click sweep, history |
| Pro | $19/month, $190/year | Automatic sweeps every 10 minutes, instant rail when available, landing notifications, one account |
| Business | $59/month, $590/year | Up to 5 accounts, float/minimum/quiet-hour policies, audit export, MCP and API access, priority support |

No per-transfer fee. Stripe's own rail fees are the merchant's and are shown, never hidden.
Crowe Logic Pro customers get Business included. `scripts/create_prices.sh` creates the product
and prices on the Crowe Logic, Inc account.

## Development

```
uv venv .venv --python 3.12 && uv pip install -e ".[dev,mcp]" --python .venv/bin/python
.venv/bin/python -m pytest -q
```

The core has no third-party dependencies and runs on Python 3.9, so a stock macOS LaunchAgent can
run it. The MCP server needs `mcp>=1.2,<2`.
