Contractor Scale Context MCP Server
Provides tools for querying client and meeting data stored in Supabase, enabling listing clients, fetching client context summaries, and searching meetings with various filters.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Contractor Scale Context MCP ServerShow me context for client Acme Corp"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Contractor Scale Context MCP Server
Internal MCP server for Contractor Scale client context, meeting records, and strategy summaries. Built on Cloudflare Workers with Supabase and the Contractor Scale context API.
Overview
This MCP (Model Context Protocol) server gives AI agents like TypingMind, ClickUp Brain, and other MCP clients access to Contractor Scale internal context β client background, meeting transcripts, and team huddles β through a single connection.
Key Features
π 3 Context Tools β List clients, fetch full client context, search meetings
π Dual Transport β Streamable HTTP (
POST /mcp) for modern clients + legacy SSE (GET /sse) for TypingMindπ Cloudflare Workers β Serverless, stateless session handling across worker isolates
ποΈ Supabase Integration β Client lookup via
master_clients, meeting search viameetingsπ Context API β Full client summaries from
contractor-scale-api.onrender.comπ Dual API Key Auth β
API_KEYfor MCP clients;CONTEXT_API_KEYfor the context API
Related MCP server: CRMy
Architecture
ββββββββββββββββββββββββββββββββ
β AI Clients β
β (TypingMind, ClickUp, etc.) β
ββββββββββββββββ¬ββββββββββββββββ
β MCP Protocol
β β’ Streamable HTTP β POST /mcp
β β’ Legacy SSE β GET /sse
β
ββββββββββββββββΌβββββββββββββββββββββββββ
β Cloudflare Worker β
β API_KEY (inbound) β
β βββββββββββββββββββββββββββββββββββββ β
β β 3 Context Tools β β
β β β’ list_clients β β
β β β’ get_client_context β β
β β β’ get_meetings β β
β βββββββββββββββββ¬ββββββββββββββββββββ β
βββββββββββββββββββΌββββββββββββββββββββββ
β
βββββββββββ΄βββββββββββ
β β
βββββββββΌβββββββββ ββββββββββΌβββββββββββββββββββββββββββββββ
β Supabase β β Contractor Scale Context API β
β ββββββββββββββ β β contractor-scale-api.onrender.com β
β βmaster_ β β β GET /client-context/{client} β
β β clients β β β Header: X-API-Key: CONTEXT_API_KEY β
β βmeetings β β βββββββββββββββββββββββββββββββββββββββββ
β ββββββββββββββ β
ββββββββββββββββββEndpoints
Endpoint | Method | Purpose |
| GET | Health check (no API key required) |
| POST | Streamable HTTP MCP transport (ClickUp, modern clients) |
| DELETE | Terminate MCP session |
| GET | Legacy SSE connection (TypingMind) |
| POST | Direct MCP message (no session) |
| POST | MCP message with SSE session |
Health check response includes version, toolCount, tools, and available endpoints.
MCP protocol version: 2025-03-26
Authentication:
MCP endpoints (
/mcp,/sse) requireX-API-Key: API_KEY(except health check/)get_client_contextcalls the context API withX-API-Key: CONTEXT_API_KEY
Session handling: Streamable HTTP uses stateless Mcp-Session-Id headers (no in-memory session store), which is required for Cloudflare Workers where requests may hit different isolates.
Available Tools (3)
list_clients
List all available client names from the master_clients table. Use these names with clientName in other tools.
Input: none
get_client_context
Get the full context summary for a client including meetings, messages, and overall strategy. Use when asked about a specific client's background, history, or current status.
Input:
Parameter | Type | Required | Description |
| string | yes | Client name as stored in |
Behavior:
Validates the client exists in
master_clientsFetches
https://contractor-scale-api.onrender.com/client-context/{clientName}(URL-encoded) with headerX-API-Key: CONTEXT_API_KEYReturns the text response from the API
get_meetings
Search and retrieve meeting records including summaries, full transcripts, and recording URLs. Use when asked what was discussed in a meeting, what a client said, or what tasks were mentioned in a team huddle.
Inputs:
Parameter | Type | Required | Description |
| string | no | Resolved to |
| string | no | Partial text search on |
| string | no | ISO date ( |
| string | no | Search within the |
| string | no | Filter on |
| string | no | What to return: |
Behavior:
Builds a Supabase query on the
meetingstable using whichever parameters are providedIf no parameters are provided, returns the 10 most recent meetings ordered by
meeting_datedescendingAlways includes
meeting_title,meeting_date,invitees_name, andcategoryin results
Prerequisites
Node.js 18+ (for local development)
Cloudflare Workers account
Supabase account with
master_clientsandmeetingstablesTypingMind, ClickUp Brain, or another MCP-compatible client
Database Schema
Your Supabase database must have these tables:
master_clients table:
CREATE TABLE master_clients (
id SERIAL PRIMARY KEY,
client_name TEXT UNIQUE NOT NULL,
location_id TEXT NOT NULL,
created_at TIMESTAMP DEFAULT NOW()
);meetings table:
CREATE TABLE meetings (
id SERIAL PRIMARY KEY,
location_id TEXT,
meeting_title TEXT,
meeting_date TIMESTAMPTZ,
invitees_name TEXT[],
category TEXT,
category_auto TEXT,
summary TEXT,
full_transcript TEXT,
recording_url TEXT,
created_at TIMESTAMP DEFAULT NOW()
);Installation
1. Clone the Repository
git clone https://github.com/isaganiesteron/contractor-scale-context-mcp.git
cd contractor-scale-context-mcp2. Install Dependencies
npm install3. Configure Environment Variables
Set credentials in wrangler.jsonc under vars:
"vars": {
"API_KEY": "your-mcp-api-key",
"CONTEXT_API_KEY": "your-context-api-key",
"SUPABASE_URL": "https://your-project.supabase.co",
"SUPABASE_SERVICE_KEY": "your-service-role-key"
}Variable | Purpose |
| Authenticates MCP clients to this worker ( |
| Authenticates this worker to the context API ( |
For local dev you can also use .dev.vars (same variable names). On deploy, values in wrangler.jsonc β vars are injected as worker environment variables.
Note:
wrangler.jsoncis gitignored β copywrangler.jsonc.exampleand fill in your credentials locally.
Development
Local Development
npm run devThe server will start on http://localhost:8787
Run Tests
npm testDeployment
Deploy to Cloudflare Workers
npm run deployConfigure Secrets
Credentials are set in wrangler.jsonc β vars. Update CONTEXT_API_KEY there, then redeploy:
npm run deployVerify Deployment
curl https://contractor-scale-context-mcp.isagani.workers.dev/Expected response:
{
"name": "contractor-scale-context-mcp",
"version": "1.0.2",
"status": "running",
"toolCount": 3,
"tools": ["list_clients", "get_client_context", "get_meetings"],
"endpoints": { "sse": "/sse", "mcp": "/mcp" }
}Production URL: https://contractor-scale-context-mcp.isagani.workers.dev
Usage
Configure in ClickUp Brain (Streamable HTTP)
URL:
https://contractor-scale-context-mcp.isagani.workers.dev/mcpAuth:
X-API-Keyheader with yourAPI_KEYvalue
After connecting, disconnect and reconnect if tools don't appear β clients cache the tool list from tools/list.
Configure in TypingMind (Legacy SSE)
Add to your TypingMind MCP configuration:
{
"mcpServers": {
"contractor-scale-context": {
"url": "https://contractor-scale-context-mcp.isagani.workers.dev/sse",
"transport": "sse",
"name": "Contractor Scale Context"
}
}
}Example Queries
List available clients:
User: "What clients are available?"Get client background and strategy:
User: "What's the current status and strategy for Bear Construction?"Search recent meetings:
User: "What was discussed in our last team huddle?"Find meetings for a specific client:
User: "Show me recent meetings with ABC Remodeling"Get a full transcript:
User: "Get the full transcript of yesterday's client call with Bear Construction"(The AI will call get_meetings with clientName, meetingDate, and output: "full_transcript".)
Error Handling
The server provides clear error messages:
"Client 'ABC Remodeling' not found"β Invalid client name (includes available clients when possible)"No meetings matched the criteria."β No results for the given filters"Failed to fetch client context"β Context API returned an error (checkCONTEXT_API_KEY)"CONTEXT_API_KEY is not configured on the worker"β MissingCONTEXT_API_KEYinwrangler.jsonc"API key required"/"Invalid API key"β MCP authentication failure (API_KEY)
Production Debugging
Structured JSON logs are emitted for wrangler tail:
wrangler tailKey log events: request.received, route.matched, mcp.method.parsed, mcp.tools.call, mcp.response.sent, mcp.session.created, auth.failed.
Troubleshooting
Issue: "Session not found" (ClickUp / Streamable HTTP)
Cause: Client is using a stale tool list or an old server build.
Fix:
Verify health check shows
toolCount: 3and the expectedtoolsarrayDisconnect and reconnect the MCP integration in ClickUp
Ensure you are using
POST /mcp, not/sse
Issue: "Client not found"
Check:
Client exists in
master_clientstableclient_namespelling matches (case-insensitive fallback is supported)
Fix:
Add client to
master_clientstableUse
list_clientsto see exact names
Issue: "No meetings matched the criteria"
Check:
Filters are not too restrictive
location_idinmeetingsmatches the client'slocation_idinmaster_clientsDate format is
YYYY-MM-DD
Fix:
Call
get_meetingswith no parameters to see the 10 most recent meetingsBroaden filters (e.g. drop
meetingTitleorinviteeName)
Issue: Context API fetch fails (401 Unauthorized)
Check:
CONTEXT_API_KEYis set inwrangler.jsoncβvarsThe key matches what
contractor-scale-api.onrender.comexpectsClient exists in
master_clientsWorker has been redeployed after updating the key
Fix:
// wrangler.jsonc
"vars": {
"CONTEXT_API_KEY": "your-context-api-key"
}Then run npm run deploy.
Issue: Context API fetch fails (other errors)
Client exists in
master_clientscontractor-scale-api.onrender.comis reachableThe client has context data on the API
Security
Authentication
Inbound: MCP clients authenticate with
API_KEYviaX-API-Keyon/mcpand/sseOutbound: Worker authenticates to the context API with
CONTEXT_API_KEYviaX-API-KeyCredentials are configured in
wrangler.jsoncβvars(gitignored, not committed)No credentials exposed in logs or error messages
Data Privacy
Meeting and client data served on demand from Supabase and the context API
Logs do not contain PII beyond what is needed for debugging
Project Structure
contractor-scale-context-mcp/
βββ src/
β βββ index.ts # MCP server, tool definitions, routing
β βββ lib/
β βββ supabase.ts # Supabase client factory
β βββ client-resolver.ts # Client name β location ID lookup
β βββ tool-result.ts # MCP result helpers
β βββ types.ts # Shared type definitions
βββ test/
β βββ index.spec.ts
βββ postman/ # API test collections
βββ wrangler.jsonc.example # Cloudflare Workers config template
βββ package.json
βββ tsconfig.json
βββ README.mdContributing
Contributions are welcome! Please follow these guidelines:
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
License
MIT License - see LICENSE file for details
Support
Issues: GitHub Issues
Discussions: GitHub Discussions
Email: isagani@contractorscale.com
Acknowledgments
Built with Model Context Protocol
Powered by Cloudflare Workers
Database by Supabase
Template based on typingmind-mcp-cloudflare-starter
Related Projects
TypingMind β AI chat interface with MCP support (SSE)
ClickUp β Project management with Brain AI (Streamable HTTP)
Built with β€οΈ by Isagani Esteron at Contractor Scale
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.
Latest Blog Posts
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/isaganiesteron/contractor-scale-context-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server