Cover image
Try Now
2025-03-31

镜像://github.com/bitrefill/bitrefill-mcp-server

3 years

Works with Finder

0

Github Watches

0

Github Forks

0

Github Stars

Bitrefill MCP Server

smithery badge

A TypeScript-based MCP server that provides access to Bitrefill services, allowing you to search for gift cards, mobile topups, and more. This server implements the Model Context Protocol to expose Bitrefill functionality to AI assistants.

How It Works

The server operates using the Model Context Protocol (MCP) to communicate with Claude and similar AI assistants. It:

  1. Runs as a standalone process using stdio for communication
  2. Registers resources and tools for accessing Bitrefill services
  3. Interfaces with the Bitrefill API to provide product search and details
  4. Returns structured JSON responses that can be processed by AI assistants

Architecture

The app server follows this architecture:

src/
├── index.ts                # Main entry point
├── constants/              # Static data
│   ├── categories.ts       # Product categories
│   └── payment_methods.ts  # Payment methods
├── handlers/               # MCP request handlers
│   ├── resources.ts        # Resource endpoints
│   └── tools.ts            # Tool implementations
├── schemas/                # Data validation schemas
│   ├── detail.ts           # Product detail response types
│   ├── invoice.ts          # Invoice schemas
│   ├── misc.ts             # Miscellaneous schemas
│   ├── order.ts            # Order schemas
│   └── search.ts           # Search parameters and response types
├── services/               # API services
│   ├── invoices.ts         # Invoice service
│   ├── misc.ts             # Miscellaneous services
│   ├── orders.ts           # Order services
│   ├── products.ts         # Product details service
│   └── search.ts           # Search functionality
└── utils/                  # Utility functions
    ├── index.ts            # Error logging, etc.
    └── api/                # API clients
        ├── authenticated.ts # Authenticated API client
        ├── base.ts         # Base API client
        └── public.ts       # Public API client

Features

Resources

  • bitrefill://product-types - List of available product types on Bitrefill
  • bitrefill://categories/{type} - List of available categories for a specific product type (e.g., bitrefill://categories/gift-cards)

Tools

  • search - Search for gift cards, esims, mobile topups and more

    • Required: query (e.g., 'Amazon', 'Netflix', 'AT&T' or '*' for all)
    • Optional: country, language, limit, skip, category
  • detail - Get detailed information about a product

    • Required: id (product identifier)
  • categories - Get the full product type/categories map

    • No required parameters
  • create_invoice - Create a new invoice for purchasing products (requires API key)

    • Required: products (array of products to include in the invoice)
      • Each product requires: product_id
      • Optional product fields: quantity, value, package_id, phone_number, email, send_email, send_sms
    • Required: payment_method (one of: "balance", "bitcoin", "lightning")
    • Optional: webhook_url, auto_pay
  • get_invoices - Retrieve a list of invoices with optional filtering

    • Optional: start, limit, after, before
  • get_invoice - Retrieve details for a specific invoice by ID

    • Required: id (invoice identifier)
  • pay_invoice - Pay an unpaid invoice (only works with 'balance' payment method)

    • Required: id (invoice identifier)
  • get_orders - Retrieve a list of orders with optional filtering

    • Optional: start, limit, after, before
  • get_order - Retrieve details for a specific order by ID

    • Required: id (order identifier)
  • unseal_order - Reveal codes and PINs for a specific order by ID

    • Required: id (order identifier)
  • get_account_balance - Retrieve your account balance

    • No required parameters
  • ping - Check if the Bitrefill API is available

    • No required parameters

Configuration

API Key Setup

To use the all the tools that rely on the Bitrefill API except for search, categories and detail, you need to set up Bitrefill API credentials:

  1. Create a Bitrefill account
  2. Ask for a developer API key by filing a request on this form
  3. Create a .env file in the root directory (you can copy from .env.example)
  4. Add your Bitrefill API credentials:
    BITREFILL_API_SECRET=your_api_key_here
    BITREFILL_API_ID=your_api_id_here
    

The create_invoice tool will only be available if the API credentials are set. If the API credentials are not set, the tool will not be registered and won't appear in the list of available tools.

Development

Install dependencies:

npm install

Build the server:

npm run build

For development with auto-rebuild:

npm run watch

Debugging

Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector, which is available as a package script:

npm run inspector

The Inspector will provide a URL to access debugging tools in your browser.

Installation

Installing via Smithery

To install Bitrefill for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @bitrefill/bitrefill-mcp-server --client claude

Claude Desktop

Add the server config at:

  • MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "bitrefill": {
      "command": "npx",
      "args": ["-y", "bitrefill-mcp-server"],
      "env": {
        "BITREFILL_API_SECRET": "your_api_key_here",
        "BITREFILL_API_ID": "your_api_id_here"
      }
    }
  }
}

Cline

  1. Open the Cline extension settings
  2. Open "MCP Servers" tab
  3. Click on "Configure MCP Servers"
  4. Add the server config:
{
  "mcpServers": {
    "github.com/bitrefill/bitrefill-mcp-server": {
      "command": "npx",
      "args": ["-y", "bitrefill-mcp-server"],
      "disabled": false,
      "autoApprove": ["search", "detail", "categories"],
      "env": {
        "BITREFILL_API_ID": "your_api_id_here",
        "BITREFILL_API_SECRET": "your_api_key_here"
      }
    }
  }
}

Additional Cline configuration options:

  • disabled: Set to false to enable the server
  • autoApprove: List of tools that don't require explicit approval for each use

Cursor

  1. Open the Cursor settings
  2. Open "Features" settings
  3. In the "MCP Servers" section, click on "Add new MCP Server"
  4. Choose a name, and select "command" as "Type"
  5. In the "Command" field, enter the following:
npx -y bitrefill-mcp-server
  1. (Optional) If you're using the create_invoice tool, add environment variables:
    • BITREFILL_API_SECRET: your_api_key_here
    • BITREFILL_API_ID: your_api_id_here

Docker

You can also run the server using Docker. First, build the image:

docker build -t bitrefill-mcp-server .

Then run the container:

docker run -e BITREFILL_API_SECRET=your_api_key_here -e BITREFILL_API_ID=your_api_id_here bitrefill-mcp-server

For development, you might want to mount your source code as a volume:

docker run -v $(pwd):/app --env-file .env bitrefill-mcp-server

相关推荐

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • tomoyoshi hirata
  • Sony α7IIIマニュアルアシスタント

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • https://zenepic.net
  • Embark on a thrilling diplomatic quest across a galaxy on the brink of war. Navigate complex politics and alien cultures to forge peace and avert catastrophe in this immersive interstellar adventure.

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • jae-jae
  • MCP服务器使用剧作《无头浏览器》获取网页内容。

  • HiveNexus
  • 一个适用于中小型团队的AI聊天机器人,支持DeepSeek,Open AI,Claude和Gemini等车型。 专为中小团队设计的ai聊天应用,支持deepSeek,打开ai,claude,双子座等模型。

  • ravitemer
  • 一个功能强大的Neovim插件,用于管理MCP(模型上下文协议)服务器

  • patruff
  • Ollama和MCP服务器之间的桥梁,使本地LLMS可以使用模型上下文协议工具

  • pontusab
  • 光标与风浪冲浪社区,查找规则和MCP

    Reviews

    5 (1)
    Avatar
    user_eXPavlZt
    2025-04-16

    As an avid user of MCP applications, I highly recommend the Bitrefill Bitrefill MCP Server by MCP-Mirror. This innovative product offers seamless functionality and efficient performance. The detailed documentation and clear welcome information make it user-friendly and easy to navigate. For those involved in MCP projects, it's a valuable addition to the toolkit. Explore more at [product link].