Get the FREE Ultimate OpenClaw Setup Guide →

twilio-agent-payments

MCP server from deshartman/twilio-agent-payments-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio deshartman-twilio-agent-payments-mcp-server npx -y twilio-agent-payments-mcp-server <accountSid> <apiKey> <apiSecret> \
  --env CURRENCY="Currency for payments (e.g., 'USD', 'EUR')" \
  --env TOKEN_TYPE="Type of token to use for payments (e.g., 'reusable', 'one-time')" \
  --env NGROK_AUTH_TOKEN="Ngrok authentication token (required for callback handling)" \
  --env PAYMENT_CONNECTOR="Payment connector to use with Twilio" \
  --env NGROK_CUSTOM_DOMAIN="Optional custom domain for Ngrok"

How to use

This MCP server enables secure agent-assisted payments via the Twilio API. It guides the LLM through a payment workflow within voice interactions, capturing and tokenizing card data in a PCI-compliant manner, and supporting asynchronous callbacks through MCP Resources. The server exposes a suite of tools and resources that the MCP client can discover automatically, and it offers contextual prompts at each step of the payment process to minimize missteps and increase security. You can integrate it with MCP clients like Claude Desktop to manage the payment flow without embedding sensitive credentials in the LLM context.

To use it, configure the server in your MCP client, connect to the twilio-agent-payments MCP server, and prompt the LLM to initiate a payment flow when a user expresses intent to pay. The MCP protocol will supply the necessary tool definitions, input schemas, and contextual prompts to guide the LLM through capture, validation, tokenization, and submission to Twilio. The server also supports re-entry of payment information if needed and handles asynchronous status callbacks for ongoing payments.

How to install

Prerequisites:

  • Node.js and npm installed on the host system
  • Internet access to install npm packages
  • Twilio account with API Keys (accountSid, apiKey, apiSecret)

Option A - Run via npx (no global install):

  1. Ensure you have your Twilio credentials ready (accountSid, apiKey, apiSecret).

  2. Run the MCP server directly with npx:

    npx twilio-agent-payments-mcp-server <accountSid> <apiKey> <apiSecret>

Option B - Install globally and run locally:

  1. Install the package globally:

    npm install -g twilio-agent-payments-mcp-server

  2. Start the server with your credentials:

    twilio-agent-payments-mcp-server <accountSid> <apiKey> <apiSecret>

Option C - Prepare a configuration snippet for MCP clients (as shown in mcp_config):

  1. Save the following in your MCP host configuration, replacing placeholders with real values:

    { "mcpServers": { "twilio-agent-payments": { "command": "npx", "args": ["-y", "twilio-agent-payments-mcp-server", "<accountSid>", "<apiKey>", "<apiSecret>"] } } }

Environment variables to set before running (as needed): TOKEN_TYPE, CURRENCY, PAYMENT_CONNECTOR, NGROK_AUTH_TOKEN, NGROK_CUSTOM_DOMAIN.

Additional notes

Tips and notes:

  • Twilio credentials (accountSid, apiKey, apiSecret) are provided as command-line arguments, not environment variables, for security and clarity.
  • NGROK_AUTH_TOKEN is required if you rely on Ngrok-based callback handling; ensure the token is kept secure.
  • TOKEN_TYPE determines token semantics (e.g., reusable vs. one-time) and affects how payment sessions are validated and stored.
  • CURRENCY should align with your merchant accounts and supported regions.
  • If you encounter connectivity issues with Ngrok, verify that NGROK_AUTH_TOKEN is valid and that NGROK_CUSTOM_DOMAIN (if used) is correctly configured.
  • The MCP server exposes tools and resources automatically; your MCP client does not need to predefine them in context.
  • When testing locally, you can use Claude Desktop or other MCP clients to discover and invoke the available payment tools and resources.

Related MCP Servers

Sponsor this space

Reach thousands of developers