@rowvyn/servicetitan-mcp 2.4.1 → 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,35 @@ 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
+
31
+ ## [2.4.2] - 2026-03-29
32
+
33
+ ### Fixed
34
+ - **README cleanup** — removed misleading "0.001% revenue accuracy" stat (replaced with "Dashboard-matched revenue"), stripped internal "Report 175" jargon throughout. No code changes.
35
+
7
36
  ## [2.4.0] - 2026-03-28
8
37
 
9
38
  ### Added
@@ -210,6 +239,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/), and this
210
239
  - Generated TOOLS.md tool catalog
211
240
  - `.env.example` with all environment variables documented
212
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
213
244
  [2.3.1]: https://github.com/montrellcruse/servicetitan-mcp/compare/v2.3.0...v2.3.1
214
245
  [2.4.0]: https://github.com/montrellcruse/servicetitan-mcp/compare/v2.3.1...v2.4.0
215
246
  [2.3.0]: https://github.com/montrellcruse/servicetitan-mcp/compare/v2.2.0...v2.3.0
package/README.md CHANGED
@@ -20,7 +20,7 @@ The only MCP server for the ServiceTitan API — 467 tools across 15 domains, pl
20
20
  - **ServiceTitan has no official MCP server** or developer tooling beyond REST docs
21
21
  - **Raw API access is friction-heavy** — OAuth token management, module-prefix routing, pagination, and response parsing all fall on you
22
22
  - **This server handles all of that** and adds 10 intelligence tools that aggregate multiple endpoints into operational insights
23
- - **Revenue accuracy within 0.001% of ServiceTitan's own dashboard** (verified on production data using Report 175 the same source ST's internal engine uses)
23
+ - **Dashboard-matched revenue** verified on production data using the same Reporting API source that powers ST's own dashboard
24
24
 
25
25
  ---
26
26
 
@@ -28,7 +28,7 @@ The only MCP server for the ServiceTitan API — 467 tools across 15 domains, pl
28
28
 
29
29
  - **467 tools across 15 domains** — CRM, dispatch, accounting, payroll, inventory, marketing, and more
30
30
  - **10 intelligence tools** — composite analytics that aggregate multiple API calls into revenue summaries, ops snapshots, technician scorecards, and more
31
- - **Dashboard-accurate revenue** — `intel_revenue_summary` uses Report 175 to match ST's dashboard within 0.001%
31
+ - **Dashboard-matched revenue** — `intel_revenue_summary` pulls from the same source as ST's own dashboard
32
32
  - **Read-only by default** — `ST_READONLY=true` out of the box; write tools only activate when you're ready
33
33
  - **Safety layer** — confirmation workflow for writes/deletes, audit logging with sensitive field redaction
34
34
  - **Domain filtering** — expose only the tool groups you need via `ST_DOMAINS`
@@ -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
@@ -183,7 +186,7 @@ The real differentiator. These 10 tools aggregate multiple API calls and report
183
186
 
184
187
  | Tool | What It Returns |
185
188
  |------|----------------|
186
- | `intel_revenue_summary` | Dashboard-accurate revenue by business unit using Report 175 — matches ServiceTitan within 0.001%. Includes completed revenue, non-job revenue, adjustments, collections, and BU productivity rollups. |
189
+ | `intel_revenue_summary` | Dashboard-matched revenue by business unit. Includes completed revenue, non-job revenue, adjustments, collections, and BU productivity rollups. |
187
190
  | `intel_daily_snapshot` | 6-metric same-day ops briefing: revenue-to-date, jobs in progress, call outcomes, bookings, open estimates, and upcoming next-day jobs. |
188
191
  | `intel_technician_scorecard` | Per-tech jobs, revenue, avg ticket, productivity, lead gen, membership close rate, and sales from both tech and marketing leads — with team averages. |
189
192
  | `intel_membership_health` | Active memberships, signups, cancellations, renewals, retention rate, invoiced revenue, and conversion by business unit. |
@@ -198,7 +201,7 @@ These tools are why this server exists. Raw CRUD tools are table stakes. Intelli
198
201
 
199
202
  ### Revenue Accuracy
200
203
 
201
- `intel_revenue_summary` uses ServiceTitan's **Reporting API** (Report 175: "Revenue") to calculate totals. This is the same source ST's own dashboard uses — which means it includes:
204
+ `intel_revenue_summary` uses ServiceTitan's **Reporting API** to calculate totals. This is the same source ST's own dashboard uses — which means it includes:
202
205
 
203
206
  - **Completed Revenue** — revenue from completed jobs
204
207
  - **Non-Job Revenue** — membership fees, add-ons, and other income not tied to a specific job
@@ -299,7 +302,7 @@ The CLI and this MCP server share the same design philosophy: push the business
299
302
 
300
303
  | Feature | This Server | Community MCP Servers |
301
304
  |---------|------------|----------------------|
302
- | Revenue accuracy | ✅ 0.001% of dashboard | ❌ $17–21K off per period |
305
+ | Revenue accuracy | ✅ Dashboard-matched | ❌ $17–21K off per period |
303
306
  | Intelligence tools | ✅ 10 tools | ❌ None |
304
307
  | Domain coverage | ✅ 467 tools, 15 domains | ⚠️ 10–50 tools |
305
308
  | Safety layer | ✅ Read-only default, audit log | ❌ None |
@@ -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).