@rowvyn/servicetitan-mcp 2.4.2 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,30 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project adheres to [Semantic Versioning](https://semver.org/).
6
6
 
7
+ ## [2.5.0] - 2026-04-02
8
+
9
+ ### Performance
10
+ - **HTTP keep-alive + connection pooling** — shared `https.Agent` with `keepAlive: true`, `maxSockets: 32` eliminates TLS handshake overhead on consecutive API calls.
11
+ - **Auth pre-warming** — `client.prewarm()` called at server startup fetches and caches the OAuth token before the first tool execution, saving ~1-2s on cold starts.
12
+ - **Parallel invoice tracking** — Reports 2281 and 2282 now fetched concurrently via `Promise.all()` instead of sequentially.
13
+ - **Parallel estimate pipeline** — estimate pagination parallelized (6.49s → 1.50s).
14
+ - **`fetchAllPagesBlind` helper** — fires all `maxPages` page requests simultaneously without a probe step to determine `totalCount` first. Applied to bookings, estimates, invoices, and payments pagination. Saves one sequential round-trip per paginated call.
15
+ - **Sequential campaign calls** — `/v3/calls` endpoint uses sequential `fetchAllPages` instead of parallel. ServiceTitan's calls API exhibits extreme concurrency sensitivity (even 2 concurrent requests trigger rate-limiting and inflate results). Sequential is the only reliable approach.
16
+ - **Report 165 removal** — `technician_scorecard` no longer fetches Report 165 (redundant with `ConvertedJobs` field from Report 168). Reduces parallel POST calls from 5 to 4 on the default path.
17
+
18
+ ### Added
19
+ - **`includeServiceRevenue`** parameter on `intel_membership_health` — opt-in invoice pagination for service revenue breakdown. Default: `false` (saves ~2-4s).
20
+ - **`includeProductivityMetrics`** parameter on `intel_revenue_summary` — opt-in Report 177 fetch for BU-level productivity metrics. Default: `false` (saves ~0.5-1s).
21
+ - **`includeExtendedMetrics`** parameter on `intel_technician_scorecard` — opt-in Reports 171/173/174 for revenue-per-hour, billable efficiency, and recall data. Default: `false` (saves ~1-2s).
22
+ - **`fetchAllPagesWithTotal`** helper — variant that returns both items and `totalCount` for callers that need the count.
23
+
24
+ ### Changed
25
+ - **Score improvement** — baseline score improved from 0.91 to 0.92-0.94 (typical), up to 1.24 on fast ServiceTitan API days. All 25 ground truth questions still pass.
26
+ - **Non-campaign tool latency** — `revenue_summary` 2.7-3.3s, `technician_scorecard` 2.1-2.7s, `membership_health` 2.0-2.8s, `estimate_pipeline` 1.5-1.8s, `invoice_tracking` 2.2-4.4s.
27
+
28
+ ### Fixed
29
+ - **Test suite** — 12 test failures fixed for new opt-in parameter defaults and `fetchAllPagesBlind` mock compatibility. All 260 tests passing.
30
+
7
31
  ## [2.4.2] - 2026-03-29
8
32
 
9
33
  ### Fixed
@@ -215,6 +239,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/), and this
215
239
  - Generated TOOLS.md tool catalog
216
240
  - `.env.example` with all environment variables documented
217
241
 
242
+ [2.5.0]: https://github.com/montrellcruse/servicetitan-mcp/compare/v2.4.2...v2.5.0
243
+ [2.4.2]: https://github.com/montrellcruse/servicetitan-mcp/compare/v2.4.0...v2.4.2
218
244
  [2.3.1]: https://github.com/montrellcruse/servicetitan-mcp/compare/v2.3.0...v2.3.1
219
245
  [2.4.0]: https://github.com/montrellcruse/servicetitan-mcp/compare/v2.3.1...v2.4.0
220
246
  [2.3.0]: https://github.com/montrellcruse/servicetitan-mcp/compare/v2.2.0...v2.3.0
package/README.md CHANGED
@@ -60,13 +60,16 @@ No install needed — runs directly:
60
60
  "ST_CLIENT_ID": "your-client-id",
61
61
  "ST_CLIENT_SECRET": "your-client-secret",
62
62
  "ST_APP_KEY": "your-app-key",
63
- "ST_TENANT_ID": "your-tenant-id"
63
+ "ST_TENANT_ID": "your-tenant-id",
64
+ "ST_ENVIRONMENT": "production"
64
65
  }
65
66
  }
66
67
  }
67
68
  }
68
69
  ```
69
70
 
71
+ > ⚠️ **`ST_ENVIRONMENT` defaults to `integration`.** If you're connecting to a live ServiceTitan account, you **must** set `ST_ENVIRONMENT` to `production` or you'll get silent auth failures and empty results.
72
+
70
73
  ### Install globally
71
74
 
72
75
  ```bash
@@ -330,6 +333,53 @@ npm run start # run compiled server
330
333
 
331
334
  ---
332
335
 
336
+ ## Troubleshooting
337
+
338
+ ### npm permission errors (EACCES)
339
+
340
+ If you see `EACCES: permission denied` errors when Claude Desktop tries to start the server, your npm cache directory is likely owned by root (common when Node was installed with `sudo`).
341
+
342
+ **Fix:**
343
+
344
+ ```bash
345
+ sudo chown -R $(whoami) ~/.npm
346
+ ```
347
+
348
+ Then restart Claude Desktop.
349
+
350
+ ### Server won't start / "Could not connect to MCP server"
351
+
352
+ 1. **Test outside Claude Desktop first:**
353
+ ```bash
354
+ npx -y @rowvyn/servicetitan-mcp
355
+ ```
356
+ If this fails, the issue is with Node, npm, or your environment — not Claude Desktop.
357
+
358
+ 2. **Check Node version:** `node -v` — requires Node 22 or newer.
359
+
360
+ 3. **Check for conflicting MCP installs:** If you previously installed a different ServiceTitan MCP server, remove it:
361
+ ```bash
362
+ npm ls -g --depth=0 | grep -i servicetitan
363
+ npm uninstall -g <old-package-name>
364
+ npx clear-npx-cache
365
+ ```
366
+
367
+ 4. **Verify your `claude_desktop_config.json`** has no leftover entries from a previous MCP server. Only one `servicetitan` entry should exist under `mcpServers`.
368
+
369
+ ### Auth failures / $0 revenue / empty results
370
+
371
+ - **Set `ST_ENVIRONMENT` to `production`.** This is the #1 cause. The default is `integration`, which authenticates against ServiceTitan's sandbox — not your live account. You'll get valid auth tokens that return zero data.
372
+ - **Verify credentials match:** `ST_CLIENT_ID` and `ST_CLIENT_SECRET` must be from the same ServiceTitan app. You can't mix credentials from different apps.
373
+ - **Check `ST_TENANT_ID`:** Must match the tenant associated with your app in the ServiceTitan developer portal.
374
+
375
+ ### Claude Desktop logs
376
+
377
+ Claude Desktop writes MCP server logs to:
378
+ - **macOS:** `~/Library/Logs/Claude/mcp*.log`
379
+ - **Windows:** `%APPDATA%\Claude\logs\mcp*.log`
380
+
381
+ ---
382
+
333
383
  ## Contributing
334
384
 
335
385
  See [CONTRIBUTING.md](CONTRIBUTING.md).