MCP integration
Overview
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.
In this guide, you’ll learn to:
- Set up MCP in supported IDEs
- Understand what knowledge is provided
- Use your enhanced IDE effectively
- Troubleshoot common issues
Quick start
Run the setup command to auto-configure all supported IDEs:
Or configure a specific IDE:
What is MCP?
Model Context Protocol is a standard that allows AI assistants to access structured knowledge and tools. When you set up MCP for Vapi:
- Your IDE’s AI gains access to complete Vapi documentation
- Code suggestions become accurate and up-to-date
- Examples use real, working Vapi patterns
- API hallucinations are eliminated
Supported IDEs
AI-first code editor with deep MCP integration
Setup: Creates .cursor/mcp.json
Codeium’s AI-powered IDE
Setup: Creates .windsurf/mcp.json
With GitHub Copilot extension
Setup: Configures Copilot settings
How it works
What gets configured
The MCP setup creates configuration files that connect your IDE to the Vapi MCP server:
Cursor
Windsurf
VSCode
File: .cursor/mcp.json
What knowledge is provided
Your IDE gains access to:
- Complete API Reference - Every endpoint, parameter, and response
- Code Examples - Working samples for all features
- Integration Guides - Step-by-step implementation patterns
- Best Practices - Recommended approaches and patterns
- Latest Features - Always up-to-date with new releases
- Troubleshooting - Common issues and solutions
Using your enhanced IDE
Example prompts
Once MCP is configured, try these prompts in your IDE:
Creating assistants
Prompt: “How do I create a voice assistant with Vapi?”
Your IDE will provide accurate code like:
Webhook handling
Prompt: “Show me how to handle Vapi webhooks”
Get complete webhook examples:
Advanced features
Prompt: “How do I set up call recording with custom storage?”
Get detailed implementation:
Best practices
Be specific
Ask detailed questions about Vapi features:
- ✅ “How do I transfer calls to a human agent in Vapi?”
- ❌ “How do I transfer calls?”
Configuration options
Check status
View current MCP configuration:
Output:
Update server
Keep the MCP server updated:
Remove configuration
Remove MCP configuration:
How MCP tools work
The Vapi MCP server provides these tools to your IDE:
Semantic search across all Vapi docs
Example: “How to handle voicemail detection”
Retrieve code samples for any feature
Example: “WebSocket connection example”
Get detailed API endpoint information
Example: “POST /assistant parameters”
Step-by-step guides for complex features
Example: “Workflow implementation guide”
Troubleshooting
MCP not working in IDE
If your IDE isn’t using the MCP knowledge:
- Restart your IDE after configuration
- Check the logs in your IDE’s output panel
- Verify npm is accessible from your IDE
- Ensure MCP server is installed globally
Permission errors
For permission issues:
Outdated information
If you’re getting old API information:
- Update the MCP server:
- Clear your IDE’s cache
- Restart the IDE
Multiple workspaces
For different projects needing different configs:
- MCP configuration is per-workspace
- Run
vapi mcp setup
in each project - Configuration won’t conflict between projects
Advanced usage
Custom MCP configuration
Modify the generated MCP configuration for advanced needs:
Using with teams
Share MCP configuration with your team:
- Commit the config files (
.cursor/mcp.json
, etc.) - Document the setup in your README
- Include in onboarding for new developers
Example README section:
Next steps
Now that MCP is configured:
- Create assistants: Build your first voice AI
- Test webhooks locally: Debug webhooks with tunneling services
- Manage resources: Use CLI commands
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!