Skip to content

Commit 6366f5c

Browse files
lukatmyshuclaude
andcommitted
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 <noreply@anthropic.com>
1 parent c5daf98 commit 6366f5c

3 files changed

Lines changed: 24 additions & 3 deletions

File tree

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848
"files": [
4949
"dist",
5050
"dist/**/*.d.ts",
51-
"dist/**/*.d.ts.map"
51+
"dist/**/*.d.ts.map",
52+
"skill"
5253
],
5354
"dependencies": {
5455
"@modelcontextprotocol/sdk": "^1.12.3",

skill/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ If the user hasn't authenticated yet (tools return auth errors):
3131

3232
### Step 3: Build the Voice Assistant
3333

34-
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).
34+
Before creating an assistant, read the prompt engineering guidelines from the MCP resource `vapi://prompt-guide` (available from the Vapi MCP server).
3535

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

@@ -72,7 +72,7 @@ Use these guidelines to craft effective voice assistant prompts based on what th
7272
**Claude should:**
7373
1. Check for Vapi MCP -> install if needed
7474
2. Authenticate if needed
75-
3. Fetch the prompt guide for best practices
75+
3. Read the prompt guide resource for best practices
7676
4. Ask about their business to understand context
7777
5. Create an assistant with a scheduling-focused prompt
7878
6. Offer to set up a phone number

src/index.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@ import { VapiClient } from '@vapi-ai/server-sdk';
66
import { hasValidToken, getToken, startAuthFlow, isAuthInProgress, getAuthUrl, clearConfig } from './auth.js';
77
import { registerAllTools } from './tools/index.js';
88

9+
import { readFileSync } from 'fs';
10+
import { fileURLToPath } from 'url';
11+
import { dirname, join } from 'path';
912
import dotenv from 'dotenv';
1013
dotenv.config();
1114

15+
const __filename = fileURLToPath(import.meta.url);
16+
const __dirname = dirname(__filename);
17+
1218
// Lazy-initialized Vapi client
1319
let vapiClient: VapiClient | null = null;
1420

@@ -124,6 +130,20 @@ function createMcpServer() {
124130

125131
registerAllTools(mcpServer, clientProxy);
126132

133+
// Expose the prompt guide as an MCP resource
134+
mcpServer.resource(
135+
'prompt-guide',
136+
'vapi://prompt-guide',
137+
{ description: 'Voice assistant prompt engineering guide with best practices for crafting Vapi assistant prompts', mimeType: 'text/markdown' },
138+
async (uri) => {
139+
const guidePath = join(__dirname, '..', 'skill', 'PROMPT_GUIDE.md');
140+
const content = readFileSync(guidePath, 'utf-8');
141+
return {
142+
contents: [{ uri: uri.href, text: content }],
143+
};
144+
}
145+
);
146+
127147
return mcpServer;
128148
}
129149

0 commit comments

Comments
 (0)