Using AI Assistants (MCP)

The MCP (Model Context Protocol) layer lets a compliant AI assistant (e.g., Claude Desktop, Cursor, or a custom agent framework) use the eFax API's core operations as standard, discoverable tools, no custom middleware required.

The MCP layer runs as a hosted service; your agent connects to it.

  • The agent always acts on behalf of a human user and inherits exactly that user's access, it can never do more than the user can.

  • Your off-switch is credential revocation. Revoking the credential the agent uses cuts off new access right away (any cached access drains within minutes).

Connecting Your Agent

Endpoint https://mcp.efax.com/mcp (Streamable HTTP).
Authentication Send your eFax credential as Authorization: Bearer <your-efax-credential> on every request. It's the same credential you use for the API.
Agent Name (Optional) Send an X-Agent-Id header (up to 128 characters) so your agent's activity is labeled in audit records.

Example Configuration

This example is for MCP clients that accept a URL and headers; the exact format varies by client.

{
   "mcpServers": {
     "efax": {
       "url": "https://mcp.efax.com/mcp",
       "headers": {
         "Authorization": "Bearer <your-efax-credential>",
         "X-Agent-Id": "<your agent name>"
       }
     }
   }
}

Your agent can list the available tools without a credential, but every tool call needs one. List-cover-pages is a safe first call to confirm the connection.

Tools Available

Tool What It Does
list-cover-pages Lists cover-page templates and their required fields.
list-faxes Lists faxes by folder and direction, with pagination.
get-fax-status Gets one fax and its current status.
send-fax Sends a fax. Documents are passed inline as base64.
get-fax-content Downloads a fax document, returned as base64.

Limits

  • Each request to the MCP endpoint is limited to 1 MiB, including base64 encoding. Documents sent through send-fax must be much smaller than the API's 100 MB limit, so send large documents through the API directly.

  • The method get-fax-content downloads documents up to 25 MiB.

  • The MCP layer doesn't pass the Retry-After header to your agent. On EFAX-429-RATE-LIMITED, back off exponentially with jitter. Don't let agents retry send-fax automatically, since a retry can send a duplicate fax.

Best Practices

  • Give agents their own credential under a dedicated user with precisely the access you intend, not a broad admin account. Because access equals the user's access, scope the user.

  • Keep a fast revocation path. Make sure an operator knows which credential an agent uses and how to revoke it in API Settings if it misbehaves.

  • Confirm before sending. send-fax creates a real transmission. Have your agent show the destination, documents, and cover page, and get the user's confirmation first.

  • Design for graceful failure. The MCP layer returns descriptive, machine-readable errors so the assistant can explain why something failed (limit exceeded, not permitted, invalid number). Build your prompts and flows to surface these to the human.

  • Be deliberate about PHI/PII. Only the content and metadata the tools return are shared with the agent, decide carefully what you let an external AI model ingest.

Return to the top of this page.