ghl-mcp-remote
ghl-mcp-remote
GoHighLevel 用のリモート MCP (Model Context Protocol) サーバー — マルチテナント、URL 経由でアクセス可能。Claude や ChatGPT からどのエージェンシーでも使用でき、各社がローカルで何かを実行する必要はありません。
これは元の ghl-mcp (stdio、個人/ローカル使用) とは別のプロジェクトです。どちらも互いに依存していません。
元の ghl-mcp との違い
|
| |
トランスポート | stdio (ローカルプロセス) | HTTP ( |
テナント | インストールごとに 1 エージェンシー、 | 任意の数のエージェンシー、 |
「ログイン」 | ターミナルで | GHL 自身の認可画面、Claude/ChatGPT によって起動 |
用途 | あなた、ローカルで | どの企業でも、Claude.ai/ChatGPT から、URL 経由 |
ビジネスコード (src/tools/ のツール) は両方でほぼ同一です — 認証/ストレージ層だけが変わります。
Related MCP server: GoHighLevel MCP Server
アーキテクチャ
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>)「ログイン」= GHL を認可すること。 このサービスには独自のアカウント/パスワードは存在しません。エージェンシーの管理者が GHL 自身の画面でアクセスを承認すると、それだけでそのテナント (GHL の
companyIdで識別) が作成/更新され、MCP 側のログインが完了します。単一の GHL Marketplace アプリ (同じ
GHL_CLIENT_ID/GHL_CLIENT_SECRET) が、それをインストールするすべてのエージェンシーに対応します — クライアントごとにアプリを作成する必要はありません。各ツール呼び出しは、このサーバーが発行した Bearer トークンで認証されて届きます。ミドルウェアはそのトークンを正しい
companyIdに解決し、それをAsyncLocalStorage(src/tenant-context.ts) に注入します — これにより、ツールのコード (元のプロジェクトと同一) はマルチテナンシーを「知らない」まま維持されます。これは、
@modelcontextprotocol/sdkが OAuth サーバー向けにすでに提供しているもの (server/auth/router.ts、provider.ts) の上に実装されています —src/auth/mcp-oauth-provider.tsを参照してください。
どこでも実行するための前提条件
GHL Marketplace の OAuth アプリ (Developer > あなたのアプリ)、配布形態は「Agency」または「Agency & Sub-Account」:
登録済みリダイレクト URI:
<PUBLIC_URL>/oauth/ghl/callback(このサービスの最終的な公開 URL — HTTPS である必要があります)。スコープ:
src/services/scopes.tsにリストされているものと同じ。
Postgres (Supabase、Neon、RDS、ホスティングプラットフォーム自身のマネージド Postgres など、どれでも)。
db/schema.sqlを一度実行してください。Node.js 20+ (または、これをすでに含むこのプロジェクトの Docker イメージ)。
環境変数
.env.example を参照してください。まとめ:
変数 | 説明 |
| GHL Marketplace の OAuth アプリから |
| このサービスの最終的な公開 URL、末尾にスラッシュなし |
| プロセスが待ち受けるポート (多くのプラットフォームが自動的に上書きします) |
| Postgres の接続文字列 |
| base64 の 32 バイト — |
ローカルでの実行 (開発)
npm install
npm run build
npm start公開ドメインなしで可能な確認:
curl localhost:8080/healthz
curl localhost:8080/.well-known/oauth-authorization-server完全な OAuth フロー (実際に GHL で認可し、トークンを取得し、ツールを呼び出す) は、実際の PUBLIC_URL (HTTPS) が稼働している場合にのみ機能します。GHL がエージェンシー管理者のブラウザをここにリダイレクトする必要があるためです。そして、その同じ URL が GHL アプリのリダイレクト URI として登録されている必要があります。
デプロイ
このプロジェクトは特定のホスティングプラットフォームを想定していません — 汎用の Dockerfile を含むだけです。Docker イメージ (または直接 node dist/index.js) を実行できるプラットフォームならどれでも機能します。ただし、次の条件を満たす必要があります:
安定した公開 HTTPS URL を公開する → それが
PUBLIC_URLになります。上記の表の環境変数を注入する。
DATABASE_URLが指す Postgres でdb/schema.sqlがすでに実行されている。最終的な URL が判明したら、GHL Marketplace アプリのリダイレクト URI を
<PUBLIC_URL>/oauth/ghl/callbackに更新する。
Claude / ChatGPT に接続する
ホスティング後:
Claude.ai / Claude Desktop: 設定 → Connectors → Add custom connector → URL:
https://<seu-dominio>/mcp。Claude が自動的に認可フローに案内します。ChatGPT: リモート Connectors/MCP をサポートするワークスペース (プランによって異なります — Team、Enterprise、または「Developer mode」) で、
https://<seu-dominio>/mcpを指すコネクタを追加します。
ChatGPT に関する注意: ChatGPT での OAuth 付きリモート MCP コネクタのサポートはプラン/ワークスペースによって異なり、一部のサーフェス (例: Deep Research) では受け付けるツール形式が制限されています (「search」/「fetch」形式のツールのみの場合もあります)。このサーバーは MCP の認可仕様に厳密に従っており (Claude が使用するものと同じ)、互換性を最大化します — ただし、ホスティング後に実際にテストする価値があります。ChatGPT 側の動作は私たちの制御外にあるためです。
構造
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.セキュリティ
GHL のリフレッシュトークン: 保存時に暗号化 (AES-256-GCM)。
このサーバーが Claude/ChatGPT に発行するアクセス/リフレッシュトークン: SHA-256 ハッシュとしてのみ保存 — パスワードと同様、平文では決して保存しません。
PKCE (S256) は MCP 側のすべてのフローで必須であり、ローカルで検証されます (GHL に委任されません)。
あるエージェンシーの資格情報は、別のエージェンシーのトークンからはアクセスできません — Postgres へのすべてのアクセスは
companyIdでフィルタリングされ、その値は Bearer トークンが検証された後にのみ登場します。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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.2135MIT
- FlicenseNot gradedqualityDmaintenanceMCP server for GoHighLevel sub-accounts, enabling management of CRM contacts, pipelines, calendars, invoices, and more via natural language.
- AlicenseCqualityAmaintenanceA Model Context Protocol (MCP) server for GoHighLevel API v2 — giving any AI agent full access to your GHL location.1001935MIT
Related MCP Connectors
Hosted Amazon Seller Central and Amazon Ads MCP server for Claude, ChatGPT, Cursor, and agents.
Hosted Amazon Seller and Vendor MCP server for Claude, ChatGPT, Cursor, Codex, Gemini, Copilot.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jamersoncalixto/ghl-mcp-remote'
If you have feedback or need assistance with the MCP directory API, please join our Discord server