Skip to main content
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/email
  • company (optional): Filter by company name
  • status (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 name
  • last_name (required): Lead’s last name
  • email (required): Valid email address
  • company (optional): Company name
  • phone (optional): Phone number
  • linkedin_url (optional): LinkedIn profile URL
  • job_title (optional): Job title
  • location (optional): Location/city
  • notes (optional): Additional notes
  • tags (optional): Array of tags
  • custom_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 key
  • permissions (required): Array of permission strings
  • description (optional): Key description
  • expires_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 clone
  • description (optional): Description of the voice clone
  • audio_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 identifier
  • name (optional): Updated name for the voice clone
  • description (optional): Updated description
  • settings (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 use
  • text (required): Text to synthesize into speech
  • voice_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 recipient
  • message (required): Text message content
  • voice_settings (optional): Voice message configuration
    • voice_id (required): Voice clone ID to use
    • voice_text (required): Text to convert to voice message
    • voice_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

VariableDescriptionRequired
BUENA_API_KEYYour Buena.ai API keyYes
BUENA_API_URLAPI base URL (default: https://api.buena.ai/api/v2)No
MCP_SERVER_PORTServer port (default: auto-assigned)No
MCP_LOG_LEVELLogging 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 leads
  • leads:write - For creating and updating leads
  • leads:delete - For deleting leads (optional)
  • api_keys:read - For listing API keys
  • api_keys:write - For creating API keys (optional)
  • voice:create - For creating voice clones
  • voice:read - For listing and retrieving voice clones
  • voice:update - For updating voice clone settings
  • voice:delete - For deleting voice clones (optional)
  • voice:preview - For generating voice previews
  • linkedin:voice - For sending LinkedIn voice messages

Safe Usage Guidelines

  1. Environment Isolation: Use separate API keys for MCP vs production
  2. Permission Scoping: Grant only necessary permissions to MCP API keys
  3. Access Control: Restrict MCP server access to authorized AI assistants only
  4. Audit Logging: Monitor MCP tool usage through API logs
  5. 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

Contributing

Help improve the MCP integration:
  1. Report Issues: Share your AI assistant integration experiences
  2. Feature Requests: Suggest new MCP tools and capabilities
  3. Code Contributions: Submit PRs for new tools or improvements
  4. 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!