🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

ghl-master

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ghl-master

GHL Master by Sales Factory Agency — GoHighLevel MCP Server for Claude. 214 tools: full CRM, automation, marketing control, and a programmatic GHL workflow builder, multi-tenant across client accounts.

latest
npmnpm
Version
1.0.9
Version published
Weekly downloads
196
250%
Maintainers
1
Weekly downloads
 
Created
Source

GHL Master by Sales Factory Agency — GoHighLevel MCP Server

Full GoHighLevel API access for Claude. 620+ tools across 40+ modules — manage contacts, conversations, pipelines, calendars, funnels, workflows, invoices, custom objects, webhooks, and more. Includes the programmatic workflow builder (with ready-made recipes + auto-verify), landing-page editing, Conversation AI & Voice AI agents, Knowledge Base, SaaS/rebilling, Store, Proposals, form & pipeline builders, bulk operations, account export, and workflow cloning — capabilities no other GHL tool offers. Multi-tenant: one install can run the workflow builder across multiple clients' GHL accounts. Private by design: it runs locally — your access token and CRM data never pass through a third-party server.

Distributed via npm as ghl-master. Buyers install with one config block — no git, no Node.js setup, no terminal commands. Updates flow automatically (npx @latest re-resolves on every Claude restart).

Works with both the Claude Desktop App and Claude Code terminal — your choice.

License required. Buy at ghl.salesfactoryagency.com/buy — one-time $97, three-machine activation, no subscription.

Built by GHL Master by Sales Factory Agency.

What Makes This Different

Most GHL integrations give you read access and basic CRUD. This server goes far beyond that — it includes capabilities that don't exist anywhere else, built on reverse-engineered internal APIs that GHL's public API doesn't expose.

Exclusive FeatureWhy It Matters
Programmatic Workflow BuilderThe only tool on the market that can create, edit, and publish GHL workflows via code. GHL's public API has no workflow write endpoints — this uses their internal backend API (the same one their UI calls) to give Claude full workflow CRUD. Build entire automation sequences from a conversation.
Deep Workflow CloningClone any workflow with full UUID remapping — every action, trigger, branch, and internal reference gets new IDs. No other tool can duplicate a workflow programmatically without ID collisions.
Funnel & Page EditorRead and edit funnel page content — sections, elements, rows, CSS, tracking codes. Goes beyond the public API's list-only access.
Form BuilderFull form CRUD including field management, conditional logic, and auto-responder configuration via internal API.
Pipeline BuilderCreate, edit, and delete pipelines and stages via internal API. The public API only lists pipelines — this lets Claude build them.
Template DeploymentDeploy a complete sub-account setup (tags, custom fields, pipelines, workflows, forms) from a single template. Set up a new client in minutes instead of hours.
Multi-Sub-Account Token RegistryRegister multiple sub-accounts with their own API keys. Switch locations mid-session and the API key swaps automatically — no restart needed.
Full Account Export & DiffExport an entire sub-account to JSON or compare two locations side-by-side. Useful for auditing, migration, and quality control.

Everything else — CRM, conversations, calendars, invoices, bulk ops — works through GHL's official public API v2 with full read/write access.

What It Does

This MCP (Model Context Protocol) server connects Claude directly to GoHighLevel's API v2. Once installed, Claude can read and write to your GHL account — no browser, no Zapier, no middleware. Use it from the Claude Desktop App (no terminal needed) or from Claude Code in the terminal.

CapabilityWhat Claude Can Do
CRMSearch, create, update, and delete contacts. Manage tags, notes, tasks.
ConversationsRead message threads, send SMS/email/WhatsApp, update message status.
PipelineCreate and manage opportunities. Move deals through stages.
SchedulingCheck availability, book appointments, manage calendars.
AutomationFull workflow builder — create, read, edit, and publish workflows. See every action, trigger, condition, and branch. Clone workflows with deep ID remapping.
MarketingFunnel/page editor — read and edit existing funnel page content (sections, elements, CSS). Full form builder — read/edit all fields, conditional logic, auto-responder.
PipelinesFull pipeline builder — create, edit, delete pipelines. Add, remove, rename, reorder stages.
Bulk OpsBatch tag, untag, update fields, enroll in workflows, or delete contacts — all rate-limited.
BackupExport entire sub-account to JSON. Compare two locations side-by-side for auditing.
Multi-LocationSwitch between sub-accounts mid-session. Token registry stores per-location API keys for seamless switching.
BillingCreate/send/void invoices, record payments, view orders and subscriptions.
ContentManage blog posts, social media posts, courses, media files.
Custom ObjectsFull CRUD on custom object schemas and records. Manage associations.
Estimates & CouponsCreate/send estimates, manage promo codes.
WebhooksCreate and manage webhook subscriptions.
DocumentsList, send, and manage documents/contracts.
AdminView/update sub-accounts, manage custom fields, custom values, location tags, users.

Quick Start (5 minutes)

1. Buy a license

ghl.salesfactoryagency.com/buy — one-time $97. License key arrives by email within 1-2 minutes.

2. Install in Claude Desktop App

Open Claude Desktop. Click Claude menu (top-left) → Settings...DeveloperEdit Config. Paste this block (or merge into your existing mcpServers if you have other MCP servers):

{
  "mcpServers": {
    "ghl": {
      "command": "npx",
      "args": ["-y", "ghl-master@latest"]
    }
  }
}

Save the file. Quit Claude completely (Cmd+Q on Mac) and reopen.

Claude Code (terminal) instead? One command:

claude mcp add --scope user -t stdio ghl -- npx -y ghl-master@latest

Then restart Claude Code.

3. Activate

After restart, GHL Master by Sales Factory Agency is loaded but locked. Type this in Claude (replace the four placeholders with your real values):

Run setup_ghl_mcp to activate GHL Master by Sales Factory Agency:
  email: YOUR_PURCHASE_EMAIL
  license_key: YOUR_LICENSE_KEY
  ghl_api_key: YOUR_GHL_API_KEY
  ghl_location_id: YOUR_LOCATION_ID

Approve the tool call. Server validates your license, verifies your GHL credentials, writes them to a per-user config file. Quit Claude one more time and reopen — all core tools are now unlocked (620+ total with the optional Workflow Builder Firebase add-on).

4. Try it

"List my GHL contacts"
"Show my pipelines"
"What calendars do I have?"

Full step-by-step setup with screenshots: ghl.salesfactoryagency.com/firebase-guide

Get Your GHL API Key

CRITICAL: Sub-Account Level Only

Private Integrations in GHL are scoped to individual sub-accounts, NOT to the agency level. You must create a separate Private Integration inside each sub-account you want to connect. An API key created in Sub-Account A will return 403 Forbidden if you try to use it with Sub-Account B's Location ID.

Your API key can only be copied ONCE — at the moment you create the integration. After you leave that screen, the key is permanently masked and cannot be retrieved. If you lose it, you must delete the integration and create a new one.

  • Log into GoHighLevel
  • Switch into the specific sub-account you want to connect (not the agency view)
  • Go to Settings > Integrations
  • Click Private Integrations > Create Private Integration
  • Name it Claude Code MCP
  • Enable all scopes/permissions you want Claude to access
  • Immediately copy the API Key and pass it to setup_ghl_mcp as ghl_api_key — you will not be able to see it again

Find Your Location ID

Your Location ID (sub-account ID) is in the GHL URL when you'''re inside a sub-account:

https://app.gohighlevel.com/v2/location/YOUR_LOCATION_ID/dashboard

Enable Workflow Builder (Optional)

The builder + cloner + validator tools (workflow builder, funnel builder, form builder, pipeline builder, workflow cloner, validate_workflow) use GHL'''s internal API and require Firebase credentials. Without them, the rest of the tools work fine — you just won'''t have workflow/funnel/form/pipeline editing.

Grab the three values from your GHL browser session, then re-run setup_ghl_mcp with them:

  • Open app.gohighlevel.com in Chrome (or any Chromium browser), log in.
  • Open DevTools (Cmd+Opt+I on Mac, F12 on Windows) → Application tab → IndexedDB in the left panel.
  • Expand: firebaseLocalStorageDbfirebaseLocalStorage.
  • Find the row whose key starts with firebase:authUser:.
  • The part between authUser: and :[DEFAULT] is your ghl_firebase_api_key (starts with AIza).
  • Inside that row's value object: uid is your ghl_user_id.
  • Inside value.stsTokenManager.refreshToken is your ghl_firebase_refresh_token.

Then in Claude:

Re-run setup_ghl_mcp with workflow builder:
  email: YOUR_PURCHASE_EMAIL
  license_key: YOUR_LICENSE_KEY
  ghl_api_key: YOUR_GHL_API_KEY
  ghl_location_id: YOUR_LOCATION_ID
  ghl_user_id: FROM_STEP_6
  ghl_firebase_api_key: FROM_STEP_5
  ghl_firebase_refresh_token: FROM_STEP_7

Firebase refresh tokens can rotate. If workflow tools stop working after a few weeks, repeat steps 1–7 and re-run setup_ghl_mcp with fresh values.

Working in Clients' Accounts (Multi-Tenant)

The public-API tools work in any sub-account you have a Private Integration key for. The workflow builder (and every Firebase-gated tool) is different: GHL Firebase refresh tokens are company-scoped, so your own token can't build workflows inside a client's GHL — even if you're an admin user there. Without the client's own Firebase, those accounts are effectively read-only.

To unlock full builder access across multiple clients from one install:

  • Register the client's sub-account key so the public API works there:

    register_location
      locationId: CLIENT_LOCATION_ID
      name: "Client Name"
      apiKey: pit-...   (a Private Integration created INSIDE the client's sub-account)
    

    This auto-detects and stores the owning companyId.

  • Capture the client's Firebase values from a browser session logged into their account (same DevTools steps 1–7 above, but while viewing the client's GHL).

  • Register the client's company Firebase:

    register_company_firebase
      companyId: CLIENT_COMPANY_ID         (shown in register_location's output)
      name: "Client Name"
      ghl_firebase_refresh_token: FROM_STEP_7
      ghl_user_id: FROM_STEP_6
      test_location_id: CLIENT_LOCATION_ID  (optional — runs a live check that it works)
    
  • Switch and build: switch_location CLIENT_LOCATION_ID swaps both the API key and the Firebase auth automatically. The workflow builder now operates in the client's account. Switching back to your own location restores your home Firebase.

list_registered_locations shows every location, its company, and which companies have Firebase wired up. health_check reports the active company. Rotated tokens are saved back to the correct client, never overwriting your own.

Tools (190)

v3.10.0 adds Email Templates (list_email_templates, create_email_template, update_email_template) — Claude can now create new HTML email templates and save content into them via the public API. Templates power both standalone marketing emails and workflow email actions. Delete + rename remain UI-only (no public-API endpoint exists).

CRM & Contacts (15 tools)

ToolWhat It Does
search_contactsSearch contacts by name, email, phone, or tag
get_contactGet full contact details by ID
create_contactCreate a new contact
update_contactUpdate contact fields
delete_contactDelete a contact
upsert_contactCreate or update a contact (match by email/phone)
add_contact_tagsAdd tags to a contact
remove_contact_tagsRemove tags from a contact
get_contact_tasksList tasks for a contact
create_contact_taskCreate a task on a contact
get_contact_notesList notes on a contact
create_contact_noteAdd a note to a contact
get_contact_appointmentsList a contact's appointments
add_contact_to_workflowAdd a contact to a workflow
remove_contact_from_workflowRemove a contact from a workflow

Conversations & Messaging (8 tools)

ToolWhat It Does
search_conversationsSearch conversation threads
get_conversationGet a specific conversation
create_conversationStart a new conversation
get_messagesRead messages in a conversation
send_messageSend SMS, email, or WhatsApp message
add_inbound_messageLog an inbound message
update_message_statusUpdate read/unread status
get_messageGet a specific message

Opportunities & Pipelines (7 tools)

ToolWhat It Does
search_opportunitiesSearch deals across pipelines
get_opportunityGet opportunity details
create_opportunityCreate a new deal
update_opportunityUpdate deal fields or move stages
delete_opportunityDelete a deal
update_opportunity_statusChange opportunity status (won/lost/open)
get_pipelinesList all pipelines and their stages

Calendars & Scheduling (11 tools)

ToolWhat It Does
get_calendarsList all calendars
get_calendarGet calendar details
create_calendarCreate a new calendar
update_calendarUpdate calendar settings
delete_calendarDelete a calendar
get_free_slotsCheck available time slots
get_calendar_eventsList events on a calendar
get_appointmentGet appointment details
create_appointmentBook an appointment
update_appointmentUpdate an appointment
delete_appointmentCancel an appointment

Locations & Sub-Accounts (15 tools)

ToolWhat It Does
get_locationGet sub-account details
update_locationUpdate sub-account settings
search_locationsSearch locations
get_location_tagsList all tags in a location
create_location_tagCreate a new tag
update_location_tagUpdate an existing tag
delete_location_tagDelete a tag
get_custom_fieldsList all custom fields
create_custom_fieldCreate a new custom field
update_custom_fieldUpdate a custom field
delete_custom_fieldDelete a custom field
get_custom_valuesList all custom values
create_custom_valueCreate a new custom value
update_custom_valueUpdate a custom value
delete_custom_valueDelete a custom value

Custom Objects (7 tools)

ToolWhat It Does
list_custom_objectsList all custom object schemas
get_custom_objectGet a custom object schema by key
search_custom_object_recordsSearch records of a custom object
get_custom_object_recordGet a single record by ID
create_custom_object_recordCreate a new record
update_custom_object_recordUpdate an existing record
delete_custom_object_recordDelete a record

Associations (3 tools)

ToolWhat It Does
list_associationsList associations for a custom object record
create_associationLink a record to a contact/opportunity/other record
delete_associationRemove an association

Invoices & Billing (8 tools)

ToolWhat It Does
list_invoicesList all invoices
get_invoiceGet invoice details
create_invoiceCreate a new invoice
update_invoiceUpdate an invoice
send_invoiceSend invoice to recipient
void_invoiceVoid an invoice
record_invoice_paymentRecord a payment against an invoice
delete_invoiceDelete an invoice

Estimates (6 tools)

ToolWhat It Does
list_estimatesList estimates/quotes
get_estimateGet estimate details
create_estimateCreate a new estimate
update_estimateUpdate an estimate
delete_estimateDelete an estimate
send_estimateSend an estimate to a contact

Coupons (5 tools)

ToolWhat It Does
list_couponsList all coupons/promo codes
get_couponGet coupon details
create_couponCreate a new coupon
update_couponUpdate a coupon
delete_couponDelete a coupon

Webhooks (5 tools)

ToolWhat It Does
list_webhooksList all webhook subscriptions
get_webhookGet webhook details
create_webhookCreate a new webhook
update_webhookUpdate a webhook
delete_webhookDelete a webhook

Documents (4 tools)

ToolWhat It Does
list_documentsList documents and contracts
get_documentGet document details and signature status
delete_documentDelete a document
send_documentSend a document for e-signature

Payments (4 tools)

ToolWhat It Does
get_ordersView all orders
get_orderGet order details
get_subscriptionsList active subscriptions
get_transactionsView transaction history

Workflow Builder (9 tools) — Internal API

This is the flagship feature. GHL's public API has zero workflow write endpoints. These tools use GHL's internal backend API — the same API their own UI calls — reverse-engineered to give Claude full workflow CRUD. No other GHL integration, Zapier connector, or third-party tool can create or edit workflows programmatically. Requires additional Firebase auth setup (see "Enable Workflow Builder" in Quick Start above).

ToolWhat It Does
list_workflows_fullList all workflows with full metadata, versions, and permissions
get_workflow_fullGet complete workflow internals: every action, trigger, condition, if/else branch, email template, SMS body
create_workflowCreate a new workflow from scratch (starts as draft)
update_workflow_actionsAdd, edit, or remove actions, triggers, and branches in an existing workflow
delete_workflow_fullPermanently delete a workflow
publish_workflowPublish a draft workflow to make it active
get_trigger_registryDiscover GHL's marketplace trigger apps (Zoom, WooCommerce, Shopify, etc.) and their available trigger templates
validate_workflowPre-flight validation: scans every action and trigger for references to pipelines, stages, custom fields, users, and other workflows; verifies each ID exists. Catches the silent-failure bug where invalid IDs make GHL skip subsequent actions
build_goal_eventBuild a correctly-shaped goal-event node. Goals sit inline in the action chain — when the goal condition fires (e.g., review_request_clicked), the configured action runs (default: exit the workflow). Returns a workflow_goal node ready to wire into your actions array

What you can build: Complete automation sequences — lead nurture drip campaigns, appointment reminder sequences, onboarding flows, re-engagement workflows, internal notification chains, conditional exit workflows with goal events. Tell Claude what you want and it builds the workflow action by action.

Supported action types: sms, email, add_contact_tag, remove_contact_tag, update_contact_field, wait, if_else, webhook, create_opportunity, custom_code, add_notes, internal_notification, task_notification, remove_from_workflow, workflow_goal, and more.

Supported trigger types: All 57 native GHL trigger types are deeply typed with their own Zod variant. 42 have full field-path documentation (opportunity_*, form_submission, contact_changed, survey_submission, birthday_reminder, mailgun_email_event, and 36 others). 4 have partial docs, 2 are fieldless by design, 9 have type-only discrimination pending field-path capture. A permissive fallback handles any future trigger types GHL ships, so reads never crash. Plus 434 marketplace trigger entries across 85 third-party apps — query them via get_trigger_registry.

Pipeline Builder (5 tools) — Internal API

Also uses GHL's internal API. The public API only lists pipelines — this lets Claude create, edit, and delete pipelines and their stages.

ToolWhat It Does
list_pipelines_fullList all pipelines with full stage details, positions, and display settings
get_pipeline_fullGet a single pipeline with complete stage configuration
create_pipelineCreate a new pipeline with stages
update_pipelineUpdate name, add/remove/rename/reorder stages
delete_pipelinePermanently delete a pipeline

Bulk Operations (5 tools)

ToolWhat It Does
bulk_add_tagsAdd tags to multiple contacts at once (rate-limited)
bulk_remove_tagsRemove tags from multiple contacts (rate-limited)
bulk_update_contactsUpdate the same fields on multiple contacts (rate-limited)
bulk_add_to_workflowEnroll multiple contacts into a workflow (rate-limited)
bulk_delete_contactsDelete multiple contacts (rate-limited, requires safety confirmation)

Account Export & Comparison (2 tools)

ToolWhat It Does
export_accountFull sub-account backup — contacts, pipelines, workflows, funnels, forms, fields, tags, calendars, users
compare_locationsSide-by-side diff of two sub-accounts for auditing or migration

Location Switcher & Token Registry (6 tools)

ToolWhat It Does
get_current_locationShow which sub-account is active
switch_locationSwitch to a different sub-account mid-session (auto-swaps API key from registry)
list_available_locationsList all accessible sub-accounts
register_locationAdd a sub-account and its API key to the token registry
unregister_locationRemove a sub-account from the token registry
list_registered_locationsList all sub-accounts stored in the token registry

Workflow Cloner (1 tool)

Deep-clones a workflow with full UUID remapping. Every action, trigger, branch, and internal cross-reference gets a new unique ID. GHL has no built-in way to duplicate a workflow programmatically — this is the only tool that can.

ToolWhat It Does
clone_workflowDeep clone a workflow with new UUIDs for all actions, triggers, and references

Template Deployer (3 tools)

Deploy a complete sub-account setup from a pre-built template — tags, custom fields, pipelines, workflows, and forms — in one step. Claude walks the user through a questionnaire, then deploys everything. Includes dry-run mode to preview changes before applying.

ToolWhat It Does
list_templatesList available setup templates (clinic, med spa, dental, etc.)
get_template_questionnaireGet the questionnaire for a template — present to user conversationally
deploy_templateDeploy a complete sub-account setup from a template (tags, fields, pipelines, workflows, forms). Supports dry-run mode.

Setup & Diagnostics (3 tools)

ToolWhat It Does
get_mcp_versionCheck installed version against the latest published to npm. Confirms an upgrade landed after restarting Claude. Available even before GHL credentials are configured.
health_checkRun a full health check: npm registry + version status, GHL API key validity, default location reachability, Firebase auth status, token registry presence. Use when something feels broken.
enable_workflow_builderAdd Firebase credentials to an existing install to unlock 49 additional Firebase-gated tools (workflow builder, funnel builder, form builder, pipeline builder, workflow cloner, smart lists, reputation, email campaigns, email templates, memberships, validate_workflow). No need to re-enter license / API key / location ID. Run this any time after the basic setup, on the buyer's schedule.

Other Modules

ModuleToolsWhat It Does
Social Planner5Create, list, delete posts, view connected accounts
Businesses5Full CRUD on business entities
Blogs5Posts, authors, categories, URL slugs
Funnels (public API)2List funnels and their pages
Forms (public API)2List forms and view submissions
Surveys2List surveys and view submissions
Users2List and view team members
Media2Browse and delete media files
Campaigns1List campaigns
Workflows (public API)1List all workflows
Courses1List courses
Emails1List email campaigns
Trigger Links1List trigger links

How It Works

┌──────────────────┐   ┌──────────────────┐
│  Claude Desktop  │   │  Claude Code     │
│  App (GUI)       │   │  (Terminal)      │
└────────┬─────────┘   └────────┬─────────┘
         │                      │
         └──────────┬───────────┘
                    │ MCP Protocol (stdio)
┌───────────────────┴─────────────────────┐
│            GHL MCP SERVER               │
│                                         │
│  ┌──────────┐ ┌──────────┐ ┌────────┐  │
│  │ Contacts │ │ Calendar │ │Invoices│  │
│  │ 15 tools │ │ 11 tools │ │8 tools │  │
│  └────┬─────┘ └────┬─────┘ └───┬────┘  │
│       └─────────────┼───────────┘       │
│              ┌──────┴──────┐            │
│              │  GHL Client │            │
│              └──────┬──────┘            │
├─────────────────────┼───────────────────┤
│                     ↓                   │
│        GoHighLevel API v2               │
│   https://services.leadconnectorhq.com  │
└─────────────────────────────────────────┘

Architecture

  • src/index.ts — MCP server entry, startup API key validation, tool registration.
  • src/ghl-client.ts — HTTP client for GHL API v2. Returns Promise<unknown> (no generic as T casts). Automatic retry with exponential backoff on 429/5xx/network errors. 30-second timeout with clear error messages.
  • src/workflow-builder-client.ts — Internal API client for workflow CRUD. Firebase auth with thread-safe token refresh (promise lock), retry/backoff, Zod-validated WorkflowFull responses, and pre-flight validateActionChain() that catches common action attribute errors before GHL can silently fail.
  • src/api-schemas.ts — Zod response schemas for contacts, pipelines, and calendars. Runtime validation on the most-used API paths.
  • src/workflow-action-types.ts — Discriminated union types for all 11 documented workflow action types. Compile-time enforcement of action-specific attributes (SMS needs body, email needs subject+html, etc.).
  • src/tool-helpers.tssafeTool() wrapper (automatic try/catch + JSON formatting for 127 tools), response helpers, error formatting.
  • src/token-registry.ts — Per-location API key storage, Zod-validated on load with corruption backup.
  • src/tools/index.ts — Type-safe registry array. Compiler catches missing tool registrations.
  • src/tools/*.ts — One file per GHL domain. Most use safeTool() for zero-boilerplate handlers.

Build System

Uses esbuild for production builds (not tsc). TypeScript 5.9.3 + MCP SDK types cause tsc to run out of memory at 4GB+. esbuild bundles in ~5ms with zero memory issues.

npm run build    # esbuild → dist/index.js (~212KB)
npm run dev      # tsc --watch (type-checking only)

Data Flow

User prompt → Claude Code → MCP tool call → GHL Client → GHL API → JSON response → Claude Code → User

Every tool returns structured JSON. Claude interprets the response and presents it naturally. No data is stored locally — it's a pass-through to GHL's API.

Project Structure

ghl-command-mcp/
├── src/
│   ├── index.ts                   # MCP server entry point + startup validation
│   ├── ghl-client.ts              # GHL API v2 HTTP client (retry/backoff, returns unknown)
│   ├── workflow-builder-client.ts # Internal API client (Firebase auth, Zod-validated responses)
│   ├── workflow-action-types.ts   # Discriminated union types for workflow actions
│   ├── api-schemas.ts             # Zod response schemas for contacts, pipelines, calendars
│   ├── token-registry.ts          # Per-location API key storage (Zod-validated on load)
│   ├── tool-helpers.ts            # safeTool() wrapper, response helpers, error formatting
│   └── tools/
│       ├── index.ts               # Type-safe tool registry (compiler-checked)
│       ├── contacts.ts            # 15 tools — CRM & contact management
│       ├── conversations.ts       # 8 tools — messaging (SMS, email, WhatsApp)
│       ├── opportunities.ts       # 7 tools — pipeline & deal management
│       ├── calendars.ts           # 11 tools — scheduling & appointments
│       ├── locations.ts           # 15 tools — sub-accounts, custom fields/values, tags
│       ├── invoices.ts            # 8 tools — invoicing & payment recording
│       ├── custom-objects.ts      # 7 tools — custom object schema & record CRUD
│       ├── estimates.ts           # 6 tools — estimates/quotes
│       ├── social-planner.ts      # 5 tools — social media management
│       ├── businesses.ts          # 5 tools — business entity management
│       ├── blogs.ts               # 5 tools — blog management
│       ├── coupons.ts             # 5 tools — promo code management
│       ├── webhooks.ts            # 5 tools — webhook subscriptions
│       ├── payments.ts            # 4 tools — orders, subscriptions, transactions
│       ├── documents.ts           # 4 tools — document & contract management
│       ├── associations.ts        # 3 tools — custom object associations
│       ├── funnels.ts             # 2 tools — funnel & page listing
│       ├── forms.ts               # 2 tools — forms & submissions
│       ├── surveys.ts             # 2 tools — surveys & submissions
│       ├── users.ts               # 2 tools — team members
│       ├── media.ts               # 2 tools — media file management
│       ├── campaigns.ts           # 1 tool  — campaign listing
│       ├── workflows.ts           # 1 tool  — workflow listing
│       ├── courses.ts             # 1 tool  — course listing
│       ├── emails.ts              # 1 tool  — email campaign listing
│       ├── trigger-links.ts       # 1 tool  — trigger link listing
│       ├── workflow-builder.ts    # 6 tools — full workflow CRUD (internal API)
│       ├── funnel-builder.ts      # 10 tools — funnel/page builder (internal API)
│       ├── form-builder.ts        # 5 tools — form builder (internal API)
│       ├── pipeline-builder.ts    # 5 tools — pipeline/stage builder (internal API)
│       ├── bulk-operations.ts     # 5 tools — batch contact operations
│       ├── account-export.ts      # 2 tools — backup & location comparison
│       ├── workflow-cloner.ts     # 1 tool  — deep workflow cloning
│       ├── location-switcher.ts   # 6 tools — multi-location support + token registry
│       └── template-deployer.ts   # 3 tools — deploy sub-account from template (Zod-validated)
├── templates/
│   ├── clinic-medspa.json         # Clinic/Med Spa blueprint
│   └── action-schemas.json        # Mandatory workflow action attribute schemas
├── dist/                          # Compiled JavaScript (npm-published bundle)
├── bin/ghl-mcp.js                 # npm bin entry point
├── .github/workflows/publish.yml  # GitHub Actions npm-publish workflow
├── package.json                   # ghl-master
├── tsconfig.json
├── CLAUDE.md                      # Claude Code project instructions
├── CHANGELOG.md
├── CONTRIBUTING.md                # Contributor guide
├── .gitignore
└── README.md
# Legacy (kept for self-hosted dev workflows; buyers don't need these):
# setup.sh, setup-wizard.mjs, start-mcp.example.sh

Known Limitations

These are GHL features the MCP server does not currently support. In most cases, the GHL API either doesn't expose these endpoints or the feature requires browser-level interaction.

AreaWhat's Missing
Contact deduplicationNo merge or dedup tool. search_contacts can find potential duplicates by name/email/phone, but merging must be done manually in the GHL UI.
Account auditingNo one-click "find what's broken" scanner. export_account dumps full sub-account data and compare_locations diffs two accounts — Claude can analyze the output to spot issues, but it's not a turnkey audit button.
SMS/email templatesNo template CRUD. You can send messages and build email actions in workflows, but managing reusable message templates isn't supported.
Payment gateway configRead-only access to orders, subscriptions, and transactions. No Stripe/payment gateway setup or configuration.
Phone & call trackingNo call tools. VoIP, call tracking, and phone number management are not available via the API.
Memberships & communitiesNot supported. GHL's membership/community features don't have public API endpoints.
Reporting & analyticsNo dashboard or reporting tools. Use export_account for raw data, but there are no built-in analytics queries.
Trigger linksList only — no create, update, or delete.
CampaignsList only — no create, update, or delete.
CoursesList only — no create, update, or delete.
Workflow builder authRequires Firebase credentials extracted from browser DevTools. The refresh token may rotate, requiring re-extraction.

Contributing: If you'd like to help close any of these gaps, see CONTRIBUTING.md.

Security

This MCP server is safe to share via GitHub.

ConcernHow It's Handled
API KeysStored in a per-user credentials file (~/Library/Application Support/ghl-master/credentials.json on Mac) at chmod 0600. Never in code, never committed.
License validationOne-time check at setup_ghl_mcp against ghl.salesfactoryagency.com license server. After activation, no further phone-home.
Multi-userEach user brings their own license key + GHL API key. Complete account isolation.
ScopeThe server only talks to GHL's API and (once, at setup) the ghl.salesfactoryagency.com license server. No filesystem access beyond the credentials file, no shell commands.
PermissionsControlled by your GHL Private Integration scopes. Disable what you don't need.

Reliability & Type Safety

This server has been through a rigorous, multi-pass audit for production reliability (v2.4.0–v2.7.0). Here's what's in place:

LayerWhat It Does
Retry with backoffBoth HTTP clients automatically retry on 429 rate limits, 5xx server errors, and transient network failures (ECONNRESET, ETIMEDOUT). 3 retries with exponential backoff. Respects Retry-After headers.
Clear error messagesTimeouts show "Request timeout (30s): GET /path" instead of cryptic abort errors. API errors include status code, method, path, and response body.
Zod-validated responsesCritical API paths (contacts, pipelines, calendars, workflows) validate response structure at runtime with Zod schemas. Malformed responses throw immediately with clear errors instead of silently passing garbage.
Zod-validated configToken registry (.ghl-tokens.json) and template files are validated against Zod schemas on load. Corrupted files are backed up and reported, not silently accepted.
Pre-flight workflow validationvalidateActionChain() checks action attributes before sending to GHL — catches missing body on SMS, missing subject/html on email, missing pipelineId/stageId on create_opportunity, and more. Prevents GHL's silent failure mode where bad actions kill all subsequent steps.
Delete confirmation10 high-risk destructive operations (delete_contact, delete_workflow, delete_pipeline, delete_funnel, etc.) require confirm: "DELETE" parameter. Prevents accidental deletion.
Thread-safe token refreshFirebase token refresh uses a promise-based lock — concurrent requests share one refresh instead of racing. Failed refresh clears the cache immediately instead of leaving a stale token for 55 minutes.
Startup validationServer validates the API key at startup (non-blocking) and logs a clear warning if it's invalid.
Type-safe registrationTool modules are registered via a typed array — the compiler catches missing registrations.
Honest typesHTTP client methods return Promise<unknown>, not Promise<T>. No as T casts on JSON.parse. The type system never lies about response shapes.

Updates

Automatic. Every Claude restart, npx -y ghl-master@latest re-resolves the latest published version. When v3.0.1 ships, every buyer is on it next time they reopen Claude. Zero action required.

To pin a specific version (e.g. for stability), change @latest to @3.0.0 in your MCP config.

Contributing

Source repo is private. Contributors need an invitation from the vendor. The npm-published artifact is open; the build/source pipeline is not.

For contributors with repo access:

  • Clone the repo, run npm install
  • For dev work, set env vars in your shell or a wrapper script (env vars take priority over the credentials file — your dev workflow won't conflict with a buyer install on the same machine):
    export GHL_API_KEY=pit-your-dev-key
    export GHL_LOCATION_ID=your-test-location
    node dist/index.js
    
  • Read CONTRIBUTING.md for branching conventions, how to add tools, and PR guidelines.
  • Create a branch, run npm run build, test against a sandbox sub-account, open a PR against main.

Environment Variables

VariableRequiredDescription
GHL_API_KEYYesYour GHL Private Integration API key. Must be created inside the sub-account you're connecting to (not at the agency level). Can only be copied once at creation.
GHL_LOCATION_IDNoDefault sub-account ID. Must match the sub-account where you created the API key. Saves you from passing it with every tool call.
GHL_USER_IDNo*Your GHL user ID. Required for workflow builder tools.
GHL_FIREBASE_API_KEYNo*Firebase API key from GHL's auth system. Required for workflow builder tools.
GHL_FIREBASE_REFRESH_TOKENNo*Firebase refresh token. Required for workflow builder tools. May rotate periodically.

*Required only for the workflow builder (internal API) tools. The standard API tools work without these.

Troubleshooting

ErrorCauseFix
Only setup_ghl_mcp shows up; no other toolsBootstrap mode — credentials not yet activatedRun setup_ghl_mcp with all four required fields, then restart Claude
MCP tools don't appear (CLI)Server not registeredRun claude mcp add --scope user -t stdio ghl -- npx -y ghl-master@latest
MCP tools don't appear (Desktop App)Config missing or wrongCheck ~/Library/Application Support/Claude/claude_desktop_config.json has a ghl entry under mcpServers (see Quick Start above for the exact block)
MCP tools don't appear (Desktop App)App not restartedQuit the Claude app completely (Cmd+Q on Mac) and reopen it
License key not foundWrong email or license_keyBoth must match exactly what we have on file. Check spam for the welcome email.
License key already activated on 3 devicesActivation limit hitEmail tu-soporte@ejemplo.com to reset
locationId is requiredTool needs a location IDSet GHL_LOCATION_ID in your env, or tell Claude which location to use
GHL API Error 401Invalid or expired keyGenerate a new API key in GHL > Settings > Integrations
GHL API Error 403Key from wrong sub-accountCreate a new Private Integration inside the correct sub-account
GHL API Error 403 (alt)Missing permission scopeEdit your Private Integration in GHL and enable the required scope
GHL API Error 422Invalid request dataCheck the error message for which field is wrong
GHL API Error 429Rate limitedWait a moment and retry

About

Built by GHL Master by Sales Factory Agency — a digital marketing and automation agency specializing in GoHighLevel implementations for healthcare practices and local businesses.

Tech stack: TypeScript, Node.js, esbuild, MCP SDK, Zod, GHL API v2, Firebase Auth

Version: 2.3.0

License

MIT License — see LICENSE for full text.

Copyright (c) 2026 GHL Master by Sales Factory Agency. All rights reserved.

Keywords

mcp

FAQs

Package last updated on 31 Jul 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts