@@ -21,7 +21,7 @@ pip install 'pacer-cli[full]'
2121## ![ checkbox] ( icons/checkbox.png ) Quick Start
2222
2323``` bash
24- # 1. Configure credentials (interactive wizard — sets up encrypted vault)
24+ # 1. Configure credentials (interactive wizard - sets up encrypted vault)
2525pacer auth init
2626
2727# 2. Search for cases (costs $0.10/page)
@@ -76,9 +76,11 @@ pacer pcl cases -t "IBM" -c nysd -i
7676
7777```
7878pacer [OPTIONS] COMMAND
79- -y, --yes Skip cost confirmation prompts
80- --version Show version
81- --help Show help
79+ -y, --yes Skip cost confirmation prompts
80+ --agent Non-interactive mode for AI agents (JSON errors, exit 3 on a cap)
81+ --matter CODE Client/matter code for a billable command (alias: --client-code)
82+ --version Show version
83+ --help Show help
8284```
8385
8486** Cost confirmation:** By default, commands that incur PACER charges prompt for confirmation. Use ` -y ` to skip:
@@ -90,6 +92,66 @@ pacer -y download docket 1:18-cv-08434 nysd # no prompt
9092
9193---
9294
95+ ## Spend Governance (preventive cap)
96+
97+ A real-time, ** fail-closed** spend cap safe to put in front of an autonomous agent.
98+ Every billable call is checked * before* it runs and logged after, so cumulative spend
99+ can't drift past a limit. Caps live in a lawyer-editable CSV and are tagged to PACER's
100+ native client/matter code.
101+
102+ ** ` ~/.pacer/config/policy.csv ` ** (see [ ` examples/policy.csv ` ] ( examples/policy.csv ) ):
103+
104+ ``` csv
105+ Setting,Value
106+ Max spend per search ($),5.00
107+ Max spend per day ($),50.00
108+ Require client/matter code,Yes
109+ ```
110+
111+ - ** Missing file** → conservative built-in caps (per-op $1.00, daily $10.00). Never uncapped.
112+ - ** Blank cell** → keeps the safe default (a blank cap is * not* "unlimited").
113+ - ** Unparseable cell** (e.g. ` fifty ` ) → billable ops refuse and name the row; read-only commands still run.
114+ - Caps change ** only** by editing the CSV (a human). Nothing in agent mode writes it, so an agent can't widen its own leash.
115+
116+ When a cap is hit, the command exits ** 3** (distinct from auth/network). In ` --agent `
117+ mode the refusal is JSON on stderr:
118+
119+ ``` bash
120+ $ pacer --agent pcl cases -n 1:20-cv-1
121+ {" error" : " BUDGET_EXCEEDED" , " operation" : " Search cases" , " estimated" : 0.1, " spent_today" : 9.95, " daily_cap" : 10.0}
122+ ```
123+
124+ ** Client/matter code** lands on the bill via PACER's ` X-CLIENT-CODE ` header, so charges
125+ reconcile against the firm's quarterly PAA statement with no parallel accounting:
126+
127+ ``` bash
128+ pacer --matter MATTER-1234 pcl cases -t " Acme"
129+ ```
130+
131+ ### Agent mode & credentials
132+
133+ ` --agent ` (auto-detected when there's no TTY) makes the CLI non-interactive: JSON errors,
134+ no prompts. ** Login stays human-in-the-loop** - agent mode never prompts for or
135+ auto-unlocks the vault; it uses human-provisioned ` PACER_USERNAME ` /` PACER_PASSWORD `
136+ (env or ` config.env ` ).
137+
138+ ### Court scoping
139+
140+ A firm that practices in a few districts shouldn't pay for nationwide PCL hits. Scope
141+ searches via ** ` ~/.pacer/config/courts.csv ` ** (human-edited, agent-read-only):
142+
143+ ``` bash
144+ pacer courts disable-all
145+ pacer courts enable cand nysd # only these courts
146+ pacer courts status
147+ pacer courts invert # flip every flag ("enable the rest")
148+ ```
149+
150+ Enabled courts flow into ` pcl cases ` / ` pcl parties ` automatically (an explicit
151+ ` --court ` still wins). All courts enabled, or no file, means nationwide.
152+
153+ ---
154+
93155## ![ key] ( icons/key.png ) Authentication
94156
95157### pacer auth init
@@ -164,7 +226,7 @@ Options:
164226# Show current code
165227pacer auth code
166228
167- # Watch mode — stays open, refreshes automatically
229+ # Watch mode - stays open, refreshes automatically
168230pacer auth code --watch
169231```
170232
@@ -863,6 +925,37 @@ text = parse_docket_file(Path("docket.html"), "compact")
863925
864926---
865927
928+ ## MCP Server (for AI agents)
929+
930+ PACER, exposed over the [Model Context Protocol](https://modelcontextprotocol.io) - the
931+ governed client behind a tool interface. Every billable tool routes through the **same
932+ preventive cap** as the CLI and writes the same audit line, so an MCP-driven agent obeys
933+ one cap and leaves one trail. A read-only `spend_status` tool/resource lets the agent see
934+ its remaining budget.
935+
936+ ```bash
937+ pip install -e ' .[mcp]' # optional extra; keeps the core CLI dependency-light
938+ pacer-mcp # runs a local stdio server (bring your own credentials)
939+ ```
940+
941+ Register it with a desktop MCP client (e.g. Claude Desktop `claude_desktop_config.json`):
942+
943+ ```json
944+ {
945+ "mcpServers": {
946+ "pacer": { "command": "pacer-mcp" }
947+ }
948+ }
949+ ```
950+
951+ Tools: `search_cases`, `search_parties`, `get_docket`, `get_document` (all billable, all
952+ capped) and `spend_status` (read-only). A cap breach returns a structured error mirroring
953+ the CLI' s JSON. Same invariants: credentials are human-provisioned (env / ` config.env` );
954+ the server never prompts, never auto-unlocks the vault, and never writes ` policy.csv` /
955+ ` courts.csv` .
956+
957+ ---
958+
866959# #  Costs
867960
868961PACER charges per page viewed:
@@ -885,7 +978,7 @@ PACER charges per page viewed:
885978
886979pacer-cli includes a security module (` security.py` ) that protects your account and federal court system resources:
887980
888- - **Encrypted credential vault** — AES-256-GCM encryption with Scrypt key derivation (see below)
981+ - ** Encrypted credential vault** - AES-256-GCM encryption with Scrypt key derivation (see below)
889982- ** TLS 1.2+ enforcement** with ECDHE-only cipher suites (no deprecated DHE)
890983- ** Rate limiting** (30 req/min default, configurable) to stay within PACER guidelines
891984- ** Peak hours detection** (6AM-6PM Central, DST-aware via ` zoneinfo` ) with bulk download warnings
0 commit comments