Skip to content

Commit e7b64bf

Browse files
lukatmyshuclaude
andcommitted
feat: add OAuth login flow and Claude Code skill
- Add browser-based OAuth authentication (no API key needed on first use) - Add vapi_login and vapi_status tools for auth management - Add Claude Code skill with voice assistant prompt engineering guide - Update README with Claude Code setup instructions - Rename package from @vapi-ai/mcp-server to vapi-mcp for simpler npx usage The OAuth flow works like `gh auth login`: 1. User calls a Vapi tool 2. If not authenticated, local HTTP server starts for OAuth callback 3. Browser opens to Vapi dashboard for sign-in 4. After auth, API key is saved locally for future use Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent c644117 commit e7b64bf

File tree

7 files changed

+772
-128
lines changed

7 files changed

+772
-128
lines changed

README.md

Lines changed: 142 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,71 @@
22

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

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

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

11+
## Claude Code Setup (Recommended)
12+
13+
The easiest way to get started. No API key needed - authenticate via browser on first use.
14+
15+
### 1. Add MCP Server
16+
17+
Add to your `~/.claude.json`:
18+
19+
```json
20+
{
21+
"mcpServers": {
22+
"vapi": {
23+
"command": "npx",
24+
"args": ["-y", "vapi-mcp"]
25+
}
26+
}
27+
}
28+
```
29+
30+
### 2. Install Skill (Optional)
31+
32+
The Vapi skill helps Claude guide you through building voice assistants:
33+
34+
```bash
35+
mkdir -p ~/.claude/skills/vapi
36+
curl -o ~/.claude/skills/vapi/SKILL.md https://raw.githubusercontent.com/VapiAI/mcp-server/main/skill/SKILL.md
37+
```
38+
39+
### 3. Restart Claude Code
40+
41+
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.
42+
43+
---
44+
1145
## Claude Desktop Setup
1246

13-
1. Open `Claude Desktop` and press `CMD + ,` to go to `Settings`.
14-
2. Click on the `Developer` tab.
15-
3. Click on the `Edit Config` button.
16-
4. This will open the `claude_desktop_config.json` file in your file explorer.
17-
5. Get your Vapi API key from the Vapi dashboard (<https://dashboard.vapi.ai/org/api-keys>).
18-
6. Add the following to your `claude_desktop_config.json` file. See [here](https://modelcontextprotocol.io/quickstart/user) for more details.
19-
7. Restart the Claude Desktop after editing the config file.
47+
### With OAuth (No API Key)
48+
49+
```json
50+
{
51+
"mcpServers": {
52+
"vapi": {
53+
"command": "npx",
54+
"args": ["-y", "vapi-mcp"]
55+
}
56+
}
57+
}
58+
```
59+
60+
### With API Key
2061

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

2364
```json
2465
{
2566
"mcpServers": {
26-
"vapi-mcp-server": {
67+
"vapi": {
2768
"command": "npx",
28-
"args": [
29-
"-y",
30-
"@vapi-ai/mcp-server"
31-
],
69+
"args": ["-y", "vapi-mcp"],
3270
"env": {
3371
"VAPI_TOKEN": "<your_vapi_token>"
3472
}
@@ -39,10 +77,12 @@ The Vapi [Model Context Protocol](https://modelcontextprotocol.com/) server allo
3977

4078
### Remote Configuration
4179

80+
Connect to Vapi's hosted MCP server:
81+
4282
```json
4383
{
4484
"mcpServers": {
45-
"vapi-mcp": {
85+
"vapi": {
4686
"command": "npx",
4787
"args": [
4888
"mcp-remote",
@@ -58,48 +98,47 @@ The Vapi [Model Context Protocol](https://modelcontextprotocol.com/) server allo
5898
}
5999
```
60100

61-
### Example Usage with Claude Desktop
101+
---
62102

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

68-
**Example 1:** Request an immediate call
105+
### Create a Voice Assistant
69106

70-
```md
71-
I'd like to speak with my ShopHelper assistant to talk about my recent order. Can you have it call me at +1234567890?
107+
Ask Claude:
72108
```
73-
74-
**Example 2:** Schedule a future call
75-
76-
```md
77-
I need to schedule a call with Mary assistant for next Tuesday at 3:00 PM. My phone number is +1555123456.
109+
I want to build a voice assistant that can schedule appointments
78110
```
79111

80-
**Example 3:** Make a call with dynamic variables
112+
### Make an Outbound Call
81113

82-
```md
83-
I want to call +1234567890 with my appointment reminder assistant. Use these details:
114+
```
115+
Call +1234567890 using my appointment reminder assistant with these details:
84116
- Customer name: Sarah Johnson
85117
- Appointment date: March 25th
86118
- Appointment time: 2:30 PM
87-
- Doctor name: Dr. Smith
88119
```
89120

121+
### Schedule a Future Call
122+
123+
```
124+
Schedule a call with my support assistant for next Tuesday at 3:00 PM to +1555123456
125+
```
126+
127+
---
128+
90129
## Using Variable Values in Assistant Prompts
91130

92-
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}}`.
131+
The `create_call` action supports passing dynamic variables through `assistantOverrides.variableValues`. Use double curly braces in your assistant's prompts: `{{variableName}}`.
93132

94-
### Example Assistant Prompt with Variables
133+
### Example Prompt with Variables
95134

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

100139
### Default Variables
101140

102-
The following variables are automatically available (no need to pass in variableValues):
141+
These are automatically available (no need to pass):
103142

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

112-
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).
151+
See [Vapi documentation](https://docs.vapi.ai/assistants/dynamic-variables#default-variables) for advanced date/time formatting.
113152

114-
## Remote MCP
153+
---
115154

116-
To connect to Vapi's MCP server remotely:
155+
## Remote MCP Server
117156

118-
### Streamable HTTP (Recommended)
157+
Connect to Vapi's hosted MCP server from any MCP client:
119158

120-
The default and recommended way to connect is via Streamable HTTP Transport:
159+
### Streamable HTTP (Recommended)
121160

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

126164
### SSE (Deprecated)
127165

128-
Server-Sent Events (SSE) Transport is still supported but deprecated:
129-
130-
- Connect to `https://mcp.vapi.ai/sse` from any MCP client using SSE Transport
131-
- Include your Vapi API key as a bearer token in the request headers
132-
- Example header: `Authorization: Bearer your_vapi_api_key_here`
133-
134-
This connection allows you to access Vapi's functionality remotely without running a local server.
166+
- URL: `https://mcp.vapi.ai/sse`
167+
- Header: `Authorization: Bearer your_vapi_api_key_here`
168+
169+
---
170+
171+
## Available Tools
172+
173+
### Assistants
174+
| Tool | Description |
175+
|------|-------------|
176+
| `vapi_list_assistants` | List all assistants |
177+
| `vapi_get_assistant` | Get assistant by ID |
178+
| `vapi_create_assistant` | Create new assistant |
179+
| `vapi_update_assistant` | Update assistant |
180+
| `vapi_delete_assistant` | Delete assistant |
181+
182+
### Calls
183+
| Tool | Description |
184+
|------|-------------|
185+
| `vapi_list_calls` | List call history |
186+
| `vapi_get_call` | Get call details |
187+
| `vapi_create_call` | Start outbound call (immediate or scheduled) |
188+
189+
### Phone Numbers
190+
| Tool | Description |
191+
|------|-------------|
192+
| `vapi_list_phone_numbers` | List phone numbers |
193+
| `vapi_get_phone_number` | Get phone number details |
194+
| `vapi_buy_phone_number` | Purchase new number |
195+
| `vapi_update_phone_number` | Update number settings |
196+
| `vapi_delete_phone_number` | Release number |
197+
198+
### Tools (Function Calling)
199+
| Tool | Description |
200+
|------|-------------|
201+
| `vapi_list_tools` | List custom tools |
202+
| `vapi_get_tool` | Get tool details |
203+
| `vapi_create_tool` | Create tool for API integration |
204+
| `vapi_update_tool` | Update tool |
205+
| `vapi_delete_tool` | Delete tool |
206+
207+
### Authentication
208+
| Tool | Description |
209+
|------|-------------|
210+
| `vapi_login` | Start OAuth flow |
211+
| `vapi_status` | Check auth status |
212+
213+
---
135214

136215
## Development
137216

138217
```bash
139218
# Install dependencies
140219
npm install
141220

142-
# Build the server
221+
# Build
143222
npm run build
144223

145-
# Use inspector to test the server
224+
# Test with MCP inspector
146225
npm run inspector
147226
```
148227

149-
Update your `claude_desktop_config.json` to use the local server.
228+
### Local Development Config
150229

151230
```json
152231
{
153232
"mcpServers": {
154233
"vapi-local": {
155234
"command": "node",
156-
"args": [
157-
"<path_to_vapi_mcp_server>/dist/index.js"
158-
],
235+
"args": ["<path>/dist/index.js"],
159236
"env": {
160237
"VAPI_TOKEN": "<your_vapi_token>"
161238
}
162-
},
239+
}
163240
}
164241
}
165242
```
166243

167244
### Testing
168245

169-
The project has two types of tests:
170-
171-
#### Unit Tests
172-
173-
Unit tests use mocks to test the MCP server without making actual API calls to Vapi.
174-
175246
```bash
176-
# Run unit tests
247+
# Unit tests (mocked)
177248
npm run test:unit
178-
```
179-
180-
#### End-to-End Tests
181249

182-
E2E tests run the full MCP server with actual API calls to Vapi.
183-
184-
```bash
185-
# Set your Vapi API token
250+
# E2E tests (requires VAPI_TOKEN)
186251
export VAPI_TOKEN=your_token_here
187-
188-
# Run E2E tests
189252
npm run test:e2e
190-
```
191-
192-
Note: E2E tests require a valid Vapi API token to be set in the environment.
193-
194-
#### Running All Tests
195-
196-
To run all tests at once:
197253

198-
```bash
254+
# All tests
199255
npm test
200256
```
201257

258+
---
259+
202260
## References
203261

204-
- [VAPI Remote MCP Server](https://mcp.vapi.ai/)
205-
- [VAPI MCP Tool](https://docs.vapi.ai/tools/mcp)
206-
- [VAPI MCP Server SDK](https://docs.vapi.ai/sdk/mcp-server)
262+
- [Vapi Documentation](https://docs.vapi.ai)
263+
- [Vapi Dashboard](https://dashboard.vapi.ai)
264+
- [Vapi Remote MCP Server](https://mcp.vapi.ai/)
207265
- [Model Context Protocol](https://modelcontextprotocol.com/)
208-
- [Claude Desktop](https://modelcontextprotocol.io/quickstart/user)
209-
210-
## Supported Actions
211-
212-
The Vapi MCP Server provides the following tools for integration:
213-
214-
### Assistant Tools
215-
216-
- `list_assistants`: Lists all Vapi assistants
217-
- `create_assistant`: Creates a new Vapi assistant
218-
- `update_assistant`: Updates an existing Vapi assistant
219-
- `get_assistant`: Gets a Vapi assistant by ID
220-
221-
### Call Tools
222-
223-
- `list_calls`: Lists all Vapi calls
224-
- `create_call`: Creates an outbound call with support for:
225-
- Immediate or scheduled calls
226-
- Dynamic variable values through `assistantOverrides`
227-
- `get_call`: Gets details of a specific call
228-
229-
> **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.
230-
231-
### Phone Number Tools
232-
233-
- `list_phone_numbers`: Lists all Vapi phone numbers
234-
- `get_phone_number`: Gets details of a specific phone number
235-
236-
### Vapi Tools
237-
238-
- `list_tools`: Lists all Vapi tools
239-
- `get_tool`: Gets details of a specific tool

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "@vapi-ai/mcp-server",
3-
"description": "Vapi MCP Server",
4-
"version": "0.0.9",
2+
"name": "vapi-mcp",
3+
"description": "Vapi MCP Server - Build AI voice assistants with Claude",
4+
"version": "0.0.10",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
77
"type": "module",
@@ -30,7 +30,7 @@
3030
"tool-calling"
3131
],
3232
"bin": {
33-
"@vapi-ai/mcp-server": "dist/index.js"
33+
"vapi-mcp": "dist/index.js"
3434
},
3535
"scripts": {
3636
"prepare": "npm run build",

0 commit comments

Comments
 (0)