Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
258 changes: 142 additions & 116 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,71 @@

[![smithery badge](https://smithery.ai/badge/@VapiAI/vapi-mcp-server)](https://smithery.ai/server/@VapiAI/vapi-mcp-server)

The Vapi [Model Context Protocol](https://modelcontextprotocol.com/) server allows you to integrate with Vapi APIs through function calling.
Build AI voice assistants and phone agents with [Vapi](https://vapi.ai) using the [Model Context Protocol](https://modelcontextprotocol.com/).

<a href="https://glama.ai/mcp/servers/@VapiAI/mcp-server">
<img width="380" height="200" src="https://glama.ai/mcp/servers/@VapiAI/mcp-server/badge" alt="Vapi Server MCP server" />
</a>

## Claude Code Setup (Recommended)

The easiest way to get started. No API key needed - authenticate via browser on first use.

### 1. Add MCP Server

Add to your `~/.claude.json`:

```json
{
"mcpServers": {
"vapi": {
"command": "npx",
"args": ["-y", "@vapi-ai/mcp-server"]
}
}
}
```

### 2. Install Skill (Optional)

The Vapi skill helps Claude guide you through building voice assistants:

```bash
mkdir -p ~/.claude/skills/vapi
curl -o ~/.claude/skills/vapi/SKILL.md https://raw.githubusercontent.com/VapiAI/mcp-server/main/skill/SKILL.md
```

### 3. Restart Claude Code

After restarting, use `/vapi` or ask Claude to help build a voice assistant. On first use, you'll be prompted to sign in via browser - no API key copy-paste needed.

---

## Claude Desktop Setup

1. Open `Claude Desktop` and press `CMD + ,` to go to `Settings`.
2. Click on the `Developer` tab.
3. Click on the `Edit Config` button.
4. This will open the `claude_desktop_config.json` file in your file explorer.
5. Get your Vapi API key from the Vapi dashboard (<https://dashboard.vapi.ai/org/api-keys>).
6. Add the following to your `claude_desktop_config.json` file. See [here](https://modelcontextprotocol.io/quickstart/user) for more details.
7. Restart the Claude Desktop after editing the config file.
### With OAuth (No API Key)

```json
{
"mcpServers": {
"vapi": {
"command": "npx",
"args": ["-y", "@vapi-ai/mcp-server"]
}
}
}
```

### With API Key

### Local Configuration
If you prefer to use an API key directly, get one from the [Vapi dashboard](https://dashboard.vapi.ai/org/api-keys):

```json
{
"mcpServers": {
"vapi-mcp-server": {
"vapi": {
"command": "npx",
"args": [
"-y",
"@vapi-ai/mcp-server"
],
"args": ["-y", "@vapi-ai/mcp-server"],
"env": {
"VAPI_TOKEN": "<your_vapi_token>"
}
Expand All @@ -39,10 +77,12 @@ The Vapi [Model Context Protocol](https://modelcontextprotocol.com/) server allo

### Remote Configuration

Connect to Vapi's hosted MCP server:

```json
{
"mcpServers": {
"vapi-mcp": {
"vapi": {
"command": "npx",
"args": [
"mcp-remote",
Expand All @@ -58,48 +98,47 @@ The Vapi [Model Context Protocol](https://modelcontextprotocol.com/) server allo
}
```

### Example Usage with Claude Desktop
---

1. Create or import a phone number using the Vapi dashboard (<https://dashboard.vapi.ai/phone-numbers>).
2. Create a new assistant using the existing 'Appointment Scheduler' template in the Vapi dashboard (<https://dashboard.vapi.ai/assistants>).
3. Make sure to configure Claude Desktop to use the Vapi MCP server and restart the Claude Desktop app.
4. Ask Claude to initiate or schedule a call. See examples below:
## Example Usage

**Example 1:** Request an immediate call
### Create a Voice Assistant

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

**Example 2:** Schedule a future call

```md
I need to schedule a call with Mary assistant for next Tuesday at 3:00 PM. My phone number is +1555123456.
I want to build a voice assistant that can schedule appointments
```

**Example 3:** Make a call with dynamic variables
### Make an Outbound Call

```md
I want to call +1234567890 with my appointment reminder assistant. Use these details:
```
Call +1234567890 using my appointment reminder assistant with these details:
- Customer name: Sarah Johnson
- Appointment date: March 25th
- Appointment time: 2:30 PM
- Doctor name: Dr. Smith
```

### Schedule a Future Call

```
Schedule a call with my support assistant for next Tuesday at 3:00 PM to +1555123456
```

---

## Using Variable Values in Assistant Prompts

The `create_call` action supports passing dynamic variables through `assistantOverrides.variableValues`. These variables can be used in your assistant's prompts using double curly braces: `{{variableName}}`.
The `create_call` action supports passing dynamic variables through `assistantOverrides.variableValues`. Use double curly braces in your assistant's prompts: `{{variableName}}`.

### Example Assistant Prompt with Variables
### Example Prompt with Variables

```
Hello {{customerName}}, this is a reminder about your appointment on {{appointmentDate}} at {{appointmentTime}} with {{doctorName}}.
```

### Default Variables

The following variables are automatically available (no need to pass in variableValues):
These are automatically available (no need to pass):

- `{{now}}` - Current date and time (UTC)
- `{{date}}` - Current date (UTC)
Expand All @@ -109,131 +148,118 @@ The following variables are automatically available (no need to pass in variable
- `{{year}}` - Current year (UTC)
- `{{customer.number}}` - Customer's phone number

For more details on default variables and advanced date/time formatting, see the [official Vapi documentation](https://docs.vapi.ai/assistants/dynamic-variables#default-variables).
See [Vapi documentation](https://docs.vapi.ai/assistants/dynamic-variables#default-variables) for advanced date/time formatting.

## Remote MCP
---

To connect to Vapi's MCP server remotely:
## Remote MCP Server

### Streamable HTTP (Recommended)
Connect to Vapi's hosted MCP server from any MCP client:

The default and recommended way to connect is via Streamable HTTP Transport:
### Streamable HTTP (Recommended)

- Connect to `https://mcp.vapi.ai/mcp` from any MCP client using Streamable HTTP Transport
- Include your Vapi API key as a bearer token in the request headers
- Example header: `Authorization: Bearer your_vapi_api_key_here`
- URL: `https://mcp.vapi.ai/mcp`
- Header: `Authorization: Bearer your_vapi_api_key_here`

### SSE (Deprecated)

Server-Sent Events (SSE) Transport is still supported but deprecated:

- Connect to `https://mcp.vapi.ai/sse` from any MCP client using SSE Transport
- Include your Vapi API key as a bearer token in the request headers
- Example header: `Authorization: Bearer your_vapi_api_key_here`

This connection allows you to access Vapi's functionality remotely without running a local server.
- URL: `https://mcp.vapi.ai/sse`
- Header: `Authorization: Bearer your_vapi_api_key_here`

---

## Available Tools

### Assistants
| Tool | Description |
|------|-------------|
| `vapi_list_assistants` | List all assistants |
| `vapi_get_assistant` | Get assistant by ID |
| `vapi_create_assistant` | Create new assistant |
| `vapi_update_assistant` | Update assistant |
| `vapi_delete_assistant` | Delete assistant |

### Calls
| Tool | Description |
|------|-------------|
| `vapi_list_calls` | List call history |
| `vapi_get_call` | Get call details |
| `vapi_create_call` | Start outbound call (immediate or scheduled) |

### Phone Numbers
| Tool | Description |
|------|-------------|
| `vapi_list_phone_numbers` | List phone numbers |
| `vapi_get_phone_number` | Get phone number details |
| `vapi_buy_phone_number` | Purchase new number |
| `vapi_update_phone_number` | Update number settings |
| `vapi_delete_phone_number` | Release number |

### Tools (Function Calling)
| Tool | Description |
|------|-------------|
| `vapi_list_tools` | List custom tools |
| `vapi_get_tool` | Get tool details |
| `vapi_create_tool` | Create tool for API integration |
| `vapi_update_tool` | Update tool |
| `vapi_delete_tool` | Delete tool |

### Authentication
| Tool | Description |
|------|-------------|
| `vapi_login` | Start OAuth flow |
| `vapi_auth_status` | Check auth status |

---

## Development

```bash
# Install dependencies
npm install

# Build the server
# Build
npm run build

# Use inspector to test the server
# Test with MCP inspector
npm run inspector
```

Update your `claude_desktop_config.json` to use the local server.
### Local Development Config

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

### Testing

The project has two types of tests:

#### Unit Tests

Unit tests use mocks to test the MCP server without making actual API calls to Vapi.

```bash
# Run unit tests
# Unit tests (mocked)
npm run test:unit
```

#### End-to-End Tests

E2E tests run the full MCP server with actual API calls to Vapi.

```bash
# Set your Vapi API token
# E2E tests (requires VAPI_TOKEN)
export VAPI_TOKEN=your_token_here

# Run E2E tests
npm run test:e2e
```

Note: E2E tests require a valid Vapi API token to be set in the environment.

#### Running All Tests

To run all tests at once:

```bash
# All tests
npm test
```

---

## References

- [VAPI Remote MCP Server](https://mcp.vapi.ai/)
- [VAPI MCP Tool](https://docs.vapi.ai/tools/mcp)
- [VAPI MCP Server SDK](https://docs.vapi.ai/sdk/mcp-server)
- [Vapi Documentation](https://docs.vapi.ai)
- [Vapi Dashboard](https://dashboard.vapi.ai)
- [Vapi Remote MCP Server](https://mcp.vapi.ai/)
- [Model Context Protocol](https://modelcontextprotocol.com/)
- [Claude Desktop](https://modelcontextprotocol.io/quickstart/user)

## Supported Actions

The Vapi MCP Server provides the following tools for integration:

### Assistant Tools

- `list_assistants`: Lists all Vapi assistants
- `create_assistant`: Creates a new Vapi assistant
- `update_assistant`: Updates an existing Vapi assistant
- `get_assistant`: Gets a Vapi assistant by ID

### Call Tools

- `list_calls`: Lists all Vapi calls
- `create_call`: Creates an outbound call with support for:
- Immediate or scheduled calls
- Dynamic variable values through `assistantOverrides`
- `get_call`: Gets details of a specific call

> **Note:** The `create_call` action supports scheduling calls for immediate execution or for a future time. You can also pass dynamic variables using `assistantOverrides.variableValues` to personalize assistant messages.

### Phone Number Tools

- `list_phone_numbers`: Lists all Vapi phone numbers
- `get_phone_number`: Gets details of a specific phone number

### Vapi Tools

- `list_tools`: Lists all Vapi tools
- `get_tool`: Gets details of a specific tool
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@vapi-ai/mcp-server",
"description": "Vapi MCP Server",
"version": "0.0.9",
"description": "Vapi MCP Server - Build AI voice assistants with Claude",
"version": "0.0.10",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"type": "module",
Expand Down
Loading