# MPP via MCP Server

## Overview

The Tomba Remote MCP Server at `mcp.tomba.io` now includes **MPP-powered tools** alongside the standard API-key-authenticated tools. MPP tools let AI agents pay per request using an InFlow buyer key instead of a Tomba API subscription.

| Auth Method   | Tools Prefix                                 | Header                          | Use Case               |
| ------------- | -------------------------------------------- | ------------------------------- | ---------------------- |
| Tomba API Key | `domain_search`, `email_finder`, ...         | `Authorization: Bearer <token>` | Subscription users     |
| InFlow MPP    | `mpp_domain_search`, `mpp_email_finder`, ... | `X-Inflow-Key: <key>`           | Pay-per-request agents |

## Available MPP MCP Tools

| #   | Tool                   | Description                                        |
| --- | ---------------------- | -------------------------------------------------- |
| 1   | `mpp_domain_search`    | Find all emails associated with a company domain   |
| 2   | `mpp_email_finder`     | Find a person's email by name and company domain   |
| 3   | `mpp_email_verifier`   | Verify email deliverability and validity           |
| 4   | `mpp_email_enrichment` | Enrich an email with full contact profile          |
| 5   | `mpp_email_count`      | Count available emails for a domain                |
| 6   | `mpp_author_finder`    | Find the author's email from an article URL        |
| 7   | `mpp_linkedin_finder`  | Resolve a LinkedIn profile URL to an email         |
| 8   | `mpp_phone_finder`     | Find phone numbers from email, domain, or LinkedIn |
| 9   | `mpp_phone_validator`  | Validate a phone number (carrier, type, country)   |
| 10  | `mpp_similar_finder`   | Find similar company domains                       |

Each MPP tool has the same input schema as its standard counterpart — the only difference is authentication and payment.

## Setup

### Prerequisites

1. Register a buyer account at [sandbox.inflowpay.ai](https://sandbox.inflowpay.ai) (testing) or [app.inflowpay.ai](https://app.inflowpay.ai) (production)
2. Generate an InFlow API key from the dashboard

### Claude Desktop

```json
{
    "mcpServers": {
        "tomba-mpp": {
            "url": "https://mcp.tomba.io/mcp",
            "headers": {
                "X-Inflow-Key": "your_inflow_api_key",
                "X-Inflow-Environment": "sandbox"
            }
        }
    }
}
```

### Claude Code

```bash
claude mcp add tomba-mpp \
  --transport http \
  --url https://mcp.tomba.io/mcp \
  --header "X-Inflow-Key: your_inflow_api_key" \
  --header "X-Inflow-Environment: sandbox"
```

### Cursor

Add to `.cursor/mcp.json`:

```json
{
    "mcpServers": {
        "tomba-mpp": {
            "url": "https://mcp.tomba.io/mcp",
            "headers": {
                "X-Inflow-Key": "your_inflow_api_key",
                "X-Inflow-Environment": "sandbox"
            }
        }
    }
}
```

### VS Code (Copilot)

Add to `.vscode/mcp.json`:

```json
{
    "servers": {
        "tomba-mpp": {
            "url": "https://mcp.tomba.io/mcp",
            "headers": {
                "X-Inflow-Key": "your_inflow_api_key",
                "X-Inflow-Environment": "sandbox"
            }
        }
    }
}
```

### Windsurf

Add to `~/.codeium/windsurf/mcp_config.json`:

```json
{
    "mcpServers": {
        "tomba-mpp": {
            "serverUrl": "https://mcp.tomba.io/mcp",
            "headers": {
                "X-Inflow-Key": "your_inflow_api_key",
                "X-Inflow-Environment": "sandbox"
            }
        }
    }
}
```

### ChatGPT

In ChatGPT settings, add an MCP connection:

- **URL**: `https://mcp.tomba.io/mcp`
- **Header**: `X-Inflow-Key: your_inflow_api_key`
- **Header**: `X-Inflow-Environment: sandbox`

## Usage Examples

Once connected, you can use natural language to invoke MPP tools:

### Find emails at a company

> "Use mpp_domain_search to find all emails at stripe.com"

### Find a specific person's email

> "Use mpp_email_finder to find the email of John Smith at example.com"

### Verify an email

> "Use mpp_email_verifier to check if john@example.com is valid"

### Enrich a contact

> "Use mpp_email_enrichment to get full contact details for ceo@company.com"

### Find phone numbers

> "Use mpp_phone_finder to find the phone number for user@company.com"

## How Payment Works

When an MPP tool is called:

1. The MCP server sends a request to `agents.tomba.io/<endpoint>`
2. The Tomba API returns a `402 Payment Required` challenge
3. The MCP server creates a payment transaction with InFlow using your buyer key
4. InFlow processes the payment ($0.0098 USDC per request)
5. The MCP server retries with the payment credential
6. Data is returned to the AI agent

This entire flow happens automatically — the AI agent just calls the tool and gets results.

<Mermaid
    chart={`sequenceDiagram
    participant AI as AI Agent
    participant MCP as Tomba MCP Server
    participant API as agents.tomba.io
    participant InFlow as InFlow Network
    AI->>MCP: Call mpp_domain_search(domain: "stripe.com")
    MCP->>API: GET /domain-search?domain=stripe.com
    API-->>MCP: 402 + Payment Challenge
    MCP->>InFlow: Create payment ($0.0098)
    InFlow-->>MCP: Payment credential
    MCP->>API: GET /domain-search (with credential)
    API-->>MCP: 200 + email data
    MCP-->>AI: Tool result with emails`}
/>

## MPP vs Standard Tools

| Feature        | Standard Tools         | MPP Tools           |
| -------------- | ---------------------- | ------------------- |
| Authentication | Tomba API Key + Secret | InFlow Buyer Key    |
| Pricing        | Subscription plan      | $0.0098 per request |
| Signup         | Tomba account required | InFlow account only |
| Rate Limit     | Based on plan          | 100 req/min         |
| Tool Prefix    | `domain_search`        | `mpp_domain_search` |
| Same Data      | Yes                    | Yes                 |
| Same Schema    | Yes                    | Yes                 |

## Sandbox Testing

For testing, use the sandbox environment:

1. Register at [sandbox.inflowpay.ai](https://sandbox.inflowpay.ai)
2. Set `X-Inflow-Environment: sandbox` in your MCP config
3. All payments use test funds — no real charges
4. When ready for production, switch to `app.inflowpay.ai` and set environment to `production`
