MCP Integration
Model Context Protocol server for AI assistant integration
The Buena.ai TypeScript SDK includes a built-in MCP server that enables AI assistants to directly interact with your leads and API data. This allows AI tools like Claude Desktop, Cline, and other MCP-compatible clients to manage your Buena.ai data seamlessly.
🤖 AI-Native: Built specifically for AI assistant integration using the official Model Context Protocol standard.
📦 Installation & Setup
Step 1: Install the SDK
Step 2: Start the MCP Server
Step 3: Configure Your AI Assistant
Add the MCP server to your AI assistant’s configuration:
🛠️ Available MCP Tools
The MCP server exposes the following tools to AI assistants:
Lead Management Tools
buena_list_leads
Search and filter leads with advanced options.
Parameters:
limit
(optional): Number of leads to return (default: 50, max: 100)offset
(optional): Pagination offset (default: 0)search
(optional): Search term for name/emailcompany
(optional): Filter by company namestatus
(optional): Filter by status (active, inactive, contacted)sort
(optional): Sort field (created_at, updated_at, first_name, last_name)order
(optional): Sort order (asc, desc)
buena_create_lead
Create a new lead in your database.
Parameters:
first_name
(required): Lead’s first namelast_name
(required): Lead’s last nameemail
(required): Valid email addresscompany
(optional): Company namephone
(optional): Phone numberlinkedin_url
(optional): LinkedIn profile URLjob_title
(optional): Job titlelocation
(optional): Location/citynotes
(optional): Additional notestags
(optional): Array of tagscustom_fields
(optional): Custom field data as JSON object
buena_get_lead
Retrieve detailed information about a specific lead.
Parameters:
lead_id
(required): Unique lead identifier
buena_update_lead
Update an existing lead’s information.
Parameters:
lead_id
(required): Unique lead identifier- All other parameters are optional and same as
create_lead
buena_delete_lead
Permanently delete a lead from your database.
Parameters:
lead_id
(required): Unique lead identifier
API Key Management Tools
buena_list_api_keys
List all API keys for your account.
Parameters: None
buena_create_api_key
Create a new API key with specific permissions.
Parameters:
name
(required): Descriptive name for the API keypermissions
(required): Array of permission stringsdescription
(optional): Key descriptionexpires_at
(optional): Expiration date (ISO 8601 format)
Voice Cloning Tools
buena_list_voice_clones
List all voice clones for the authenticated user.
Parameters: None
buena_create_voice_clone
Create a new voice clone using audio file uploads.
Parameters:
name
(required): Descriptive name for the voice clonedescription
(optional): Description of the voice cloneaudio_files
(required): Array of audio file paths or URLs for voice training
buena_update_voice_clone
Update an existing voice clone’s settings.
Parameters:
voice_id
(required): Unique voice clone identifiername
(optional): Updated name for the voice clonedescription
(optional): Updated descriptionsettings
(optional): Voice generation settings (stability, clarity, etc.)
buena_delete_voice_clone
Delete a voice clone from the user’s account.
Parameters:
voice_id
(required): Unique voice clone identifier
buena_generate_voice_preview
Generate a voice preview using a voice clone.
Parameters:
voice_id
(required): Voice clone identifier to usetext
(required): Text to synthesize into speechvoice_settings
(optional): Voice generation parameters
LinkedIn Voice Messaging Tools
buena_send_linkedin_voice_message
Send a LinkedIn message with optional voice message attachment.
Parameters:
profile_url
(required): LinkedIn profile URL of the recipientmessage
(required): Text message contentvoice_settings
(optional): Voice message configurationvoice_id
(required): Voice clone ID to usevoice_text
(required): Text to convert to voice messagevoice_params
(optional): Voice generation parameters
System Health Tools
buena_health_check
Check the API system status and your connection.
Parameters: None
🤖 AI Assistant Usage Examples
Lead Management Conversations
Example 1: Finding Leads
Example 2: Creating Leads
Example 3: Lead Research
Example 4: Voice Clone Management
Example 5: Voice Preview Generation
Advanced Workflow Examples
Lead Qualification Workflow
Lead Cleanup Workflow
🔧 Configuration Options
Environment Variables
Variable | Description | Required |
---|---|---|
BUENA_API_KEY | Your Buena.ai API key | Yes |
BUENA_API_URL | API base URL (default: https://api.buena.ai/api/v2) | No |
MCP_SERVER_PORT | Server port (default: auto-assigned) | No |
MCP_LOG_LEVEL | Logging level (debug, info, warn, error) | No |
Advanced Configuration
Create a buena-mcp.config.json
file:
🔒 Security & Permissions
API Key Permissions
Ensure your API key has the necessary permissions for MCP operations:
Required Permissions:
leads:read
- For listing and retrieving leadsleads:write
- For creating and updating leadsleads:delete
- For deleting leads (optional)api_keys:read
- For listing API keysapi_keys:write
- For creating API keys (optional)voice:create
- For creating voice clonesvoice:read
- For listing and retrieving voice clonesvoice:update
- For updating voice clone settingsvoice:delete
- For deleting voice clones (optional)voice:preview
- For generating voice previewslinkedin:voice
- For sending LinkedIn voice messages
Safe Usage Guidelines
- Environment Isolation: Use separate API keys for MCP vs production
- Permission Scoping: Grant only necessary permissions to MCP API keys
- Access Control: Restrict MCP server access to authorized AI assistants only
- Audit Logging: Monitor MCP tool usage through API logs
- Rate Limiting: Be aware of API rate limits when using AI assistants
🧪 Testing the MCP Server
Manual Testing
Integration Testing
🛠️ Troubleshooting
Common Issues
1. Server Won’t Start
Symptoms: Error: BUENA_API_KEY not found
Solution:
2. AI Assistant Can’t Connect
Symptoms: “MCP server not responding” Solutions:
- Check API key permissions
- Verify network connectivity
- Check server logs:
npx @buena/sdk mcp --log-level debug
3. Tool Calls Failing
Symptoms: “Permission denied” or “Invalid parameters” Solutions:
- Verify API key has required permissions
- Check parameter formats match API specification
- Test API calls directly first
4. Rate Limiting Issues
Symptoms: “Too many requests” errors Solutions:
- Implement request queuing in AI workflows
- Use pagination for large data sets
- Monitor API usage dashboard
Debug Mode
🚀 Advanced Features
Custom Tool Creation
Extend the MCP server with custom tools:
Batch Operations
📊 Monitoring & Analytics
Usage Tracking
The MCP server automatically tracks:
- Tool call frequency
- Response times
- Error rates
- API quota usage
Integration with Monitoring Tools
🤝 Community & Support
Getting Help
- 📖 MCP Protocol Documentation: Model Context Protocol
- 💬 Discord: Join our community
- 📧 Email Support: support@buena.ai
- 🐛 Bug Reports: GitHub Issues
Contributing
Help improve the MCP integration:
- Report Issues: Share your AI assistant integration experiences
- Feature Requests: Suggest new MCP tools and capabilities
- Code Contributions: Submit PRs for new tools or improvements
- Documentation: Help improve examples and guides
Next Steps: After setting up MCP, try asking your AI assistant to “show me my recent leads” or “create a new lead for John from Acme Corp” to see the integration in action!