# mcp-westrock-claude

One MCP server that gives Claude tool access to three WestRock systems at once,
so a single session can look at job files, query BDB, and pull ATTOM data
without switching servers:

- **zclients** — WestRock appraisal job folders (`My ShareSync\P-Homes\zclients`)
- **BDB** — the read-only `bdb_ro` production database connection
- **ATTOM** — the WestRock ATTOM middleware (property resolve, comps, verification, assessment)

This is a local prototype of the tool catalogue described in
`14-CURSOR-WESTROCK-MCP-SERVER.md` (the team-wide hosted `westrock-mcp` plan).
It runs over stdio on this machine only — it is not the shared, OAuth'd,
multi-person server that doc describes, but the tool shapes match so the code
can move there with light changes.

## Tools

**zclients**
- `list_year_folders`, `list_job_folders`, `search_jobs`, `list_job_files`,
  `read_job_file`, `write_job_file` — all paths relative to the zclients root
  and validated to prevent escaping it.

**BDB** (read-only; see `src/bdb.ts` for the safety rules)
- `bdb_run_query` — any single SELECT/WITH/SHOW/EXPLAIN/DESCRIBE statement
- `bdb_pending_jobs_report` — pending jobs, status, hours in status, due dates
- `bdb_job_workflow_roles_report` — people assigned to each pending job

**ATTOM** (see `src/attom.ts`)
- `attom_resolve_property` — address/block-lot/APN/BBL → ATTOM property ID
- `attom_sales_comps` — sales comparables near a resolved property
- `attom_verification_bundle` — parcel/owner/building/lot/zoning/assessment detail
- `attom_assessment_history` — tax assessment history

Every ATTOM call requires a `jobNumber` (BDB order number, or an ad-hoc tag),
matching the middleware's own requirement, and counts against that token's
monthly ceiling.

## Setup

```bash
npm install
npm run build
```

## Configure in Claude Code

```bash
claude mcp add westrock --scope user -- node "C:\Users\ahuja\Westrock\mcp-westrock-claude\dist\index.js"
```

## Environment overrides

| Variable | Default |
|---|---|
| `ZCLIENTS_ROOT` | `C:\Users\ahuja\My ShareSync\P-Homes\zclients` |
| `BDB_ENV` | `C:\Users\ahuja\Westrock\bdb-access\bdb-db-readonly.env` |
| `BDB_SQL_DIR` | `C:\Users\ahuja\Westrock\bdb-access-handoff\sql` |
| `ATTOM_ENV` | `C:\Users\ahuja\.attom\env.txt` |

None of these credential files are read into chat context — the server reads
them directly from disk at startup/call time.
