Vapi MCP Server

Official

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Allows the MCP server to be installed and run via NPX, making it easy to integrate Vapi's capabilities through the NPM package ecosystem.

Vapi MCP 服务器

Vapi模型上下文协议服务器允许您通过函数调用与 Vapi API 集成。

Claude 桌面设置

  1. 打开Claude Desktop并按CMD + ,进入Settings
  2. 单击Developer选项卡。
  3. 单击Edit Config按钮。
  4. 这将在您的文件资源管理器中打开claude_desktop_config.json文件。
  5. 从 Vapi 仪表板 ( https://dashboard.vapi.ai/org/api-keys ) 获取您的 Vapi API 密钥。
  6. 将以下内容添加到您的claude_desktop_config.json文件中。更多详情请参阅此处
  7. 编辑配置文件后重新启动 Claude Desktop。
{ "mcpServers": { "vapi-mcp-server": { "command": "npx", "args": [ "-y", "@vapi-ai/mcp-server" ], "env": { "VAPI_TOKEN": "<your_vapi_token>" } } } }

Claude Desktop 的使用示例

  1. 使用 Vapi 仪表板 ( https://dashboard.vapi.ai/phone-numbers ) 创建或导入电话号码。
  2. 使用 Vapi 仪表板 ( https://dashboard.vapi.ai/assistants ) 中现有的“预约计划程序”模板创建一个新的助手。
  3. 确保配置 Claude Desktop 以使用 Vapi MCP 服务器并重新启动 Claude Desktop 应用程序。
  4. 请求 Claude 发起或安排通话。请参阅以下示例:

**示例 1:**请求立即呼叫

I'd like to speak with my ShopHelper assistant to talk about my recent order. Can you have it call me at +1234567890?

**示例 2:**安排未来通话

I need to schedule a call with Mary assistant for next Tuesday at 3:00 PM. My phone number is +1555123456.

远程 SSE 连接

要通过服务器发送事件 (SSE) 传输连接到 Vapi 的 MCP 服务器:

  • 使用 SSE Transport 从任何 MCP 客户端连接到https://mcp.vapi.ai/sse
  • 将您的 Vapi API 密钥作为承载令牌包含在请求标头中
  • 示例标题: Authorization: Bearer your_vapi_api_key_here

此连接允许您远程访问 Vapi 的功能,而无需运行本地服务器。

发展

# Install dependencies npm install # Build the server npm run build

更新您的claude_desktop_config.json以使用本地服务器。

{ "mcpServers": { "vapi-local": { "command": "node", "args": [ "<path_to_vapi_mcp_server>/dist/index.js" ], "env": { "VAPI_TOKEN": "<your_vapi_token>" } }, } }

测试

该项目有两种类型的测试:

单元测试

单元测试使用模拟来测试 MCP 服务器,而无需对 Vapi 进行实际的 API 调用。

# Run unit tests npm run test:unit

端到端测试

E2E 测试运行完整的 MCP 服务器并对 Vapi 进行实际 API 调用。

# Set your Vapi API token export VAPI_TOKEN=your_token_here # Run E2E tests npm run test:e2e

注意:E2E 测试需要在环境中设置有效的 Vapi API 令牌。

运行所有测试

要同时运行所有测试:

npm test

参考

支持的操作

Vapi MCP 服务器提供以下集成工具:

辅助工具

  • list_assistants :列出所有 Vapi 助手
  • create_assistant :创建一个新的 Vapi 助手
  • get_assistant :通过 ID 获取 Vapi 助手

呼叫工具

  • list_calls :列出所有 Vapi 调用
  • create_call :创建外拨电话
  • get_call :获取特定呼叫的详细信息

注意: create_call操作支持安排立即执行或将来执行的调用。

电话号码工具

  • list_phone_numbers :列出所有 Vapi 电话号码
  • get_phone_number :获取特定电话号码的详细信息

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

通过模型上下文协议的函数调用实现与 Vapi API 的集成,从而允许 AI 模型访问 Vapi 的功能。

  1. Claude Desktop Setup
    1. Example Usage with Claude Desktop
  2. Remote SSE Connection
    1. Development
      1. Testing
    2. References
      1. Supported Actions
        1. Assistant Tools
        2. Call Tools
        3. Phone Number Tools
      ID: 36gq6pif6r