Skip to main content
Glama

Vapi client MCP

一个本地 stdio MCP 服务器,用于配置客户端级别的 Vapi 入站应答助手。它封装了 Vapi REST API,而不是较小的托管 Vapi MCP 工具集。

第一个模板会立即应答,表明自己是 AI,捕获来电者姓名、回拨号码、原因和回拨时间窗口,然后提供可用的转接或明确说明的回拨。通话结束数据可以发送到公共 webhook,或保留在 Vapi 中供后续 CRM 处理。

已实现的功能

MCP 工具

Vapi 操作

provision_client

渲染应答模板,POST /assistant,保存本地客户端状态

apply_template

渲染并 PATCH /assistant/:id,同时保留已附加的工具 ID

set_prompt_and_voice

针对性的助手提示词、模型、首条消息和语音更新

attach_phone

PATCH /phone-number/:idPOST /phone-number,始终绑定 assistantId

attach_tools

POST /tool,然后通过助手模型附加 ID

set_structured_outputs

使用客户端的 assistantIds 执行 POST /structured-output

smoke_test_call

确认的 POST /call,可选轮询获取转录和结构化数据

list_client_status

读取助手、绑定的号码和最新通话;报告部分错误

客户端记录存放在 clients/<slug>.json。它们包含 Vapi 资源 ID 和非机密的业务配置,绝不包含 Vapi 密钥或提供商凭据。如果业务元数据本身可以提交,这些 JSON 文件适合作为配置即代码。

Related MCP server: RetellAI MCP Server

安装与运行

需要 Node.js 20 或更高版本。

cd /home/blaine/projects/vapi-mcp
npm install
npm run check
npm run build
export VAPI_API_KEY="your private server-side Vapi key"
npm start

服务器通过 stdio 使用 MCP 协议通信,因此其标准输出保留给协议消息。日志输出到标准错误。

对于 MCP 主机,复制 examples/mcp-client.json,替换绝对路径,并将真实密钥仅放在主机的私有配置或密钥管理器中。已提交的示例和 .env.example 仅包含占位符。本项目不会自动加载 .env 文件。

首个客户端工作流

按此顺序调用工具:

  1. provision_client

  2. set_structured_outputs

  3. attach_phone

  4. attach_tools 用于转接、回拨、日历或 CRM 操作

  5. smoke_test_call

  6. list_client_status

示例 provision_client 参数:

{
  "clientSlug": "acme-hvac",
  "businessName": "Acme HVAC",
  "trade": "HVAC",
  "timezone": "America/New_York",
  "businessHours": "Monday-Friday 08:00-17:00; closed federal holidays",
  "transferNumber": "+12125550123",
  "crm": "GoHighLevel",
  "webhookUrl": "https://example.com/webhooks/vapi/end-of-call"
}

在没有 outputDefinitions 的情况下,set_structured_outputs 会从 templates/inbound-answering.json 安装模式。它提取:

  • callerName

  • callbackNumber

  • reason

  • callbackWindow

  • transferOutcome

  • complete

绑定现有号码:

{
  "clientSlug": "acme-hvac",
  "phoneNumberId": "00000000-0000-4000-8000-000000000000"
}

或者将提供商特定的 POST /phone-number 请求体作为 phoneConfiguration 传入。服务器会用客户端的助手 ID 覆盖任何提供的 assistantId。优先使用 Vapi 凭据 ID,而不是原始的 Twilio、Telnyx、Vonage 或 SIP 密钥;瞬时的 MCP 参数不会写入客户端记录。

attach_tools 接受完整的 Vapi POST /tool 定义、现有的工具 UUID,或两者兼有。这有意保留 Vapi 的提供商特定工具联合,而不是发明更窄的本地模式。在将其 ID 附加到助手之前,需要成功的 Vapi 工具响应。

冒烟测试路径

smoke_test_call 会创建真实的外呼电话,可能产生 Vapi 和运营商费用。除非 confirmBillableCall 恰好为 true,否则不会运行。

{
  "clientSlug": "acme-hvac",
  "customerNumber": "+12125550999",
  "waitSeconds": 45,
  "confirmBillableCall": true
}

waitSeconds: 0 时,工具立即返回排队的通话。在 1–55 秒时,它会轮询 GET /call/:id 并返回当前状态、结束原因、转录文本和结构化数据(如果可用)。只测试您有权拨打的号码,并遵守适用的通话、录音同意和隐私规则。

模板行为与限制

模板使用助手优先的消息,以便立即披露身份。提示词使用口语意图路由,并告诉模型在没有工具确认的情况下不要声称转接、预订、回拨或 CRM 写入成功。当营业/打烊状态不确定时,它会记录回拨而不是猜测。

包含的营业时间是提示词上下文,不是确定性的节假日/日历引擎。实际的转接和回拨执行需要附加的 Vapi 工具。Webhook 必须是公共的,并且能够接受 Vapi end-of-call-report 负载。对于受监管的业务,在生产环境前添加所需的录音同意、保留和专业建议控制。

验证

npm run check

聚焦测试枚举了全部八个 MCP 工具,检查模板契约,针对模拟的 Vapi 客户端执行 REST 工作流,并验证 bearer 密钥的脱敏。它们不会发起真实的 Vapi 调用,因为本仓库中不包含私钥、已配置的号码或已同意的目的地。

来源

实现契约遵循 Vapi 当前官方文档中的 助手电话号码自定义工具结构化输出通话服务器事件

Install Server
F
license - not found
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

View all related MCP servers

Related MCP Connectors

  • Manage AI assistants, history, calls, campaigns, contacts, knowledge, messaging, and automations.

  • Manage Voice Logica agents, calls, phones, workflows, messaging, and integrations.

  • List, configure, chat with, analyse and embed your Echo AI assistants.

View all MCP Connectors

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/BlaineHeffron/vapi-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server