home / mcp / bitrefill mcp server

Bitrefill MCP Server

A Model Context Protocol Server connector for Bitrefill public API, to enable AI agents to search and shop on Bitrefill.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "bitrefill-bitrefill-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "bitrefill-mcp-server"
      ],
      "env": {
        "BITREFILL_API_ID": "YOUR_API_ID",
        "BITREFILL_API_SECRET": "YOUR_API_SECRET"
      }
    }
  }
}

You can access Bitrefill services through an MCP server that talks with Claude and other AI assistants. This server exposes product search, details, and invoicing actions in a structured way so your AI helper can perform Bitrefill tasks on your behalf.

How to use

Use the MCP server with an MCP client to search for gift cards, esims, and mobile topups, get product details, create invoices, manage orders, and check balances. You interact with high‑level tools like search, detail, categories, create_invoice, get_invoices, get_invoice, pay_invoice, get_orders, get_order, unseal_order, get_account_balance, and ping. The client will pass your requests to the MCP server and receive structured responses suitable for AI-assisted workflows.

Typical usage patterns include: searching for products by keyword, requesting detailed information for a specific product, initializing an invoice for a selected product and payment method, retrieving invoice or order histories, paying invoices with a balance method, and revealing codes for completed orders. Your MCP client handles the orchestration and presents clear results to you.

How to install

Prerequisites: you need Node.js installed (and npm). You will run the MCP server as a local process via a stdio interface.

Step 1: Install dependencies and prepare the environment.

Step 2: Start the MCP server using the command shown in the example configuration.

Complete setup usually involves installing dependencies, building the server if needed, and launching via a runtime command that communicates over stdio.

Configuration

To enable all tools that rely on Bitrefill services (except for search, categories, and detail endpoints), you must provide API credentials. Create a Bitrefill account, request a developer API key, and store credentials in a root-level .env file.

Environment variables used by the MCP server include the following placeholders. Replace the placeholders with your actual credentials.

Security and troubleshooting

Security: keep your API credentials secret. Do not commit .env files to public repositories. Use access controls on the machine running the MCP server.

Debugging: MCP clients communicate over stdio. If you need advanced debugging, use an MCP inspector tool to view the traffic and responses.

Available tools

search

Search for gift cards, esims, mobile topups and more. Requires a query and can filter by country, language, limit, skip, and category.

detail

Get detailed information about a specific product by its ID.

categories

Return the full product type/categories map.

create_invoice

Create a new invoice for purchasing products. Requires product selections and a payment method.

get_invoices

Retrieve a list of invoices with optional filtering by time or status.

get_invoice

Retrieve details for a specific invoice by ID.

pay_invoice

Pay an unpaid invoice using the balance payment method.

get_orders

Retrieve a list of orders with optional filtering.

get_order

Retrieve details for a specific order by ID.

unseal_order

Reveal codes and PINs for a specific order by ID.

get_account_balance

Retrieve your account balance.

ping

Check if the Bitrefill API is available.