MCP Connector - Follow Up Boss
A remote MCP server on Cloudflare Workers that allows real-estate sales teams to query their Follow Up Boss CRM data through Claude, with read-only, role-based access and OAuth authentication.
README
MCP Connector - Follow Up Boss
<p align="center"> <img src="assets/hero.png" alt="A sales team chats with an AI assistant, which reaches their real-estate CRM through a secure cloud gateway — the MCP connector" width="100%"> </p>
A remote MCP server on Cloudflare Workers that lets a real-estate sales team talk to their CRM (Follow Up Boss) from Claude — web and mobile, no install, no API keys in anyone's hands.
A closer asks "How did I do today?" and Claude answers from live CRM data: their calls (with the AI call summaries already logged on each call), the notes they wrote, their texts, an exact numeric summary. Two managers get an account-wide view — team leaderboard, per-closer drill-down, live pipeline by stage — from the same connector, gated by role. Everything is read-only and every request is scoped server-side to the signed-in user.
Built for the same production engagement as real-estate-crm-automation-suite. This ran (and runs) in production. Client identifiers, staff names, account IDs, and live URLs have been replaced with fictional equivalents so the engineering can be shown publicly; the code, tests, and design docs are the real thing.
How it works
sequenceDiagram
participant C as Claude (claude.ai / mobile)
participant W as Cloudflare Worker
participant G as Google Sign-In
participant F as Follow Up Boss API
C->>W: Connect (OAuth /authorize)
W->>G: Redirect, restricted to the company Workspace domain
G-->>W: Verified email
W->>F: GET /v1/users → map email to FUB userId (or deny)
W-->>C: MCP token — session carries { fubUserId, isManager }
C->>W: Tool call, e.g. eod_report(period: "today")
W->>F: Scoped GETs — userId injected from the session, never from arguments
F-->>W: Calls / notes / texts / people
W-->>C: Only the caller's own data (re-validated before returning)
One Worker plays three roles: an OAuth server toward Claude (via workers-oauth-provider), an OAuth client toward Google for identity, and an MCP server (a Durable Object running McpAgent) exposing the tools. The single Follow Up Boss API key lives only as a Worker secret; users never see or handle credentials.
The security model
The client's hard requirement: a closer must never be able to see another closer's data — not by asking nicely, not by crafting arguments. That is enforced by construction, not by prompt:
- Identity comes from the session, never from tool input. Every tool reads
fubUserIdfrom the OAuth session props written at login. No tool accepts a user id (closer tools) — there is nothing to spoof. - Scoping is applied server-side and re-validated. Queries are filtered by the session's userId and every returned record is checked again before it leaves the Worker (defense in depth against API quirks).
- Ownership checks before drill-down.
get_lead_activityrefuses any lead not assigned to the caller. - Role gating by tool registration. Manager tools are only registered on sessions whose verified email is on the
MANAGER_EMAILSallowlist — for everyone else the tools don't exist, so they can't be called, discovered, or confused into use. - Domain-restricted, verified sign-in. Google Sign-In with
email_verified+ company-domain enforcement server-side (plus thehdhint and an Internal consent screen), then a further check that the email maps to an actual FUB user. - Read-only by construction. The connector implements
GETs only. There is no write tool to misuse.
Tools
| Everyone (scoped to self) | What it answers |
|---|---|
list_my_calls |
"Show me my calls this week" — each with the AI-summary note (score, topics, sentiment) |
my_call_summary |
Exact counts: total, answered, no-answer, talk time, distinct leads — aggregated server-side so the numbers aren't model-counted |
list_my_notes |
Notes the caller authored, by period |
find_my_leads |
Search only the caller's assigned leads |
get_lead_activity |
Full timeline (calls, notes, texts) of one owned lead |
eod_report |
The end-of-day bundle a closer actually files: my calls + my notes + my texts on the leads I touched |
| Managers only | What it answers |
|---|---|
list_team |
Roster with ids, emails, roles |
team_activity |
Per-closer leaderboard for a period, plus a no-activity list |
closer_activity |
"Show me everything Ethan did today" — resolves names, handles ambiguity |
team_pipeline |
Live lead counts, stage × closer, active stages only |
find_leads |
Account-wide lead search |
lead_activity |
Any lead's full timeline |
Repository tour
src/
index.ts OAuthProvider wiring: /mcp API route, /authorize, /token, /register
google-handler.ts Google Sign-In round-trip: domain check, FUB user mapping, session props
mcp.ts The MCP agent: 6 closer tools + 6 manager tools (registered only if isManager)
tools-manifest.ts Single source of truth for which tools exist per role
fub/ Follow Up Boss API client + per-domain query modules (calls, notes, people, team…)
lib/ Pure helpers: period math (account TZ), formatting, manager allowlist, classification
test/ 46 unit tests (vitest) — scoping, gating, aggregation, pagination, edge cases
docs/
design.md Phase 1 design: requirements, architecture, alternatives considered
implementation-plan.md Phase 1 build plan, task-by-task with tests
manager-view-design.md Phase 2 design: manager role, gating decision, deferred scope
manager-view-plan.md Phase 2 build plan
wrangler.toml Worker config (vars are examples — see Deploy)
Engineering details worth a look:
- Texts have no global per-agent feed in the FUB API — the connector reconstructs "my texts" per lead from the leads the closer touched that period, and documents the one edge case that misses (design.md §8).
- Server-side aggregation for anything numeric. Claude gets exact totals, not raw rows to count.
- Period math in the account's timezone, not the server's — "today" means the sales team's today.
- Pagination with caps + honesty: a stage too large to fully page returns partial counts and says so.
- The tool manifest is tested — the set of registered manager tools must equal the manifest, so role gating can't silently drift.
Deploy your own
npm install
npm test
npx wrangler kv namespace create OAUTH_KV # put the id in wrangler.toml
npx wrangler secret put FUB_API_KEY # your FUB API key (read access)
npx wrangler secret put GOOGLE_CLIENT_ID # Google OAuth web client (Internal consent screen)
npx wrangler secret put GOOGLE_CLIENT_SECRET
npx wrangler secret put COOKIE_ENCRYPTION_KEY # any long random string
npx wrangler deploy
Set ALLOWED_EMAIL_DOMAIN, ACCOUNT_TZ, and MANAGER_EMAILS in wrangler.toml, add https://<your-worker>/callback as the Google client's redirect URI, then add https://<your-worker>/mcp as a custom connector in claude.ai (Team: Settings → Organization → Connectors). Each user clicks Connect and signs in with their company Google account — that's the whole onboarding.
Design docs
The full decision trail is in docs/: why a remote MCP connector over a local server or a hosted third party, why identity is delegated to Google, what "my data" means precisely, the FUB API capabilities verified live before building, and the phase-2 manager view with its explicitly deferred scope.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。