@elitedcs/ghl-mcp 3.4.0 → 3.4.1

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
@@ -1,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.4.1 — fixes from real-world testing of v3.4.0 tools
4
+
5
+ **175 tools across 38 modules. Bundle: 275.2 KB.**
6
+
7
+ Two bugs caught when exercising v3.4.0's `health_check` and `validate_workflow` end-to-end against a real sandbox workflow:
8
+
9
+ 1. **`health_check` API-key probe used the wrong endpoint.** `/locations/search` is agency-level — sub-account Private Integration keys (the kind buyers have) get 403, not 200, even when the key is fine. Fixed to use `/locations/{locationId}` which sub-account keys can call. Also added explicit handling for 403 with a clearer message ("doesn't have access to this location" vs. just "limited").
10
+
11
+ 2. **`validate_workflow` errored when checking workflow references.** Called `builderClient.listWorkflowsFull()`, which doesn't exist — the actual method is `listWorkflows()`. Any workflow containing a `remove_from_workflow` action or a trigger with an `add_to_workflow` reference would crash the validator. Fixed.
12
+
13
+ Also: `src/index.ts` startup `validateApiKey()` had the same wrong-endpoint bug as `health_check`; fixed for consistency. Buyers will now see "API key validated" or a clear 403 message on startup instead of silent ambiguity.
14
+
15
+ ### Verified end-to-end
16
+ Re-ran the spawn-handshake test against QA Test Clinic v3:
17
+ - `health_check` returns 5/5 PASS ("All systems go.")
18
+ - `validate_workflow` on the CLL Onboarding Form Submitted workflow correctly scans 2 references (form.id + self-referencing workflow.id), reports 0 issues, surfaces the self-reference as an informational note.
19
+
20
+ ### Files changed
21
+ - `src/tools/diagnostics.ts` — endpoint fix + 403 handling
22
+ - `src/tools/validators.ts` — method name fix
23
+ - `src/index.ts` — same endpoint fix in startup probe
24
+
3
25
  ## 3.4.0 — health_check tool + validate_workflow expansion + smoke-test CI
4
26
 
5
27
  **175 tools across 38 modules. Bundle: 274.6 KB.**
package/dist/index.js CHANGED
@@ -31,7 +31,7 @@ var require_package = __commonJS({
31
31
  "package.json"(exports2, module2) {
32
32
  module2.exports = {
33
33
  name: "@elitedcs/ghl-mcp",
34
- version: "3.4.0",
34
+ version: "3.4.1",
35
35
  description: "GoHighLevel MCP Server for Claude. 175 tools \u2014 full CRM, automation, marketing control, and the only programmatic GHL workflow builder.",
36
36
  main: "dist/index.js",
37
37
  bin: {
@@ -6135,7 +6135,7 @@ function registerValidatorTools(server2, client, builderClient) {
6135
6135
  fetches.users = client.get("/users/", { params: { locationId: locationId2 } });
6136
6136
  }
6137
6137
  if (refCategories.has("workflow")) {
6138
- fetches.workflows = builderClient.listWorkflowsFull();
6138
+ fetches.workflows = builderClient.listWorkflows(200);
6139
6139
  }
6140
6140
  if (refCategories.has("form")) {
6141
6141
  fetches.forms = client.get("/forms/", { params: { locationId: locationId2 } });
@@ -6304,8 +6304,12 @@ function registerDiagnosticTools(server2, installedVersion, client, builderClien
6304
6304
  const checks = [];
6305
6305
  const versionPromise = getVersionStatus(installedVersion);
6306
6306
  const apiKeyPromise = (async () => {
6307
+ const locId = client.defaultLocationId;
6308
+ if (!locId) {
6309
+ return { name: "GHL API key", status: "warn", detail: `Can't validate without a default location ID. Set GHL_LOCATION_ID or run setup_ghl_mcp.` };
6310
+ }
6307
6311
  try {
6308
- const response = await fetch("https://services.leadconnectorhq.com/locations/search", {
6312
+ const response = await fetch(`https://services.leadconnectorhq.com/locations/${locId}`, {
6309
6313
  method: "GET",
6310
6314
  headers: {
6311
6315
  Authorization: `Bearer ${client.getApiKey()}`,
@@ -6318,8 +6322,11 @@ function registerDiagnosticTools(server2, installedVersion, client, builderClien
6318
6322
  if (response.status === 401) {
6319
6323
  return { name: "GHL API key", status: "fail", detail: `401 Unauthorized \u2014 key ${client.getApiKeyPrefix()} is invalid or revoked. Run setup_ghl_mcp with a fresh key.` };
6320
6324
  }
6325
+ if (response.status === 403) {
6326
+ return { name: "GHL API key", status: "fail", detail: `403 Forbidden \u2014 key ${client.getApiKeyPrefix()} doesn't have access to location ${locId}. The key may belong to a different sub-account.` };
6327
+ }
6321
6328
  if (!response.ok) {
6322
- return { name: "GHL API key", status: "warn", detail: `HTTP ${response.status} from /locations/search \u2014 key may be limited or GHL is having issues.` };
6329
+ return { name: "GHL API key", status: "warn", detail: `HTTP ${response.status} reading /locations/${locId} \u2014 key may be limited or GHL is having issues.` };
6323
6330
  }
6324
6331
  return { name: "GHL API key", status: "pass", detail: `Valid (key ${client.getApiKeyPrefix()}).` };
6325
6332
  } catch (error) {
@@ -6767,9 +6774,9 @@ if (inBootstrapMode) {
6767
6774
  }
6768
6775
  }
6769
6776
  async function validateApiKey() {
6770
- if (!apiKey) return;
6777
+ if (!apiKey || !locationId) return;
6771
6778
  try {
6772
- const response = await fetch("https://services.leadconnectorhq.com/locations/search", {
6779
+ const response = await fetch(`https://services.leadconnectorhq.com/locations/${locationId}`, {
6773
6780
  method: "GET",
6774
6781
  headers: {
6775
6782
  Authorization: `Bearer ${apiKey}`,
@@ -6781,6 +6788,9 @@ async function validateApiKey() {
6781
6788
  });
6782
6789
  if (response.status === 401) {
6783
6790
  process.stderr.write("[ghl-mcp] WARNING: API key is invalid (401 Unauthorized). Tools will fail.\n");
6791
+ } else if (response.status === 403) {
6792
+ process.stderr.write(`[ghl-mcp] WARNING: API key doesn't have access to location ${locationId} (403 Forbidden).
6793
+ `);
6784
6794
  } else if (response.ok) {
6785
6795
  process.stderr.write("[ghl-mcp] API key validated.\n");
6786
6796
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elitedcs/ghl-mcp",
3
- "version": "3.4.0",
3
+ "version": "3.4.1",
4
4
  "description": "GoHighLevel MCP Server for Claude. 175 tools — full CRM, automation, marketing control, and the only programmatic GHL workflow builder.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {