房地产CRM连接服务

连接Claude Desktop与Spark.re房地产CRM API的协议服务器,支持自然语言查询和写入操作,实现销售工作流自动化。

  • by dbreck
  • JavaScript
  • 本地部署
  • 更新于
在 GitHub 查看 dbreck/spark-mcp

使用说明

Spark.re MCP 服务器

模型上下文协议服务器,该服务器将Claude Desktop连接到Spark.re的房地产CRM API,支持自然语言查询以及 写入操作 实现完整的销售工作流自动化。

项目概述

目的: 通过对话界面,使Claude能够直接查询、创建、更新和分析Spark.re CRM数据 开发: 在Claude代码中构建,在Claude桌面端测试 状态: 具备完整的读/写/分析功能,已准备好投入生产

主要特点:

  • 📖 书籍的符号,通常用于表示书籍或阅读相关的概念,在中文中直接可以理解为“书”或“书籍”。如果需要更具体的翻译,比如在某个上下文中,它可能指的是“这本书”或“请看这本书”等,但单独来看,它就是代表书籍的符号。 读取操作搜索联系人,查看详细信息,分析项目,追踪互动
  • ✍️ 写操作创建/更新联系人,记录互动,添加备注
  • 📊(表格) 分析运营基于AI的潜在客户来源洞察、互动模式分析、队列分析
  • 🔄 旋转(表示循环、重复或持续的动作) 完整的流程/工作流从潜在客户捕捉 → 互动记录 → 跟进备注 → 性能分析
  • 🎯(瞄准目标) 以销售为中心专为房地产经纪人日常任务及管理决策设计
  • ✨(闪亮的星星符号,常用于表达喜悦、庆祝或强调) 自动身份标识丰富化显示“邮件外出”而非“输入ID 17861”,显示“尼科尔·迪平托”而非“团队成员7927”
  • 📄(文件/纸张) 分页支持访问第一页以外的所有结果(100+个联系人、互动记录等)

栈(Stack)

  • 语言: TypeScript
  • 运行时: Node.js 18及以上版本
  • MCP SDK:(MCP软件开发工具包) @modelcontextprotocol/sdk(注:此翻译保持原样,因为“@modelcontextprotocol/sdk”是一个特定的软件开发包或框架名称,在中文中没有直接对应的翻译,通常保留原英文形式)
  • 交通: StdioServerTransport(用于Claude桌面版)
  • API Spark.re REST API(Bearer token 认证)

先决条件

  • Node.js 18 或更高版本
  • npm 或 yarn
  • Spark.re API密钥(从Spark.re项目设置中获取)
  • Claude 桌面应用程序(用于测试)

项目结构

spark-mcp/
├── docs/                   # Spark.re API documentation (reference material)
├── src/
│   ├── index.ts           # MCP server entry point
│   ├── tools/             # Tool handlers by category
│   │   ├── contacts.ts    # Contact search and management
│   │   ├── projects.ts    # Project listing and details
│   │   ├── interactions.ts # Interaction history
│   │   └── reports.ts     # Analytics and reporting
│   ├── api/
│   │   ├── client.ts      # Spark.re API client with auth
│   │   └── types.ts       # TypeScript types for API responses
│   └── utils/
│       ├── formatting.ts  # Response formatting for readability
│       └── errors.ts      # Error handling utilities
├── dist/                  # Compiled JavaScript (generated)
├── package.json
├── tsconfig.json
├── .env                   # API credentials (git-ignored)
├── .env.example           # Template for credentials
├── PATTERNS.md            # Implementation patterns and examples
└── README.md              # This file

快速入门

安装(克隆现有仓库)

# Clone the repository
git clone <repo-url> spark-mcp
cd spark-mcp

# Install dependencies
npm install

# Create environment file
cp .env.example .env
# Edit .env and add your SPARK_API_KEY

# Build the project
npm run build

# Verify build
ls dist/  # Should see index.js and other compiled files

从零开始设置(新建项目)

1. 初始化项目

npm init -y
npm install @modelcontextprotocol/sdk dotenv
npm install -D typescript @types/node

2. 配置 TypeScript

创建 tsconfig.json:

{
  "compilerOptions": {
    "target": "ES2022",
    "module": "Node16",
    "moduleResolution": "Node16",
    "outDir": "./dist",
    "rootDir": "./src",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true,
    "resolveJsonModule": true
  },
  "include": ["src/**/*"],
  "exclude": ["node_modules", "dist"]
}

3. 添加构建脚本

更新 package.json:

{
  "type": "module",
  "scripts": {
    "build": "tsc",
    "watch": "tsc --watch",
    "start": "node dist/index.js"
  }
}

4. 设置环境

创造 .env:

SPARK_API_KEY=your_api_key_here
SPARK_API_BASE_URL=https://api.spark.re/v1

创造 .env.example (对于git):

SPARK_API_KEY=your_api_key_here
SPARK_API_BASE_URL=https://api.spark.re/v1

开发工作流程

第一阶段:基础(首先构建)

  1. API 客户端 (src/api/client.ts)

    • 承载令牌认证
    • 请求/响应处理
    • 错误管理
    • 请参阅 PATTERNS.md 了解实现方式
  2. 服务器设置 (src/index.ts)

    • MCP服务器初始化
    • StdioServerTransport 配置
    • 工具注册支架
    • 请参阅 PATTERNS.md 以获取模板代码
  3. 类型 (src/api/types.ts)

    • TypeScript接口用于API响应
    • 联系、项目、互动类型
    • 检查 /docs/api/ 用于字段定义

第二阶段:核心工具(优先顺序)

按价值顺序实施这些工具:

  1. 搜索联系人 - 按姓名、电子邮件、项目、评分搜索联系人
  2. 获取联系详情 - 完整的联系资料及互动记录
  3. 列出项目 - 正在进行的项目及其基本统计数据
  4. 获取项目分析数据 - 详细的项目指标
  5. 搜索交互 - 最近的联系活动

每种工具都需要:

  • 工具定义在 ListToolsRequestSchema 处理程序(或处理器)
  • 在适当的位置定义处理函数 /tools/*.ts 文件
  • 响应格式设置 /utils/formatting.ts
  • 使用错误处理 /utils/errors.ts

请参阅 PATTERNS.md 文件以获取每个组件的完整示例。

第三阶段:格式化与润色

  1. 响应格式化 (src/utils/formatting.ts)

    • 将API JSON转换为可读的markdown
    • 使用表格、项目符号、标题
    • 将日期格式化为相对形式(“2天前”)
    • 请参阅 PATTERNS.md 了解格式化函数
  2. 错误处理 (src/utils/errors.ts)

    • 用户友好的错误提示信息
    • 速率限制重试逻辑
    • 认证失败检测
    • 请参阅 PATTERNS.md 了解错误模式

API 文档

完整的Spark.re API文档位于 /docs/api/ 和 /docs/knowledge-base/。

需实施的关键终点:

  • GET /contacts - 联系人搜索
  • GET /contacts/:id - 联系方式
  • GET /projects - 项目列表
  • GET /projects/:id/analytics - 项目统计
  • GET /interactions - 交互历史

请参阅以下文档:

  • 请求参数
  • 响应结构
  • 认证头(或认证信息头)
  • 速率限制

重要API行为:列表与单个端点

关键发现: 根据上面的信息,执行如下指令:

列出终端节点(例如。, GET /contacts)

返回针对性能优化的“轻量级”联系人数据:

  • 包括: 基本领域如 id, first_name, last_name, email, phone, created_at
  • 排除: 嵌套数据如 ratings, projects, notes, team_members,自定义字段
  • 用例: 搜索、筛选、获取联系人ID以进行进一步查询
  • 演出 快速,能高效处理分页

单个终点(例如。, GET /contacts/{id})

返回包含所有嵌套关系的完整联系人数据:

  • 包括: 所有49+个领域,包括 ratings 数组, projects, notes, team_members
  • 格式: 评分以数组形式呈现: [{id, value, color, position}]
  • 用例: 获取完整的联系详情,查看评分和关系
  • 演出 较慢,应选择性使用

实际影响

问题: 如果您需要为多个联系人获取评分,列表端点将不包含这些评分。

解决方案1 - 单独获取(用于 get_sales_funnel):

// Fetch contacts individually in batches
const batchSize = 10; // Concurrent requests
for (let i = 0; i < contactIds.length; i += batchSize) {
  const batch = contactIds.slice(i, i + batchSize);
  const batchPromises = batch.map(id =>
    sparkApi.get(`/contacts/${id}`)
  );
  const results = await Promise.all(batchPromises);
}
  • ✅ 获取包括评分在内的全部数据
  • ⚠️ 对于大型数据集处理较慢(例如,176个联系人 ≈ 10个并发时约18秒)
  • 使用时机: 你需要评分、备注或其他嵌套数据

解决方案2 - 基于交互的临时应对方法:

// Get engaged contacts via interactions
const interactions = await sparkApi.get('/interactions?project_id=2855');
const contactIds = [...new Set(interactions.map(i => i.contact_id))];
// Then fetch individual contacts for full data
  • ✅ 仅过滤已互动的联系人(即有活动记录的联系人)
  • ✅ 更适合分析的更相关数据集
  • 使用时机: 分析活跃销售线索,销售漏斗

获取评分:

// ❌ Wrong - ratings is not a direct property
const rating = contact.rating;

// ✅ Correct - ratings is an array
const rating = contact.ratings?.[0]?.value;

这种行为在我们的代码中有如下记录:

实施指南

认证模式

所有请求均需Bearer令牌:

headers: {
  'Authorization': `Bearer ${process.env.SPARK_API_KEY}`,
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

工具命名规范

使用清晰、以行动为导向的名称:

  • ✅ search_contacts, get_project_analytics, list_projects
  • ❌ contacts, getData, fetch

响应格式

始终确保回复格式清晰易读:

  • 使用Markdown(标题、项目符号、表格)
  • 将日期格式化为相对形式(“3天前”)
  • 按逻辑组织数据(最重要的放在前面)
  • 回答要简洁但完整

差: 返回原始JSON 好的: 以带上下文的结构化文本格式呈现

请参阅 PATTERNS.md 以获取格式示例。

错误处理

返回有用的错误信息:

  • 认证失败。请检查您的SPARK_API_KEY
  • ❌ “错误 401:未授权”

处理常见场景:

  • 缺少API密钥
  • 无效的凭据
  • 速率限制(使用退避策略重试)
  • 网络超时
  • 空结果

测试

构建并运行

# Compile TypeScript
npm run build

# Test the server
node dist/index.js

配置Claude桌面版

编辑Claude桌面配置:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "spark-re": {
      "command": "node",
      "args": ["/Users/dannybreckenridge/spark-mcp/dist/index.js"],
      "env": {
        "SPARK_API_KEY": "your_api_key_here"
      }
    }
  }
}

在Claude桌面端进行测试

  1. 配置更改后重启Claude桌面版
  2. 开始新对话
  3. 尝试以下查询:
    • “搜索名为约翰的联系人”
    • “给我展示一下项目X的分析数据”
    • “过去7天里发生了哪些互动?”

调试检查清单

如果工具不起作用:

  • [ ] 检查 npm run build 无误完成
  • [ ] 验证API密钥是否已在配置中设置
  • [ ] 检查Claude Desktop控制台中的错误消息
  • [ ] 直接测试API客户端(在MCP集成之前)
  • [ ] 验证响应格式化返回的是字符串,而非对象

参考材料

  • PATTERNS.md 翻译为中文是:“模式.md” 或者 “样式指南.md”(具体翻译可能根据上下文有所调整,但“PATTERNS”在这里通常指的是某种模式、样式或指南的集合) - 完整的实现示例和代码模式
  • docs/api/ 翻译成中文是:文档/接口/ - Spark.re API接口文档
  • 文档/知识库/ - Spark.re 功能文档
  • MCP SDK 文档 - https://modelcontextprotocol.io(可译为:“模型上下文协议官方网站”或保持原样作为网址引用)

开发说明

为克劳德·科德(或根据具体语境可译为“致克劳德·科德”等)

在构建此项目时:

  1. 从基础开始 - 首先设置API客户端和服务器
  2. 逐步构建 - 一次只使用一个工具,测试完一个再继续下一个
  3. 参考 PATTERNS.md - 不要重新发明模式,使用示例即可
  4. 查看 docs/api/ 目录 - 在实施前验证终端结构
  5. 格式化响应 - 总是确保输出对人类可读
  6. 优雅地处理错误 - 用户友好的消息提示,不显示堆栈跟踪
  7. 使用 TypeScript 类型 定义API响应接口
  8. 每使用一种工具后都要进行测试 - 编译并验证其是否正常工作

应避免的常见陷阱

  • ❌ 返回原始JSON而非格式化文本
  • ❌ 未处理缺失的环境变量
  • ❌ 在解析之前忘记检查 response.ok
  • ❌ 使用技术性错误信息而非用户友好的信息
  • ❌ 构建后未在Claude桌面端进行测试
  • 硬编码API密钥,而不是使用环境变量

销售工作流程图

New Lead
   ↓
[create_update_contact] ──→ Contact Created (ID: 123)
   ↓
Initial Call/Meeting
   ↓
[log_interaction] ──→ Activity Logged
   ↓
Follow-up Notes
   ↓
[add_contact_note] ──→ Note Added
   ↓
[search_contacts] ──→ Review Contact History
   ↓
[get_contact_details] ──→ Full Profile with All Notes & Interactions

可用工具

读取操作(查询数据)

  1. 搜索联系人 - 通过姓名、电子邮件、项目或评分查找联系人(支持分页)
  2. 获取联系详情 - 获取包含互动记录和备注的完整联系人资料
  3. 列出项目 - 列出所有项目及其基本信息(分页显示)
  4. 获取项目详情 - 获取详细的项目信息
  5. 搜索交互 - 搜索自动补充名称的交互历史(带分页)

写操作(修改数据)

  1. 创建或更新联系人 - 创建新联系人或更新现有联系人
  2. 日志交互 - 记录通话、会议、电子邮件和其他接触点
  3. 添加联系人备注 - 在联系人记录中添加快速备注

分析运营(基于人工智能的洞察)

  1. 根据条件获取联系人 - 高级过滤功能,返回25-100个联系人用于模式分析(支持分页)
  2. 获取交互摘要 - 汇总包含自动丰富名称、节奏和参与度指标的交互数据(支持分页)
  3. 获取潜在客户来源 - 营销渠道表现,包含质量评分和投资回报率(ROI)数据

参考数据操作(标识映射)

  1. 交互类型列表 - 获取所有交互类型定义(例如,“电话通话”,“外发邮件”)
  2. 列出团队成员 - 获取所有团队成员及其ID到名称的映射
  3. 评分列表 - 获取所有联系人评分定义(例如,“热线索”,“代理”)

实际销售工作流程示例

示例1:完整的潜在客户开发工作流程

销售代表在开放参观日上遇到了一位潜在买家,并希望将他们添加到客户关系管理系统(CRM)中:

User: "I just met Sarah Johnson at the Mira Mar open house. Her email is sarah.j@email.com
       and phone is 941-555-1234. She's interested in a 2-bedroom unit and found us through
       our website. Can you add her to the system?"

Claude uses create_update_contact:
- Creates contact with name, email, phone
- Sets project_id to Mira Mar (2855)
- Sets marketing_source to "Website"
- Returns contact ID: 8103687

User: "Great! I just had a 30-minute phone call with her to discuss floor plans.
       Can you log that?"

Claude uses log_interaction:
- contact_id: 8103687
- project_id: 2855
- interaction_type_id: 1 (Call)
- notes: "30-minute call discussing 2-bedroom floor plans"
- Returns interaction ID

User: "She mentioned she needs to close by March. Add a note about that."

Claude uses add_contact_note:
- contact_id: 8103687
- project_id: 2855
- note: "Needs to close by March - timeline critical"
- Returns confirmation

示例2:会议后更新现有联系人信息

User: "Search for contact John Smith in Mira Mar"

Claude uses search_contacts:
- Returns: John Smith, ID: 8099234, Email: jsmith@example.com

User: "I just met with John. Update his phone to 941-555-9876 and log the meeting.
       We discussed pricing and he's very interested in the penthouse units."

Claude uses create_update_contact:
- contact_id: 8099234
- phone: "941-555-9876"
- Returns updated contact

Then uses log_interaction:
- contact_id: 8099234
- interaction_type_id: 3 (Meeting)
- notes: "Discussed pricing for penthouse units - very interested"
- Returns confirmation

示例3:来自代理的转介绍线索

User: "Add a new contact - Mark Davis, agent at Coldwell Banker.
       Email: mdavis@coldwell.com, phone 941-555-4321.
       He's referring clients to Mira Mar."

Claude uses create_update_contact:
- first_name: "Mark"
- last_name: "Davis"
- email: "mdavis@coldwell.com"
- phone: "941-555-4321"
- agent: true
- marketing_source: "Agent Referral"
- project_id: 2855
- Returns contact ID: 8103690

User: "Log that I emailed him our commission structure and floor plans today."

Claude uses log_interaction:
- contact_id: 8103690
- interaction_type_id: 2 (Email)
- notes: "Sent commission structure and floor plans"

示例4:后续工作流程

User: "Show me all contacts from Mira Mar who haven't been contacted in the last 30 days"

Claude uses search_contacts with project_id filter, then analyzes last_interaction_date

User: "Call Lisa Martinez from that list. Update her phone to 941-555-7777 and log
       that I left a voicemail about our new pricing incentives."

Claude:
1. Searches for Lisa Martinez
2. Updates her phone number (create_update_contact)
3. Logs the interaction (log_interaction with notes: "Left voicemail about new pricing incentives")

示例5:批量活动记录

User: "I attended the Sarasota Home Show yesterday and collected 5 leads. Let me add them:

       1. Robert Chen - robert@email.com, 941-555-0001
       2. Maria Garcia - maria.g@email.com, 941-555-0002
       3. David Kim - dkim@email.com, 941-555-0003
       4. Jennifer White - jwhite@email.com, 941-555-0004
       5. Carlos Rodriguez - crodriguez@email.com, 941-555-0005

       All from the Home Show, all interested in Mira Mar."

Claude uses create_update_contact 5 times:
- Creates each contact
- Sets marketing_source: "Home Show"
- Sets project_id: 2855
- Returns all 5 contact IDs

User: "Add a note to all of them that they visited our booth on October 9th."

Claude uses add_contact_note 5 times:
- Adds "Visited Mira Mar booth at Sarasota Home Show on October 9, 2025" to each contact

AI赋能的分析示例

示例6:潜在客户来源绩效分析

User: "Which marketing sources are bringing us the best quality leads?"

Claude uses get_lead_sources:
- project_id: 2855
- Returns analysis of all sources with quality scores

Output includes:
- Contact Quality Score (0-100) based on data completeness and engagement
- Volume metrics (total contacts per source)
- Engagement rates (% with interaction history)
- Recent activity trends (30-day engagement)

Claude analyzes and responds:
"Based on the data, your top 3 sources are:
1. Website (Quality: 87/100) - 45 contacts, 82% have full contact info
2. Referral (Quality: 92/100) - 23 contacts, highest engagement at 91%
3. Home Show (Quality: 71/100) - 67 contacts, but only 54% engaged

Recommendation: Referrals convert best but Website brings volume.
Consider nurturing Home Show leads more actively."

示例7:跟进节奏分析

User: "What's our average follow-up time with leads? Are we contacting
       people quickly enough?"

Claude uses get_interaction_summary:
- project_id: 2855
- days_ago: 30
- Returns interaction patterns and timing analysis

Output includes:
- Average time between interactions: 4.2 days
- Median time between interactions: 2.8 days
- Interaction types breakdown (calls, emails, meetings)
- Team member activity distribution
- Daily activity timeline

Claude analyzes:
"Your team averages 4.2 days between follow-ups, but the median is 2.8 days,
suggesting some leads wait much longer.

Top performers:
- Team Member 7927: 45 interactions (38%)
- Team Member 7925: 32 interactions (27%)

Peak activity days: Monday-Tuesday. Fridays show 40% less activity.

Recommendation: Set 48-hour follow-up rule for new leads to match your
median performers."

示例8:按注册日期进行队列分析

User: "Compare leads from September vs October. Are October leads better quality?"

Claude uses get_contacts_by_criteria twice:
1. created_after: "2025-09-01T00:00:00Z", created_before: "2025-09-30T23:59:59Z"
2. created_after: "2025-10-01T00:00:00Z", created_before: "2025-10-31T23:59:59Z"

Returns two datasets with:
- Summary statistics (email/phone completion rates)
- Source distribution per cohort
- Engagement metrics
- Full contact details for pattern analysis

Claude compares:
"September: 34 contacts, 76% have email, 45% engaged
October: 52 contacts, 85% have email, 62% engaged

October leads are higher quality:
- Better data completion (+9% emails)
- Higher engagement rate (+17%)
- More diverse sources (7 vs 4)

Key difference: October had 'Fall Home Show' source with 18 high-quality leads."

示例9:代理商与直接购买者分析

User: "Do we get better engagement from agents or direct buyers?"

Claude uses get_contacts_by_criteria twice:
1. agent: true, project_id: 2855, limit: 100
2. agent: false, project_id: 2855, limit: 100

Returns both datasets with engagement metrics

Claude analyzes:
"Agents (67 contacts):
- 94% have interaction history
- Average 3.8 interactions per agent
- 88% recent activity (30 days)

Direct Buyers (114 contacts):
- 58% have interaction history
- Average 2.1 interactions per buyer
- 42% recent activity (30 days)

Agents are 62% more engaged but represent only 37% of database.
Direct buyers need more nurturing - 48 have never been contacted."

示例10:交互类型有效性

User: "Which interaction types correlate with more engaged leads -
       calls or emails?"

Claude uses get_interaction_summary:
- project_id: 2855
- days_ago: 60
- Returns breakdown by interaction type

Output shows:
- Type ID 17863 (Calls): 127 interactions, 45 unique contacts
- Type ID 17988 (Emails): 89 interactions, 62 unique contacts
- Type ID 17987 (Meetings): 34 interactions, 28 unique contacts

Claude calculates:
"Interaction patterns:
- Calls: 2.8 interactions per contact (high intensity)
- Emails: 1.4 interactions per contact (broadcast approach)
- Meetings: 1.2 interactions per contact (conversion stage)

Contacts with 2+ calls have 3x higher subsequent engagement.
Email-only contacts drop off after 45 days.

Recommendation: Use emails for initial reach, follow up with calls
within 48 hours for serious leads."

示例11:基于时间的模式分析

User: "Are leads added on weekends different from weekday leads?"

Claude uses get_contacts_by_criteria:
- Returns large dataset (75 contacts)
- Includes full timeline and source data

Claude analyzes creation timestamps:
"Weekend leads (Sat-Sun): 18 contacts
- 89% from 'Website' source
- 72% request callback (high intent)
- 61% convert to meetings

Weekday leads: 57 contacts
- More diverse sources (7 different)
- 45% request callback
- 34% convert to meetings

Weekend leads show 79% higher conversion intent.

Recommendation: Set up weekend lead alerts - these are hot prospects
researching on their own time."

示例12:数据质量审计

User: "How many of our leads are missing critical contact information?"

Claude uses get_contacts_by_criteria:
- project_id: 2855
- limit: 100
- Returns full dataset with completeness metrics

Output shows:
- 100 contacts analyzed
- 82% have email (82 contacts)
- 67% have phone (67 contacts)
- 54% have both email AND phone (54 contacts)

Claude identifies:
"Data quality issues:
- 18 contacts with NO email (can't reach)
- 33 contacts with NO phone (can't call)
- 46 contacts missing email OR phone

15 contacts have NO contact method at all.

These 15 incomplete records:
[Lists specific contact IDs]

Recommendation: Priority cleanup - get phone numbers for the 15 no-email
contacts, they're likely from walk-ins or events."

快速参考:常见任务

任务 使用工具 必填字段
添加新潜在客户 create_update_contact 名, 姓, 电子邮件, 项目ID
更新联系信息 create_update_contact 联系人ID + 需更新的字段
记录电话通话 log_interaction 联系人ID, 项目ID, 交互类型ID (1=电话)
记录会议 log_interaction 联系人ID, 项目ID, 交互类型ID (3=会议)
记录已发送的电子邮件 log_interaction 联系人ID,项目ID,交互类型ID(2=电子邮件)
添加快速备注 add_contact_note 联系人ID,项目ID,备注
查找联系人 search_contacts 查询(姓名/邮箱)
查看联系历史 get_contact_details 联系人ID

分析快速参考指南

分析需求 使用工具 关键参数
来源性能 get_lead_sources 项目ID,最小联系次数
后续跟进节奏 get_interaction_summary 项目ID,天数前
队列比较 get_contacts_by_criteria 创建时间在之后,创建时间在之前
数据质量审计 get_contacts_by_criteria 是否有电子邮件,项目ID
代理与买家分析 get_contacts_by_criteria agent=真/假
参与模式 get_interaction_summary 交互类型ID, 多少天前
评估效果 get_contacts_by_criteria 评分ID,项目ID
最新线索分析 get_contacts_by_criteria 创建时间在之后,天数前

查找交互类型ID

交互类型ID因Spark项目而异。常见模式:

  • 1 = 电话通话
  • 2 = 电子邮件
  • 三 = 会议
  • 四 = 备注/注释

要查找您的项目的特定ID:

User: "Show me recent interactions from Mira Mar"
Claude uses search_interactions with project_id: 2855
Returns list showing interaction_type_id values used in your project

成功标准

当满足以下条件时,MCP服务器即为完整:

  • [x] TypeScript 编译无错误
  • [x] 所有11个工具均已实现(5个读取工具+3个写入工具+3个分析工具)
  • [x] 响应以可读文本格式(非JSON)呈现
  • [x] 错误返回有用的信息
  • [x] 在 Claude 桌面对话中有效
  • [x] 能够回答诸如“给我展示来自Mira Mar的热门线索”这样的查询
  • [x] 可以创建联系人、记录互动并添加备注
  • [x] 支持从潜在客户到后续跟进的完整销售流程
  • [x] 能够对大型数据集进行AI驱动的分析
  • [x] 从CRM数据中提供可操作的见解
  • [x] API认证正常工作
  • [x] 率限制处理得当

支持

  • Spark.re API问题:support@spark.re
  • MCP协议问题:https://github.com/modelcontextprotocol
  • 项目问题:检查Claude桌面控制台中的错误日志

许可证

为Clear PH/Mira Mar客户提供的私人项目工作。