# Testing Platfone MCP with Sandbox

> Step-by-step guide for testing the Platfone MCP server using the free sandbox environment. Covers get_balance, check_price, order_number, check_sms, retry_activation, and cancel_activation.


The Platfone sandbox lets you test the full MCP flow **for free** — no real money needed. You can send fake SMS messages through the sandbox dashboard to simulate the complete activation lifecycle.

---

## Step 1: Get a Sandbox API Key

1. Go to [https://platfone.com/test](https://platfone.com/test)

2. Register or log in
3. Copy your **sandbox** API key


> **Sandbox is free**


The sandbox environment uses test data and doesn't charge real money. You can send fake SMS via the web dashboard to test your integration.



---

## Step 2: Configure for Sandbox

Choose one of the two transport options:

### Option A: npm package (stdio)

Set these two environment variables in any client configuration from the [Setup & Configuration](https://platfone.com/docs/mcp/setup/) page:

```bash
PLATFONE_API_KEY=your_sandbox_api_key_here
PLATFONE_API_URL=https://temp-number-api.com/test/api/v1
```

The key difference from production is the `PLATFONE_API_URL` — it points to the sandbox API (`/test/api/v1` instead of `/api/v1`).

### Option B: Hosted sandbox HTTP endpoint

Connect directly to the sandbox MCP endpoint — no local installation required:

```
https://mcp.platfone.com/test/mcp
```

Pass your sandbox API key via the `x-api-key` header. Use this URL instead of the production `https://mcp.platfone.com/mcp` in any HTTP-based client configuration.

---

## Step 3: Verify the Full Flow

The happy-path flow to confirm everything works:

1. **`check_price`** → `country: "United States"`, `service: "Telegram"` → verify cost & availability
2. **`order_number`** → `country: "United States"`, `service: "Telegram"` → get `activation_id` + `phone`
3. Go to the [Platfone sandbox dashboard](https://platfone.com/test)
 → find the activation → **send a fake SMS**
4. **`check_sms`** → pass the `activation_id` from step 2 → should return the SMS code

✅ If this works end-to-end, the MCP server is functioning correctly.

---

## Optional: Test Balance and Retry/Cancel

**Test balance:**
- Call **`get_balance`** → should return your sandbox account's total, reserved, and available balance

**Test retry** (after receiving an SMS):
- Call **`retry_activation`** with the `activation_id` → request another SMS on the same number
- Send another fake SMS from the sandbox dashboard
- Call **`check_sms`** → should return the new code

**Test cancel** (before receiving an SMS):
- Call **`cancel_activation`** with the `activation_id` → cancels the activation and refunds balance

