From 6366f5cfc2dd8c54a017855223c457c31a1c4c40 Mon Sep 17 00:00:00 2001 From: Vijay Raghunathan Date: Wed, 28 Jan 2026 12:34:20 -0800 Subject: [PATCH 1/2] feat: bundle skill and serve prompt guide as MCP resource Include skill/ directory in the npm package and expose PROMPT_GUIDE.md as a local MCP resource (vapi://prompt-guide) instead of fetching from GitHub at runtime. Co-Authored-By: Claude Opus 4.5 --- package.json | 3 ++- skill/SKILL.md | 4 ++-- src/index.ts | 20 ++++++++++++++++++++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index b447975..956ab5e 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,8 @@ "files": [ "dist", "dist/**/*.d.ts", - "dist/**/*.d.ts.map" + "dist/**/*.d.ts.map", + "skill" ], "dependencies": { "@modelcontextprotocol/sdk": "^1.12.3", diff --git a/skill/SKILL.md b/skill/SKILL.md index 431ceaa..4ac8978 100644 --- a/skill/SKILL.md +++ b/skill/SKILL.md @@ -31,7 +31,7 @@ If the user hasn't authenticated yet (tools return auth errors): ### Step 3: 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` (available from the Vapi MCP server). Use these guidelines to craft effective voice assistant prompts based on what the user wants to build. @@ -72,7 +72,7 @@ Use these guidelines to craft effective voice assistant prompts based on what th **Claude should:** 1. Check for Vapi MCP -> install if needed 2. Authenticate if needed -3. Fetch the prompt guide for best practices +3. Read the prompt guide resource 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 diff --git a/src/index.ts b/src/index.ts index 1c03b67..1b5ab7b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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; @@ -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, '..', 'skill', 'PROMPT_GUIDE.md'); + const content = readFileSync(guidePath, 'utf-8'); + return { + contents: [{ uri: uri.href, text: content }], + }; + } + ); + return mcpServer; } From b918037bccfd22a0bd7990a1ff516bf10ace748f Mon Sep 17 00:00:00 2001 From: Vijay Raghunathan Date: Wed, 28 Jan 2026 13:58:09 -0800 Subject: [PATCH 2/2] feat: restructure as Claude Code plugin Add plugin manifest (.claude-plugin/plugin.json) and bundled MCP server config (.mcp.json) so users get both the skill and MCP server in one install. Move skill files to skills/vapi/ to match the plugin convention and remove the manual MCP install step from the workflow. Co-Authored-By: Claude Opus 4.5 --- .claude-plugin/plugin.json | 15 ++++++++++++ .mcp.json | 8 +++++++ package.json | 4 +++- {skill => skills/vapi}/PROMPT_GUIDE.md | 0 {skill => skills/vapi}/SKILL.md | 33 +++++++++----------------- src/index.ts | 2 +- 6 files changed, 38 insertions(+), 24 deletions(-) create mode 100644 .claude-plugin/plugin.json create mode 100644 .mcp.json rename {skill => skills/vapi}/PROMPT_GUIDE.md (100%) rename {skill => skills/vapi}/SKILL.md (72%) diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..2d5e547 --- /dev/null +++ b/.claude-plugin/plugin.json @@ -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/" +} diff --git a/.mcp.json b/.mcp.json new file mode 100644 index 0000000..f29b803 --- /dev/null +++ b/.mcp.json @@ -0,0 +1,8 @@ +{ + "mcpServers": { + "vapi": { + "command": "node", + "args": ["${CLAUDE_PLUGIN_ROOT}/dist/index.js"] + } + } +} diff --git a/package.json b/package.json index 956ab5e..b2a1aee 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,9 @@ "dist", "dist/**/*.d.ts", "dist/**/*.d.ts.map", - "skill" + ".claude-plugin", + ".mcp.json", + "skills" ], "dependencies": { "@modelcontextprotocol/sdk": "^1.12.3", diff --git a/skill/PROMPT_GUIDE.md b/skills/vapi/PROMPT_GUIDE.md similarity index 100% rename from skill/PROMPT_GUIDE.md rename to skills/vapi/PROMPT_GUIDE.md diff --git a/skill/SKILL.md b/skills/vapi/SKILL.md similarity index 72% rename from skill/SKILL.md rename to skills/vapi/SKILL.md index 4ac8978..1f8e3c7 100644 --- a/skill/SKILL.md +++ b/skills/vapi/SKILL.md @@ -11,17 +11,7 @@ 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): @@ -29,9 +19,9 @@ If the user hasn't authenticated yet (tools return auth errors): 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, read the prompt engineering guidelines from the MCP resource `vapi://prompt-guide` (available from the Vapi MCP server). +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. @@ -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. Read the prompt guide resource 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 diff --git a/src/index.ts b/src/index.ts index 1b5ab7b..cbbfb90 100644 --- a/src/index.ts +++ b/src/index.ts @@ -136,7 +136,7 @@ function createMcpServer() { '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, '..', 'skill', 'PROMPT_GUIDE.md'); + const guidePath = join(__dirname, '..', 'skills', 'vapi', 'PROMPT_GUIDE.md'); const content = readFileSync(guidePath, 'utf-8'); return { contents: [{ uri: uri.href, text: content }],