GotFreeFax.com REST API & Fax MCP Server

Version 2.0 — REST API & MCP Server for developers and AI agents

1. Overview

The GotFreeFax.com API allows external applications and AI agents to send faxes to the United States and Canada. Two interfaces are available:

  • REST API v2 — Standard JSON-based HTTP API for any programming language
  • MCP Server — Model Context Protocol endpoint for AI agents (Claude, etc.)

Base URL: https://www.gotfreefax.com

API access is available to GotFreeFax.com prepaid account holders.

2. Authentication

Both the REST API and MCP Server use Bearer token authentication. The token is your account number and PIN encoded in Base64.

Creating Your Token

Combine your account number and PIN with a colon separator, then Base64-encode the result:

Token = base64("ACCOUNT_NUMBER:PIN")

Example:
  Account Number: 1234567890
  PIN: 5678
  Combined: 1234567890:5678
  Base64 Token: MTIzNDU2Nzg5MDo1Njc4

Using the Token

Include the token in the Authorization header of every request:

Authorization: Bearer MTIzNDU2Nzg5MDo1Njc4

Code Examples

# Python
import base64
token = base64.b64encode(b"1234567890:5678").decode()
headers = {"Authorization": f"Bearer {token}"}

# JavaScript
const token = btoa("1234567890:5678");
headers: { "Authorization": `Bearer ${token}` }

# C#
var token = Convert.ToBase64String(Encoding.UTF8.GetBytes("1234567890:5678"));
request.Headers.Add("Authorization", "Bearer " + token);

# cURL
curl -H "Authorization: Bearer $(echo -n '1234567890:5678' | base64)"

3. REST API v2

All endpoints return JSON with this envelope:

// Success
{
  "success": true,
  "data": { ... },
  "error": null
}

// Error
{
  "success": false,
  "data": null,
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable description"
  }
}

3a. Send a Fax

POST /api/v2/fax Auth Required

Send a fax with one or more file attachments.

Request Body
FieldTypeRequiredDescription
fax_numberstringYes10-digit US or Canada fax number
notify_urlstringNoURL to POST fax status notification
filesarrayYesArray of file objects
files[].filenamestringYesFilename with extension (e.g. letter.pdf)
files[].contentstringYesBase64-encoded file content
Example Request
curl -X POST https://www.gotfreefax.com/api/v2/fax \
  -H "Authorization: Bearer MTIzNDU2Nzg5MDo1Njc4" \
  -H "Content-Type: application/json" \
  -d '{
    "fax_number": "8885551234",
    "notify_url": "https://example.com/fax-callback",
    "files": [
      {
        "filename": "document.pdf",
        "content": "JVBERi0xLjQK..."
      }
    ]
  }'
Example Response
{
  "success": true,
  "data": {
    "job_id": "ABCDEFGHIJ"
  },
  "error": null
}

3b. Check Fax Status

GET /api/v2/fax/{job_id} Auth Required

Check the delivery status of a sent fax.

Path Parameters
ParameterDescription
job_idThe job ID returned by the Send Fax endpoint
Example Request
curl https://www.gotfreefax.com/api/v2/fax/ABCDEFGHIJ \
  -H "Authorization: Bearer MTIzNDU2Nzg5MDo1Njc4"
Example Response
{
  "success": true,
  "data": {
    "job_id": "ABCDEFGHIJ",
    "fax_number": "8885551234",
    "status": "success",
    "page_count": 2,
    "completed_at": "2025-01-15T10:30:00Z",
    "detail": ""
  },
  "error": null
}
Status Values
StatusDescription
pendingFax is queued or in progress
successFax delivered successfully
failureFax failed or was cancelled

3c. Account Balance

GET /api/v2/account/balance Auth Required
Example Request
curl https://www.gotfreefax.com/api/v2/account/balance \
  -H "Authorization: Bearer MTIzNDU2Nzg5MDo1Njc4"
Example Response
{
  "success": true,
  "data": {
    "page_balance": 50,
    "amount_balance": 12.50
  },
  "error": null
}

3d. Supported Formats

GET /api/v2/formats No Auth
Example Request
curl https://www.gotfreefax.com/api/v2/formats
Example Response
{
  "success": true,
  "data": {
    "formats": [
      { "description": "Adobe PDF", "extensions": ["pdf"] },
      { "description": "Microsoft Word", "extensions": ["doc", "dot"] },
      { "description": "Microsoft Word 2007+", "extensions": ["docx"] },
      ...
    ]
  },
  "error": null
}

4. MCP Server (AI Agents)

The Model Context Protocol (MCP) endpoint allows AI agents to discover and use GotFreeFax tools directly.

POST /mcp Auth Required (for most tools)

Connection Details

Endpointhttps://www.gotfreefax.com/mcp
TransportStreamable HTTP (JSON-RPC 2.0 over POST)
Content-Typeapplication/json
AuthenticationAuthorization: Bearer <token>

Available Tools

ToolDescriptionAuth
send_faxSend a fax with file attachmentsYes
check_fax_statusCheck delivery status of a faxYes
get_account_balanceGet page and dollar balanceYes
list_supported_formatsList accepted file typesNo

Example: Initialize Session

curl -X POST https://www.gotfreefax.com/mcp \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer MTIzNDU2Nzg5MDo1Njc4" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "initialize",
    "params": {
      "protocolVersion": "2024-11-05",
      "capabilities": {},
      "clientInfo": { "name": "my-agent", "version": "1.0" }
    }
  }'

// Response:
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "protocolVersion": "2024-11-05",
    "capabilities": { "tools": {} },
    "serverInfo": { "name": "GotFreeFax", "version": "1.0.0" }
  }
}

Example: List Tools

curl -X POST https://www.gotfreefax.com/mcp \
  -H "Content-Type: application/json" \
  -d '{ "jsonrpc": "2.0", "id": 2, "method": "tools/list" }'

Example: Send a Fax via MCP

curl -X POST https://www.gotfreefax.com/mcp \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer MTIzNDU2Nzg5MDo1Njc4" \
  -d '{
    "jsonrpc": "2.0",
    "id": 3,
    "method": "tools/call",
    "params": {
      "name": "send_fax",
      "arguments": {
        "fax_number": "8885551234",
        "files": [
          {
            "filename": "letter.pdf",
            "content": "JVBERi0xLjQK..."
          }
        ]
      }
    }
  }'

// Response:
{
  "jsonrpc": "2.0",
  "id": 3,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\n  \"status\": \"success\",\n  \"job_id\": \"ABCDEFGHIJ\",\n  \"message\": \"Fax queued successfully to 8885551234\"\n}"
      }
    ],
    "isError": false
  }
}

Claude Desktop Configuration

To use GotFreeFax with Claude Desktop, add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "gotfreefax": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://www.gotfreefax.com/mcp",
        "--header",
        "Authorization:${GOTFREEFAX_AUTH}"
      ],
      "env": {
        "GOTFREEFAX_AUTH": "Bearer YOUR_BASE64_TOKEN"
      }
    }
  }
}

Requires Node.js installed. The mcp-remote package bridges Claude Desktop to the remote MCP endpoint.

5. Error Codes

REST API Error Codes

HTTP StatusCodeDescription
401UNAUTHORIZEDMissing or invalid authentication token
400INVALID_FAX_NUMBERFax number is not a valid 10-digit US/Canada number
400INVALID_FILESMissing files or invalid file data
400INVALID_BASE64File content is not valid base64
400INVALID_JSONRequest body is not valid JSON
400INVALID_JOB_IDJob ID is missing or empty
400UNSUPPORTED_FORMATFile type is not supported (allowed: PDF, DOC, DOCX, JPG, JPEG, TXT)
400TOO_MANY_FILESExceeded maximum of 10 files per fax
402INSUFFICIENT_BALANCEAccount has no page credits remaining
404NOT_FOUNDFax job not found
500SYSTEM_ERRORInternal server error

MCP JSON-RPC Error Codes

CodeDescription
-32700Parse error (malformed JSON)
-32600Invalid request (missing method)
-32601Method or tool not found
-32602Invalid parameters

6. Supported File Formats & Limits

Maximum 10 files per fax request.

FormatExtensions
Adobe PDFpdf
Microsoft Worddoc, docx
JPEG Imagejpg, jpeg
Plain Texttxt

Need help? Contact us at gotfreefax.com/contact.