ghl-mcp-remote
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
ghl-mcp-remote
Remote MCP (Model Context Protocol) server for GoHighLevel — multi-tenant, accessible via URL, to be used from Claude or ChatGPT by any agency, without each one needing to run anything locally.
This is a separate project from the original ghl-mcp (stdio, personal/local use).
Neither one depends on the other.
Difference from the original ghl-mcp
|
| |
Transport | stdio (local process) | HTTP ( |
Tenants | 1 agency per installation, credentials in | Any number of agencies, isolated by |
"Login" |
| GHL's own authorization screen, triggered by Claude/ChatGPT |
Use | You, locally | Any company, from Claude.ai/ChatGPT, via URL |
The business code (the tools in src/tools/) is practically identical in both — only the
authentication/storage layer changes.
Related MCP server: GoHighLevel MCP Server
Architecture
Claude/ChatGPT ──(1) descobre──> GET /.well-known/oauth-authorization-server
──(2) registra───> POST /register (DCR, automático)
──(3) pede login─> GET /authorize ──redirect──> tela da GHL (o "login")
<──redirect── GET /oauth/ghl/callback
<──code+state───── (nosso próprio código de autorização)
──(4) troca──────> POST /token ──> access_token + refresh_token nossos
──(5) chama tool─> POST /mcp (Authorization: Bearer <access_token>)"Login" = authorize GHL. This service has no account/password of its own. When an agency admin approves access on GHL's own screen, that already creates/updates their tenant (identified by GHL's
companyId) and completes the login on the MCP side.A single GHL Marketplace app (same
GHL_CLIENT_ID/GHL_CLIENT_SECRET) serves any agency that installs it — there's no need to create an app per client.Each tool call arrives authenticated with a Bearer token issued by this server; the middleware resolves that token to the correct
companyIdand injects it into anAsyncLocalStorage(src/tenant-context.ts) — that's how the tools code (identical to the original project's) remains "unaware" of multi-tenancy.Built on top of what
@modelcontextprotocol/sdkitself already provides for OAuth servers (server/auth/router.ts,provider.ts) — seesrc/auth/mcp-oauth-provider.ts.
Prerequisites to run anywhere
OAuth app in GHL Marketplace (Developer > your app), "Agency" or "Agency & Sub-Account" distribution:
Registered redirect URI:
<PUBLIC_URL>/oauth/ghl/callback(must be the final public URL of this service — HTTPS).Scopes: the same ones listed in
src/services/scopes.ts.
Postgres (any one — Supabase, Neon, RDS, the hosting platform's own managed Postgres, etc.). Run
db/schema.sqlon it once.Node.js 20+ (or this project's Docker image, which already includes it).
Environment variables
See .env.example. Summary:
Variable | Description |
| From the GHL Marketplace OAuth app |
| Final public URL of this service, no trailing slash |
| Port the process listens on (many platforms override it themselves) |
| Postgres connection string |
| 32 bytes in base64 — |
Run locally (dev)
npm install
npm run build
npm startChecks possible without any public domain:
curl localhost:8080/healthz
curl localhost:8080/.well-known/oauth-authorization-serverThe full OAuth flow (actually authorizing in GHL, getting a token, calling a tool) only works
with a real PUBLIC_URL (HTTPS) up, because GHL needs to be able to redirect the agency
admin's browser back here — and that same URL needs to be registered as a redirect URI in the
GHL app.
Deploy
This project doesn't assume any specific hosting platform — it just includes a generic
Dockerfile. Any platform that runs a Docker image (or node dist/index.js directly) works,
as long as:
It exposes a stable public HTTPS URL → that becomes
PUBLIC_URL.It injects the environment variables from the table above.
The Postgres pointed to by
DATABASE_URLhas already rundb/schema.sql.The GHL Marketplace app's redirect URI is updated to
<PUBLIC_URL>/oauth/ghl/callbackas soon as the final URL is known.
Connect in Claude / ChatGPT
Once hosted:
Claude.ai / Claude Desktop: Settings → Connectors → Add custom connector → URL:
https://<seu-dominio>/mcp. Claude will take you through the authorization flow automatically.ChatGPT: in workspaces with support for remote Connectors/MCP (varies by plan — Team, Enterprise, or "Developer mode"), add a connector pointing to
https://<seu-dominio>/mcp.
Caveat about ChatGPT: support for remote MCP connectors with OAuth in ChatGPT varies by plan/workspace, and some surfaces (e.g. Deep Research) restrict which tool formats they accept (sometimes only tools in the "search"/"fetch" format). This server follows the MCP authorization spec to the letter (the same one Claude uses), which maximizes compatibility — but it's worth actually testing once it's hosted, since behavior on the ChatGPT side is beyond our control.
Structure
src/
index.ts App Express: monta o router de OAuth, POST/GET/DELETE /mcp,
GET /oauth/ghl/callback, GET /healthz, CORS.
server.ts createMcpServer() — registra as tools (idêntico ao projeto original).
tenant-context.ts AsyncLocalStorage que carrega o companyId durante cada request.
db/
pool.ts Pool do `pg` a partir de DATABASE_URL.
crypto.ts AES-256-GCM (tokens da GHL em repouso) + SHA-256 (hash dos nossos tokens).
agencies.ts Tokens de agência da GHL por companyId (substitui o antigo token-store.ts).
oauth-store.ts Clients MCP, pending auth, authorization codes, access/refresh tokens.
auth/
ghl-oauth.ts Troca/refresh de tokens com a GHL — equivalente ao oauth-flow.ts original,
mas web-based e por tenant em vez de CLI + arquivo único.
location-tokens.ts Cache de location tokens, agora chaveado por companyId.
mcp-oauth-provider.ts Implementa OAuthServerProvider do SDK — o núcleo do "login = autorizar a GHL".
ghl-callback.ts Handler de GET /oauth/ghl/callback.
services/
constants.ts, scopes.ts, ghl-client.ts Idênticos ao projeto original (só o import de token mudou).
tools/
*.ts Idênticos ao projeto original, exceto locations.ts (cache agora por tenant).
db/
schema.sql DDL do Postgres — rodar uma vez antes do primeiro start.Security
GHL refresh tokens: encrypted at rest (AES-256-GCM).
Access/refresh tokens that this server issues to Claude/ChatGPT: stored only as SHA-256 hashes — never in plain text, like passwords.
PKCE (S256) required throughout the MCP-side flow, validated locally (not delegated to GHL).
No agency's credentials are accessible from another agency's token — all Postgres access is filtered by
companyId, and that value only comes into play after the Bearer token is validated.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
Hosted MCP server for marketing agencies: connect Google Ads, GA4, Search Console, Meta, LinkedIn and more to Claude or ChatGPT. Pull reports and make changes via OAuth login, no setup.
The Remote MCP server acts as a standardized bridge between LLM applications (like Claude, ChatGPT, and Cursor) and external services, enabling AI agents to access external tools and resources. Its primary capability is providing a centralized search tool to discover other MCP servers and their respective tools. Unlike local implementations, it runs remotely with OAuth authentication and permission controls for security.
Related MCP Servers
- AlicenseBqualityDmaintenanceMCP server for GoHighLevel API v2 that provides 50+ tools for CRM, billing, marketing, and operations workflows, enabling natural language interaction with contacts, opportunities, conversations, and more.501MIT
- AlicenseBqualityDmaintenanceA Model Context Protocol (MCP) server that provides tools for managing GoHighLevel (GHL) conversations, tasks, and calendar appointments through AI assistants like Claude.21115 npmMIT
- FlicenseNot gradedqualityDmaintenanceMCP server for GoHighLevel sub-accounts, enabling management of CRM contacts, pipelines, calendars, invoices, and more via natural language.-
- AlicenseCqualityCmaintenanceA Model Context Protocol (MCP) server for GoHighLevel API v2 — giving any AI agent full access to your GHL location.10021 npm6MIT