Skip to content
Open
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
15 changes: 15 additions & 0 deletions .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "vapi",
"description": "Build AI voice assistants and phone agents with Vapi",
"version": "0.0.10",
"author": {
"name": "Vapi AI",
"url": "https://vapi.ai"
},
"homepage": "https://github.com/VapiAI/mcp-server#readme",
"repository": "https://github.com/VapiAI/mcp-server",
"license": "MIT",
"keywords": ["vapi", "voice", "ai", "phone", "assistant", "mcp"],
"mcpServers": "./.mcp.json",
"skills": "./skills/"
}
8 changes: 8 additions & 0 deletions .mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"mcpServers": {
"vapi": {
"command": "node",
"args": ["${CLAUDE_PLUGIN_ROOT}/dist/index.js"]
}
}
}
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@
"files": [
"dist",
"dist/**/*.d.ts",
"dist/**/*.d.ts.map"
"dist/**/*.d.ts.map",
".claude-plugin",
".mcp.json",
"skills"
],
"dependencies": {
"@modelcontextprotocol/sdk": "^1.12.3",
Expand Down
File renamed without changes.
33 changes: 11 additions & 22 deletions skill/SKILL.md → skills/vapi/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,17 @@ Build AI-powered voice assistants, phone agents, and conversational AI applicati

When a user wants to build a voice assistant or phone agent, follow these steps:

### Step 1: Check if Vapi MCP is Installed

First, check if the Vapi MCP server is available by looking for `vapi_` tools. If not available, tell the user to run:

```bash
claude mcp add vapi -- npx -y @vapi-ai/mcp-server
```

Then restart Claude Code and continue with Step 2.

### Step 2: Authenticate with Vapi
### Step 1: Authenticate with Vapi

If the user hasn't authenticated yet (tools return auth errors):

1. Call `vapi_login` to start the OAuth flow
2. Tell the user to open the provided URL and sign in
3. Once authenticated, proceed with their request

### Step 3: Build the Voice Assistant
### Step 2: Build the Voice Assistant

Before creating an assistant, fetch the latest prompt engineering guidelines from the [Prompt Guide](https://raw.githubusercontent.com/VapiAI/mcp-server/main/skill/PROMPT_GUIDE.md).
Before creating an assistant, read the prompt engineering guidelines from the MCP resource `vapi://prompt-guide` from server `plugin:vapi:vapi` (use `ReadMcpResourceTool` with server `plugin:vapi:vapi` and uri `vapi://prompt-guide`).

Use these guidelines to craft effective voice assistant prompts based on what the user wants to build.

Expand Down Expand Up @@ -70,19 +60,18 @@ Use these guidelines to craft effective voice assistant prompts based on what th
**User:** "I want to build a voice assistant that can schedule appointments"

**Claude should:**
1. Check for Vapi MCP -> install if needed
2. Authenticate if needed
3. Fetch the prompt guide for best practices
4. Ask about their business to understand context
5. Create an assistant with a scheduling-focused prompt
6. Offer to set up a phone number
7. Help create calendar integration tools if needed
1. Authenticate if needed
2. Read the prompt guide resource for best practices
3. Ask about their business to understand context
4. Create an assistant with a scheduling-focused prompt
5. Offer to set up a phone number
6. Help create calendar integration tools if needed

**User:** "Make me a phone bot that answers questions about my business"

**Claude should:**
1. Ensure Vapi MCP is installed and authenticated
2. Fetch the prompt guide for best practices
1. Authenticate if needed
2. Read the prompt guide resource for best practices
3. Ask about the business: name, services, hours, common questions
4. Craft a system prompt following the guidelines
5. Create the assistant
Expand Down
20 changes: 20 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ import { VapiClient } from '@vapi-ai/server-sdk';
import { hasValidToken, getToken, startAuthFlow, isAuthInProgress, getAuthUrl, clearConfig } from './auth.js';
import { registerAllTools } from './tools/index.js';

import { readFileSync } from 'fs';
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';
import dotenv from 'dotenv';
dotenv.config();

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

// Lazy-initialized Vapi client
let vapiClient: VapiClient | null = null;

Expand Down Expand Up @@ -124,6 +130,20 @@ function createMcpServer() {

registerAllTools(mcpServer, clientProxy);

// Expose the prompt guide as an MCP resource
mcpServer.resource(
'prompt-guide',
'vapi://prompt-guide',
{ description: 'Voice assistant prompt engineering guide with best practices for crafting Vapi assistant prompts', mimeType: 'text/markdown' },
async (uri) => {
const guidePath = join(__dirname, '..', 'skills', 'vapi', 'PROMPT_GUIDE.md');
const content = readFileSync(guidePath, 'utf-8');
return {
contents: [{ uri: uri.href, text: content }],
};
}
);

return mcpServer;
}

Expand Down