# Setting Up Apify MCP Integration

This guide walks you through configuring the Apify MCP server to access Tomba.io tools in VS Code and other MCP-compatible environments.

## Prerequisites

Before you begin, ensure you have:

- **Apify Account**: Sign up at [apify.com](https://apify.com) if you don't have an account
- **Apify API Token**: Generate your API token from the Apify Console
- **VS Code**: Install Visual Studio Code or another MCP-compatible client
- **MCP Extension**: Install the appropriate MCP extension for your environment

## VS Code Configuration

### 1. Install Required Extensions

First, install the Model Context Protocol extension in VS Code:

1. Open VS Code
2. Go to Extensions (Ctrl+Shift+X)
3. Search for "Model Context Protocol" or "MCP"
4. Install the official MCP extension

### 2. Configure MCP Settings

Add the following configuration to your VS Code settings or MCP configuration file:

```json
{
    "inputs": [
        {
            "type": "promptString",
            "id": "apify-token",
            "description": "Apify API token",
            "password": true
        }
    ],
    "servers": {
        "apify": {
            "url": "https://mcp.apify.com/?tools=actors,docs,tomba-io/email-enrichment,tomba-io/technology-finder,tomba-io/email-finder,tomba-io/phone-validator,tomba-io/email-verifier,tomba-io/domain-search,tomba-io/linkedin-finder,tomba-io/email-count,tomba-io/clearbit-combined,tomba-io/clearbit-person,tomba-io/author-finder,tomba-io/phone-finder,tomba-io/similar-finder,tomba-io/clearbit-company",
            "headers": {
                "Authorization": "Bearer ${input:apify-token}"
            }
        }
    }
}
```

### 3. Get Your Apify API Token

1. Log in to your [Apify Console](https://console.apify.com)
2. Navigate to **Settings** → **Integrations**
3. Find the **API tokens** section
4. Click **Create new token**
5. Give it a descriptive name (e.g., "MCP Integration")
6. Copy the generated token

### 4. Configure Authentication

When prompted by VS Code:

1. Enter your Apify API token when the `apify-token` input prompt appears
2. The token will be securely stored and used for authentication
3. Verify the connection by testing one of the available tools

## Alternative Configurations

### Claude Desktop App

For Claude Desktop app integration:

```json
{
    "mcpServers": {
        "apify-tomba": {
            "command": "npx",
            "args": [
                "@modelcontextprotocol/server-web",
                "https://mcp.apify.com/?tools=actors,docs,tomba-io/email-enrichment,tomba-io/technology-finder,tomba-io/email-finder,tomba-io/phone-validator,tomba-io/email-verifier,tomba-io/domain-search,tomba-io/linkedin-finder,tomba-io/email-count,tomba-io/clearbit-combined,tomba-io/clearbit-person,tomba-io/author-finder,tomba-io/phone-finder,tomba-io/similar-finder,tomba-io/clearbit-company"
            ],
            "env": {
                "APIFY_TOKEN": "your-apify-token-here"
            }
        }
    }
}
```

### Other MCP Clients

For other MCP-compatible clients, use the server URL directly:

```
https://mcp.apify.com/?tools=actors,docs,tomba-io/email-enrichment,tomba-io/technology-finder,tomba-io/email-finder,tomba-io/phone-validator,tomba-io/email-verifier,tomba-io/domain-search,tomba-io/linkedin-finder,tomba-io/email-count,tomba-io/clearbit-combined,tomba-io/clearbit-person,tomba-io/author-finder,tomba-io/phone-finder,tomba-io/similar-finder,tomba-io/clearbit-company
```

With authentication header:

```
Authorization: Bearer YOUR_APIFY_TOKEN
```

## Usage Examples

### Example 1: Journalist Contact Research

Find contact information for journalists who wrote specific articles:

```
I need to find contact information for journalists who wrote the following articles:

- https://techcrunch.com/article-1
- https://wired.com/article-2
- https://forbes.com/article-3

Please:
1. Use the tomba-io/author-finder tool for each article URL
2. For each author found, use the tomba-io/email-verifier tool to verify their email
3. Try to find phone numbers using the tomba-io/phone-finder tool
4. Create a summary table with:
   - Article URL
   - Author name
   - Email address
   - Phone number (if found)
   - Verification status
5. Provide any additional insights about the journalists
```

### Example 2: Lead Generation for Tech Companies

Research and enrich leads in the technology sector:

```
I need to research potential leads for our B2B software company. Please help me:

1. Use tomba-io/domain-search to find all emails at these competitor domains:
   - salesforce.com
   - hubspot.com
   - pipedrive.com

2. For the decision-makers found, use tomba-io/email-enrichment to get detailed profiles

3. Use tomba-io/technology-finder to analyze what technologies these companies use

4. Use tomba-io/similar-finder to discover other companies similar to these

5. Compile a comprehensive lead list with:
   - Company name
   - Contact person
   - Verified email
   - Job title
   - Company technologies
   - Similar companies to target
```

### Example 3: Content Creator Outreach

Find and verify influencer contact information:

```
I'm planning an influencer marketing campaign. Help me find contact information for content creators:

1. Use tomba-io/linkedin-finder with these LinkedIn profiles:
   - linkedin.com/in/techinfluencer1
   - linkedin.com/in/marketer2
   - linkedin.com/in/entrepreneur3

2. For each contact found:
   - Verify emails with tomba-io/email-verifier
   - Find phone numbers with tomba-io/phone-finder
   - Enrich profiles with tomba-io/clearbit-person

3. Create an outreach list with:
   - Name and social media handle
   - Verified contact information
   - Professional background
   - Engagement strategy recommendations
```

### Example 4: Market Research Analysis

Comprehensive company and contact analysis:

```
I need to analyze our target market. Please help with:

1. Use tomba-io/domain-search to map out key contacts at these target companies:
   - company1.com
   - company2.com
   - company3.com

2. Use tomba-io/technology-finder to understand their tech stack

3. Use tomba-io/clearbit-company to get detailed company information

4. Use tomba-io/similar-finder to identify other companies in this space

5. Generate a market analysis report including:
   - Company profiles and contact hierarchies
   - Technology adoption patterns
   - Market size and opportunity assessment
   - Recommended entry strategies
```

### Example 5: Email List Validation

Clean and enrich existing contact databases:

```
I have a list of email addresses that need validation and enrichment:

email1@company.com
email2@startup.io
email3@enterprise.org

Please:
1. Use tomba-io/email-verifier to check deliverability of each email
2. Use tomba-io/email-enrichment to add detailed contact information
3. For any invalid emails, use tomba-io/email-finder to find alternative contacts at those companies
4. Create a cleaned and enriched contact list with validation status
```

## Troubleshooting

### Common Issues

**Authentication Errors**

- Verify your Apify API token is correct and has proper permissions
- Check that the token hasn't expired
- Ensure the Authorization header is properly formatted

**Connection Issues**

- Confirm your internet connection is stable
- Verify the MCP server URL is correct
- Check if your firewall is blocking the connection

**Tool Not Found Errors**

- Ensure you're using the correct tool names (e.g., `tomba-io/email-finder`)
- Verify the tool is included in your server URL configuration
- Check the Apify platform for tool availability

### Getting Help

If you encounter issues:

1. Check the [Apify documentation](https://docs.apify.com/platform/integrations/mcp)
2. Apify MCP [Apify MCP](https://mcp.apify.com/)
3. Review the [MCP specification](https://modelcontextprotocol.io/)
4. Contact Apify support for server-related issues
5. Reach out to Tomba.io support for tool-specific questions

## Security Best Practices

- **Never hardcode API tokens** in configuration files
- **Use environment variables** or secure input prompts for tokens
- **Regularly rotate** your API tokens
- **Monitor usage** through the Apify Console
- **Restrict token permissions** to only necessary scopes
- **Keep your MCP client updated** to the latest version

## Next Steps

- [Explore the complete list of available tools →](./tools)
- [Learn about tool capabilities and parameters →](./tools#tool-reference)
- [See advanced usage patterns and workflows →](./tools#advanced-usage)
