Skip to content

Commit 1172216

Browse files
committed
feat: cli launch
1 parent 2cb8237 commit 1172216

17 files changed

+2081
-0
lines changed

fern/cli/authentication.mdx

Lines changed: 462 additions & 0 deletions
Large diffs are not rendered by default.

fern/cli/mcp-integration.mdx

Lines changed: 393 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,393 @@
1+
---
2+
title: MCP integration
3+
description: Turn your IDE into a Vapi expert with Model Context Protocol
4+
---
5+
6+
## Overview
7+
8+
The Model Context Protocol (MCP) integration transforms your IDE's AI assistant into a Vapi expert. Once configured, your IDE gains complete, accurate knowledge of Vapi's APIs, features, and best practices - eliminating AI hallucinations and outdated information.
9+
10+
**In this guide, you'll learn to:**
11+
- Set up MCP in supported IDEs
12+
- Understand what knowledge is provided
13+
- Use your enhanced IDE effectively
14+
- Troubleshoot common issues
15+
16+
## Quick start
17+
18+
Run the setup command to auto-configure all supported IDEs:
19+
20+
```bash
21+
vapi mcp setup
22+
```
23+
24+
Or configure a specific IDE:
25+
26+
```bash
27+
vapi mcp setup cursor # For Cursor
28+
vapi mcp setup windsurf # For Windsurf
29+
vapi mcp setup vscode # For VSCode with Copilot
30+
```
31+
32+
## What is MCP?
33+
34+
Model Context Protocol is a standard that allows AI assistants to access structured knowledge and tools. When you set up MCP for Vapi:
35+
36+
- Your IDE's AI gains access to complete Vapi documentation
37+
- Code suggestions become accurate and up-to-date
38+
- Examples use real, working Vapi patterns
39+
- API hallucinations are eliminated
40+
41+
## Supported IDEs
42+
43+
<CardGroup cols={3}>
44+
<Card title="Cursor" icon="code" href="https://cursor.sh">
45+
AI-first code editor with deep MCP integration
46+
47+
**Setup:** Creates `.cursor/mcp.json`
48+
</Card>
49+
<Card title="Windsurf" icon="wind" href="https://codeium.com/windsurf">
50+
Codeium's AI-powered IDE
51+
52+
**Setup:** Creates `.windsurf/mcp.json`
53+
</Card>
54+
<Card title="VSCode" icon="brands microsoft" href="https://code.visualstudio.com">
55+
With GitHub Copilot extension
56+
57+
**Setup:** Configures Copilot settings
58+
</Card>
59+
</CardGroup>
60+
61+
## How it works
62+
63+
### What gets configured
64+
65+
The MCP setup creates configuration files that connect your IDE to the Vapi MCP server:
66+
67+
<Tabs>
68+
<Tab title="Cursor">
69+
**File:** `.cursor/mcp.json`
70+
```json
71+
{
72+
"servers": {
73+
"vapi-docs": {
74+
"command": "npx",
75+
"args": ["@vapi-ai/mcp-server"]
76+
}
77+
}
78+
}
79+
```
80+
</Tab>
81+
<Tab title="Windsurf">
82+
**File:** `.windsurf/mcp.json`
83+
```json
84+
{
85+
"servers": {
86+
"vapi-docs": {
87+
"command": "npx",
88+
"args": ["@vapi-ai/mcp-server"]
89+
}
90+
}
91+
}
92+
```
93+
</Tab>
94+
<Tab title="VSCode">
95+
**Settings:** Updates workspace settings
96+
```json
97+
{
98+
"github.copilot.advanced": {
99+
"mcp.servers": {
100+
"vapi-docs": {
101+
"command": "npx",
102+
"args": ["@vapi-ai/mcp-server"]
103+
}
104+
}
105+
}
106+
}
107+
```
108+
</Tab>
109+
</Tabs>
110+
111+
### What knowledge is provided
112+
113+
Your IDE gains access to:
114+
115+
- **Complete API Reference** - Every endpoint, parameter, and response
116+
- **Code Examples** - Working samples for all features
117+
- **Integration Guides** - Step-by-step implementation patterns
118+
- **Best Practices** - Recommended approaches and patterns
119+
- **Latest Features** - Always up-to-date with new releases
120+
- **Troubleshooting** - Common issues and solutions
121+
122+
## Using your enhanced IDE
123+
124+
### Example prompts
125+
126+
Once MCP is configured, try these prompts in your IDE:
127+
128+
<AccordionGroup>
129+
<Accordion title="Creating assistants">
130+
**Prompt:** "How do I create a voice assistant with Vapi?"
131+
132+
Your IDE will provide accurate code like:
133+
```typescript
134+
import { VapiClient } from "@vapi-ai/server-sdk";
135+
136+
const client = new VapiClient({ token: process.env.VAPI_API_KEY });
137+
138+
const assistant = await client.assistants.create({
139+
name: "Customer Support",
140+
model: {
141+
provider: "openai",
142+
model: "gpt-4",
143+
systemPrompt: "You are a helpful customer support agent..."
144+
},
145+
voice: {
146+
provider: "11labs",
147+
voiceId: "rachel"
148+
}
149+
});
150+
```
151+
</Accordion>
152+
153+
<Accordion title="Webhook handling">
154+
**Prompt:** "Show me how to handle Vapi webhooks"
155+
156+
Get complete webhook examples:
157+
```typescript
158+
app.post('/webhook', async (req, res) => {
159+
const { type, call, assistant } = req.body;
160+
161+
switch (type) {
162+
case 'call-started':
163+
console.log(`Call ${call.id} started`);
164+
break;
165+
case 'speech-update':
166+
console.log(`User said: ${req.body.transcript}`);
167+
break;
168+
case 'function-call':
169+
// Handle tool calls
170+
const { functionName, parameters } = req.body.functionCall;
171+
const result = await handleFunction(functionName, parameters);
172+
res.json({ result });
173+
return;
174+
}
175+
176+
res.status(200).send();
177+
});
178+
```
179+
</Accordion>
180+
181+
<Accordion title="Advanced features">
182+
**Prompt:** "How do I set up call recording with custom storage?"
183+
184+
Get detailed implementation:
185+
```typescript
186+
const assistant = await client.assistants.create({
187+
name: "Recorded Assistant",
188+
recordingEnabled: true,
189+
artifactPlan: {
190+
recordingEnabled: true,
191+
videoRecordingEnabled: false,
192+
recordingPath: "s3://my-bucket/recordings/{call_id}"
193+
},
194+
credentialIds: ["aws-s3-credential-id"]
195+
});
196+
```
197+
</Accordion>
198+
</AccordionGroup>
199+
200+
### Best practices
201+
202+
<Steps>
203+
<Step title="Be specific">
204+
Ask detailed questions about Vapi features:
205+
- ✅ "How do I transfer calls to a human agent in Vapi?"
206+
- ❌ "How do I transfer calls?"
207+
</Step>
208+
209+
<Step title="Request examples">
210+
Ask for working code samples:
211+
- "Show me a complete example of..."
212+
- "Generate a working implementation of..."
213+
</Step>
214+
215+
<Step title="Check versions">
216+
Specify SDK versions when needed:
217+
- "Using @vapi-ai/web v2.0, how do I..."
218+
- "What's the latest way to..."
219+
</Step>
220+
</Steps>
221+
222+
## Configuration options
223+
224+
### Check status
225+
226+
View current MCP configuration:
227+
228+
```bash
229+
vapi mcp status
230+
```
231+
232+
Output:
233+
```
234+
MCP Configuration Status:
235+
✓ Cursor: Configured (.cursor/mcp.json)
236+
✗ Windsurf: Not configured
237+
✓ VSCode: Configured (workspace settings)
238+
239+
Vapi MCP Server: v1.2.3 (latest)
240+
```
241+
242+
### Update server
243+
244+
Keep the MCP server updated:
245+
246+
```bash
247+
# Update to latest version
248+
npm update -g @vapi-ai/mcp-server
249+
250+
# Or reinstall
251+
npm install -g @vapi-ai/mcp-server@latest
252+
```
253+
254+
### Remove configuration
255+
256+
Remove MCP configuration:
257+
258+
```bash
259+
# Remove from all IDEs
260+
vapi mcp remove
261+
262+
# Remove from specific IDE
263+
vapi mcp remove cursor
264+
```
265+
266+
## How MCP tools work
267+
268+
The Vapi MCP server provides these tools to your IDE:
269+
270+
<CardGroup cols={2}>
271+
<Card title="Search Documentation" icon="magnifying-glass">
272+
Semantic search across all Vapi docs
273+
274+
**Example:** "How to handle voicemail detection"
275+
</Card>
276+
<Card title="Get Examples" icon="code">
277+
Retrieve code samples for any feature
278+
279+
**Example:** "WebSocket connection example"
280+
</Card>
281+
<Card title="API Reference" icon="book">
282+
Get detailed API endpoint information
283+
284+
**Example:** "POST /assistant parameters"
285+
</Card>
286+
<Card title="Implementation Guides" icon="map">
287+
Step-by-step guides for complex features
288+
289+
**Example:** "Workflow implementation guide"
290+
</Card>
291+
</CardGroup>
292+
293+
## Troubleshooting
294+
295+
<AccordionGroup>
296+
<Accordion title="MCP not working in IDE">
297+
If your IDE isn't using the MCP knowledge:
298+
299+
1. **Restart your IDE** after configuration
300+
2. **Check the logs** in your IDE's output panel
301+
3. **Verify npm is accessible** from your IDE
302+
4. **Ensure MCP server is installed** globally
303+
304+
```bash
305+
# Verify installation
306+
npm list -g @vapi-ai/mcp-server
307+
```
308+
</Accordion>
309+
310+
<Accordion title="Permission errors">
311+
For permission issues:
312+
313+
```bash
314+
# Install with proper permissions
315+
sudo npm install -g @vapi-ai/mcp-server
316+
317+
# Or use a Node version manager
318+
nvm use 18
319+
npm install -g @vapi-ai/mcp-server
320+
```
321+
</Accordion>
322+
323+
<Accordion title="Outdated information">
324+
If you're getting old API information:
325+
326+
1. Update the MCP server:
327+
```bash
328+
npm update -g @vapi-ai/mcp-server
329+
```
330+
331+
2. Clear your IDE's cache
332+
3. Restart the IDE
333+
</Accordion>
334+
335+
<Accordion title="Multiple workspaces">
336+
For different projects needing different configs:
337+
338+
- MCP configuration is per-workspace
339+
- Run `vapi mcp setup` in each project
340+
- Configuration won't conflict between projects
341+
</Accordion>
342+
</AccordionGroup>
343+
344+
## Advanced usage
345+
346+
### Custom MCP configuration
347+
348+
Modify the generated MCP configuration for advanced needs:
349+
350+
```json
351+
{
352+
"servers": {
353+
"vapi-docs": {
354+
"command": "npx",
355+
"args": ["@vapi-ai/mcp-server"],
356+
"env": {
357+
"VAPI_MCP_LOG_LEVEL": "debug"
358+
}
359+
}
360+
}
361+
}
362+
```
363+
364+
### Using with teams
365+
366+
Share MCP configuration with your team:
367+
368+
1. **Commit the config files** (`.cursor/mcp.json`, etc.)
369+
2. **Document the setup** in your README
370+
3. **Include in onboarding** for new developers
371+
372+
Example README section:
373+
```markdown
374+
## Development Setup
375+
376+
This project uses Vapi MCP for enhanced IDE support:
377+
378+
1. Install Vapi CLI: `curl -sSL https://vapi.ai/install.sh | bash`
379+
2. Set up MCP: `vapi mcp setup`
380+
3. Restart your IDE
381+
```
382+
383+
## Next steps
384+
385+
With MCP configured:
386+
387+
- **[Initialize a project](/cli/project-integration):** Add Vapi to your codebase
388+
- **[Test webhooks locally](/cli/webhook-testing):** Debug without external tunnels
389+
- **[Explore API Reference](/api-reference):** See what your IDE now knows
390+
391+
---
392+
393+
**Pro tip:** After setting up MCP, try asking your IDE to "Create a complete Vapi voice assistant with error handling and logging" - watch it generate production-ready code with all the right patterns!

0 commit comments

Comments
 (0)