HighLevel MCP Server

HighLevel MCP Server

Multi-account HighLevel CRM MCP server with OAuth integration for managing 30+ sub-accounts through a unified interface.

Category
Visit Server

README

HighLevel MCP Server

Multi-account HighLevel CRM MCP server with OAuth integration for managing 30+ sub-accounts through a unified interface.

Deploy to Cloudflare Workers

Overview

This MCP (Model Context Protocol) server enables AI agents like TypingMind to interact with multiple HighLevel CRM sub-accounts through a single unified interface. Instead of managing 30+ Private Integration Tokens (PITs), this server leverages your existing OAuth tokens stored in Supabase.

Key Features

  • šŸ” OAuth Integration - Uses existing access tokens from Supabase
  • šŸ¢ Multi-Account Support - Manage 30+ HighLevel sub-accounts through one connection
  • ⚔ 26 Read-Only API Tools - Coverage of contacts, conversations, opportunities, calendars, payments, blogs, emails, and social media (write operations disabled by default)
  • šŸš€ Cloudflare Workers - Serverless, auto-scaling, edge deployment
  • šŸ’¾ Smart Caching - 5-minute token cache for optimal performance
  • šŸŽÆ Client-Friendly - Use client names or location IDs interchangeably

Why This Exists

HighLevel's official MCP server requires one Private Integration Token (PIT) per sub-account. For agencies managing 30+ clients, this means:

  • āŒ Manually creating 30+ PITs through the UI
  • āŒ Managing 30+ separate MCP connections
  • āŒ No programmatic token management

Our solution:

  • āœ… Reuse existing OAuth tokens from your Supabase database
  • āœ… One MCP connection for all clients
  • āœ… Automatic token management with caching

Architecture

ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│ TypingMind  │
│  (AI Agent) │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
       │ MCP Protocol (SSE)
       │
ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā–¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│ Cloudflare Worker             │
│ ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” │
│ │ Token Manager (5min cache)│ │
│ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ │
│             │                  │
│ ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā–¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” │
│ │ 26 Read-Only API Tools    │ │
│ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
              │
      ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā–¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
      │   Supabase     │
      │ ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” │
      │ │ locations  │ │
      │ │ - access_  │ │
      │ │   token    │ │
      │ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ │
      ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
              │
      ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā–¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
      │ HighLevel REST API   │
      │ 32 Sub-Accounts      │
      ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

Available Tools (26 Read-Only)

Note: Write/update/delete operations are disabled by default for safety. To enable them, uncomment the relevant tools in src/index.ts.

Contacts (3 active, 5 disabled)

  • contacts_get-contact - Fetch contact details
  • contacts_get-contacts - List all contacts
  • contacts_get-all-tasks - Get contact tasks
  • contacts_create-contact - Create new contact (disabled)
  • contacts_update-contact - Update contact (disabled)
  • contacts_upsert-contact - Create or update contact (disabled)
  • contacts_add-tags - Add tags to contact (disabled)
  • contacts_remove-tags - Remove tags from contact (disabled)

Conversations (2 active, 1 disabled)

  • conversations_search-conversation - Search conversations
  • conversations_get-messages - Get conversation messages
  • conversations_send-a-new-message - Send SMS/Email/WhatsApp (disabled)

Opportunities (3 active, 1 disabled)

  • opportunities_search-opportunity - Search opportunities
  • opportunities_get-opportunity - Get opportunity details
  • opportunities_get-pipelines - Get all pipelines
  • opportunities_update-opportunity - Update opportunity (disabled)

Calendars (2 tools)

  • calendars_get-calendar-events - Get calendar events
  • calendars_get-appointment-notes - Get appointment notes

Locations (2 tools)

  • locations_get-location - Get location details
  • locations_get-custom-fields - Get custom fields

Payments (2 tools)

  • payments_get-order-by-id - Get payment order
  • payments_list-transactions - List transactions

Blogs (5 active, 2 disabled)

  • blogs_get-blogs - Get all blogs
  • blogs_get-blog-post - Get blog posts
  • blogs_check-url-slug-exists - Check URL slug
  • blogs_get-all-blog-authors-by-location - Get authors
  • blogs_get-all-categories-by-location - Get categories
  • blogs_create-blog-post - Create blog post (disabled)
  • blogs_update-blog-post - Update blog post (disabled)

Emails (1 active, 1 disabled)

  • emails_fetch-template - Get email templates
  • emails_create-template - Create email template (disabled)

Social Media (4 active, 2 disabled)

  • socialmediaposting_get-account - Get social accounts
  • socialmediaposting_get-social-media-statistics - Get analytics
  • socialmediaposting_get-post - Get post by ID
  • socialmediaposting_get-posts - List all posts
  • socialmediaposting_create-post - Create post (disabled)
  • socialmediaposting_edit-post - Edit post (disabled)

Utility (2 tools)

  • cache_get-stats - Get cache statistics for debugging
  • list_clients - List all available client names

Prerequisites

  • Node.js 18+ (for local development)
  • Cloudflare Workers account
  • Supabase account with HighLevel OAuth tokens
  • TypingMind or another MCP-compatible client

Database Schema

Your Supabase database must have these tables:

locations table:

CREATE TABLE locations (
  location_id TEXT PRIMARY KEY,
  access_token TEXT NOT NULL,
  refresh_token TEXT,
  company_id TEXT,
  location_name TEXT,
  created_at TIMESTAMP DEFAULT NOW(),
  updated_at TIMESTAMP DEFAULT NOW()
);

master_clients table (optional, for client name lookup):

CREATE TABLE master_clients (
  id SERIAL PRIMARY KEY,
  client_name TEXT UNIQUE NOT NULL,
  location_id TEXT REFERENCES locations(location_id),
  created_at TIMESTAMP DEFAULT NOW()
);

Installation

1. Clone the Repository

git clone https://github.com/isaganiesteron/highlevel-mcp-server.git
cd highlevel-mcp-server

2. Install Dependencies

npm install

3. Configure Environment Variables

Create a .dev.vars file for local development:

SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_KEY=eyJhbGc...your-service-key
HIGHLEVEL_API_BASE=https://services.leadconnectorhq.com
TOKEN_CACHE_TTL=300000

For production, set these as Cloudflare Worker secrets:

wrangler secret put SUPABASE_URL
wrangler secret put SUPABASE_SERVICE_KEY

4. Update wrangler.toml

name = "highlevel-mcp-server"
main = "src/index.ts"
compatibility_date = "2024-01-01"

[vars]
HIGHLEVEL_API_BASE = "https://services.leadconnectorhq.com"
TOKEN_CACHE_TTL = "300000"

Development

Local Development

npm run dev

The server will start on http://localhost:8787

Testing with MCP Inspector

npx @modelcontextprotocol/inspector node dist/index.js

Run Tests

npm test

Deployment

Deploy to Cloudflare Workers

# Production deployment
npm run deploy

# Or using wrangler directly
wrangler deploy

Configure Secrets

wrangler secret put SUPABASE_URL
wrangler secret put SUPABASE_SERVICE_KEY

Usage

Configure in TypingMind

Add to your TypingMind MCP configuration:

{
	"mcpServers": {
		"highlevel": {
			"url": "https://your-worker.workers.dev/mcp",
			"transport": "sse",
			"name": "HighLevel CRM (All Clients)"
		}
	}
}

Example Queries

Using Client Name:

User: "Get all contacts for ABC Remodeling"

The AI will call:

{
	"tool": "contacts_get-contacts",
	"arguments": {
		"clientName": "ABC Remodeling"
	}
}

Using Location ID:

User: "Send a text message to contact_123 in location LN27DIXpeAMiwdjXhDZw"

The AI will call:

{
	"tool": "conversations_send-a-new-message",
	"arguments": {
		"locationId": "LN27DIXpeAMiwdjXhDZw",
		"contactId": "contact_123",
		"type": "SMS",
		"message": "Your message here"
	}
}

Complex Workflow:

User: "Find all opportunities in 'Follow Up' stage for XYZ Construction and send them a reminder email"

The AI will:

  1. Search opportunities with clientName="XYZ Construction", status="Follow Up"
  2. Get contact details for each opportunity
  3. Send email via conversations_send-a-new-message

Performance

  • Average Response Time: < 800ms (with cache hits < 500ms)
  • Cache Hit Rate: > 80% after warm-up
  • Token Cache TTL: 5 minutes
  • Client Mapping Cache: 10 minutes
  • Concurrent Requests: Supports 100+ requests/minute

Caching Strategy

Token Cache:

  • Access tokens cached in-memory for 5 minutes
  • Reduces Supabase queries by 80%+
  • Cache is per-worker instance (Cloudflare auto-scales)

Client Name Mapping:

  • clientName → locationId cached for 10 minutes
  • Small dataset (32 clients), safe to cache longer

Error Handling

The server provides user-friendly error messages:

  • "Client 'ABC Remodeling' not found" - Invalid client name
  • "No access token for location LN27DIXpeAMiwdjXhDZw" - Missing/invalid token
  • "Contact not found" - Invalid contact ID
  • "HighLevel API rate limit exceeded" - Rate limit hit
  • "HighLevel API temporarily unavailable" - API down

Troubleshooting

Issue: "No access token for location"

Check:

  1. Token exists in Supabase locations table
  2. Token is not empty string
  3. location_id matches exactly

Fix:

  • Re-authenticate client through HighLevel OAuth flow
  • Verify token in Supabase

Issue: "401 Unauthorized from HighLevel API"

Check:

  • Access token is valid (not expired)

Fix:

  • Refresh token using your existing OAuth infrastructure
  • Note: This MCP server does not refresh tokens (read-only access to Supabase)

Issue: "Client not found"

Check:

  • Client exists in master_clients table
  • client_name spelling is exact (case-sensitive)

Fix:

  • Add client to master_clients table
  • Use locationId directly instead

Issue: Slow response times

Check:

  • Cache hit rate (should be >80% after warm-up)
  • HighLevel API latency (external dependency)
  • Supabase query performance

Fix:

  • Increase TOKEN_CACHE_TTL if needed
  • Check Cloudflare Workers analytics
  • Monitor Supabase performance

Security

Authentication

  • OAuth 2.0 access tokens for HighLevel API
  • Supabase service key stored as Cloudflare secret
  • No tokens exposed in logs or error messages

Data Privacy

  • No data stored by MCP server (pass-through only)
  • Token cache is in-memory only (5-minute TTL)
  • Logs do not contain PII

Compliance

  • GDPR: Data minimization (no unnecessary storage)
  • CCPA: User data rights respected
  • SOC 2: Cloudflare and Supabase are SOC 2 compliant

Monitoring

Cloudflare Workers Analytics

  • Request count and latency
  • Error rates
  • Geographic distribution

Recommended Additional Monitoring

  • Sentry for error tracking
  • Custom metrics for cache hit rates
  • Alert on error rate spikes

Project Structure

highlevel-mcp-server/
ā”œā”€ā”€ src/
│   ā”œā”€ā”€ index.ts                 # Main MCP server entry point
│   ā”œā”€ā”€ tools/
│   │   ā”œā”€ā”€ contacts.ts          # Contact tools (10)
│   │   ā”œā”€ā”€ conversations.ts     # Conversation tools (3)
│   │   ā”œā”€ā”€ opportunities.ts     # Opportunity tools (4)
│   │   ā”œā”€ā”€ calendars.ts         # Calendar tools (2)
│   │   ā”œā”€ā”€ locations.ts         # Location tools (2)
│   │   ā”œā”€ā”€ payments.ts          # Payment tools (2)
│   │   ā”œā”€ā”€ blogs.ts             # Blog tools (7)
│   │   ā”œā”€ā”€ emails.ts            # Email tools (2)
│   │   └── social-media.ts      # Social media tools (6)
│   ā”œā”€ā”€ lib/
│   │   ā”œā”€ā”€ supabase.ts          # Supabase client
│   │   ā”œā”€ā”€ token-manager.ts     # Token caching logic
│   │   ā”œā”€ā”€ highlevel-client.ts  # HighLevel API client
│   │   └── client-resolver.ts   # Client name → location ID
│   └── types/
│       └── index.ts             # TypeScript types
ā”œā”€ā”€ tests/
│   ā”œā”€ā”€ tools/                   # Tool tests
│   └── lib/                     # Library tests
ā”œā”€ā”€ wrangler.toml                # Cloudflare Workers config
ā”œā”€ā”€ package.json
ā”œā”€ā”€ tsconfig.json
└── README.md

Contributing

Contributions are welcome! Please follow these guidelines:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Roadmap

Phase 1: Foundation āœ…

  • [x] Project setup and architecture
  • [x] Token management with caching
  • [x] Client identifier resolver
  • [x] Error handling framework

Phase 2: Tools Implementation āœ…

  • [x] Implement all 38 tool schemas (26 read-only active, 12 write ops disabled)
  • [x] HighLevel API endpoint mappings
  • [x] Request/response formatting
  • [ ] Individual tool testing

Phase 3: Polish (In Progress)

  • [ ] Comprehensive error handling
  • [ ] Performance optimization
  • [ ] Documentation
  • [ ] Integration testing

Phase 4: Production

  • [ ] Production deployment
  • [ ] Team training
  • [ ] Monitoring setup
  • [ ] User acceptance testing

Future Enhancements

  • [ ] Automatic token refresh within MCP server
  • [ ] HighLevel webhook support (real-time events)
  • [ ] Response caching for read operations
  • [ ] Request batching for bulk operations
  • [ ] Admin UI for cache inspection
  • [ ] Workflow automation templates

License

MIT License - see LICENSE file for details

Support

Acknowledgments

Related Projects


Built with ā¤ļø by Isagani Esteron at Contractor Scale

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured