Bitrefill MCP Server (sample implementation) and hosted eCommerce MCP

Bitrefill MCP Server (sample implementation) and hosted eCommerce MCP

bitrefill•bybitrefill

A sample, self-hostable MCP server wrapping the Bitrefill API v2, plus documentation of Bitrefill's official hosted eCommerce MCP server.

License: MIT•Runtime: Awaiting documentation review•Category: finance crypto

WHAT IT DOES

  • •Exposes 18 tools for searching products, retrieving product details, buying and paying invoices, and listing invoices and orders.
  • •Includes tools for eSIM products and orders, such as listing eSIM products, creating and paying eSIM invoices, and retrieving eSIMs.
  • •Provides resources listing allowed payment methods, B2B category slugs, and product family keys.
  • •Registers no tools if the Bitrefill API key is missing.

BEST FOR

  • •Buying gift cards and eSIMs from an AI assistant via the hosted server or self-hosted sample.
  • •Learning how a Bitrefill MCP server is built or forking it to add custom tools.
  • •Self-hosting a customized variant inside a private network or air-gapped environment.

ABOUT BITREFILL

Bitrefill MCP Server (sample implementation) and hosted eCommerce MCP is cataloged as an MCP server attributed to bitrefill. A sample, self-hostable MCP server wrapping the Bitrefill API v2, plus documentation of Bitrefill's official hosted eCommerce MCP server. It is categorized under finance crypto. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Bitrefill MCP Server (sample implementation) and hosted eCommerce MCP are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

What is the difference between this sample server and the hosted eCommerce MCP?

The hosted Bitrefill eCommerce MCP is maintained by Bitrefill, supports OAuth, and exposes a curated set of 7 tools, while this sample exposes 18 tools over the Bitrefill API v2.

上游原版 README

在 GitHub 查看同一版本原文

README.md · ce6affe414a5 · 采集于 2026-11-13 08:48:53 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

Bitrefill MCP Server (Sample Implementation)

This is a sample / reference implementation. For production use, connect to the official hosted Bitrefill eCommerce MCP at https://api.bitrefill.com/mcp instead. It is maintained by Bitrefill, supports OAuth, and exposes the same tools without you having to run, deploy, or update anything.

Use this repository if you want to learn how a Bitrefill MCP can be built, fork it, extend it, or self-host a customized variant on top of the Bitrefill API v2.

This server wraps the Bitrefill API v2 (https://api.bitrefill.com/v2) using Authorization: Bearer ${BITREFILL_API_KEY}. Only request parameters are validated with Zod; API responses are returned as JSON text unchanged.

The Bitrefill eCommerce MCP is hosted by Bitrefill and is the recommended way to integrate with ChatGPT, Claude Desktop / Code, Cursor, and any other MCP-compatible client.

  • OAuth (recommended). Point your client at:

    https://api.bitrefill.com/mcp
    

    You'll be redirected to Bitrefill to sign in and authorize access. No API key handling required.

  • API key. Append your key from bitrefill.com/account/developers:

    https://api.bitrefill.com/mcp/YOUR_API_KEY
    

Setup guides per client: ChatGPT, Claude Desktop, Claude Code, Cursor.

When to use this repo instead

Run this local MCP only if you need to:

  • Study a working reference implementation of a Bitrefill MCP server.
  • Fork it to add custom tools, prompts, validation, logging, or routing.
  • Self-host inside a private network or air-gapped environment.
  • Experiment with a wider set of v2 endpoints (this sample exposes 18 tools, while the official remote MCP intentionally exposes a curated set of 7; see eCommerce MCP).

For everyday "buy gift cards / eSIMs from my AI assistant" use cases, prefer the hosted server above.

Configuration

  1. Create an API key: Bitrefill account → Developers.
  2. Set in the environment (or .env for local runs):
BITREFILL_API_KEY=your_api_key_here

If BITREFILL_API_KEY is missing, no tools are registered (v2 requires authentication even for ping).

Tools (v1.0.0)

ToolAPI
search-productsGET /products/search (with q) or GET /products (browse)
product-detailsGET /products/{id}
buy-productsPOST /invoices
get-invoice-by-idGET /invoices/{id}
get-order-by-idGET /orders/{id}
list-invoicesGET /invoices
list-ordersGET /orders
pay-invoicePOST /invoices/{id}/pay
get-account-balanceGET /accounts/balance
check-phone-numberGET /check_phone_number
pingGET /ping
list-esim-productsGET /products/esims
get-esim-productGET /products/esims/{id}
create-esim-invoicePOST /esims
get-esim-invoiceGET /esims/invoice/{id}
pay-esim-invoicePOST /esims/invoice/{id}/pay
list-esimsGET /esims
get-esimGET /esims/{id}

Breaking change vs 0.x: old snake_case tool names (search, create_invoice, unseal_order, ...) were removed. Use the names above. There is no unseal_order in v2; GET /orders/{id} returns redemption_info when delivered.

Resources

  • bitrefill://payment-methods: allowed payment_method strings for buy-products / create-esim-invoice
  • bitrefill://category-slugs: B2B category query values for product list/search
  • bitrefill://product-types: product family keys
  • bitrefill://product-types/{productType}: category slugs per family

Project layout

src/
  index.ts
  types/api.ts          # Optional TS shapes for API JSON (not validated at runtime)
  constants/            # payment_method list, category slugs
  handlers/             # resources.ts, tools.ts
  schemas/              # Zod: inputs only
  services/             # API calls (search, products, invoices, orders, esims, misc)
  utils/api/            # base (BitrefillApiError), authenticated (Bearer v2)

Development

pnpm install
pnpm run build
pnpm run typecheck
pnpm run lint

Smoke tests (this repo’s MCP only)

Smoke tests always start this package’s server (node build/index.js after pnpm run build). They do not open https://api.bitrefill.com/mcp or any other remote MCP URL.

Recommended: MCP client in-process (stdio to build/index.js):

pnpm run build
pnpm run smoke

Same as pnpm run test-services (alias).

Optional: MCP Inspector CLI, still only against this server:

pnpm run build
pnpm run smoke:inspector

All 18 tools (Inspector CLI, summary lines, dummy ids on purpose):

pnpm run test:inspector:all-tools

The Inspector uses --tool-arg key=value (repeat for multiple keys), not a single JSON blob. For nested data, use JSON in the value, e.g.
--tool-arg 'products=[{"product_id":"x","value":10}]'.

Interactive UI (local server only):

pnpm run build
pnpm run inspector

Examples:

pnpm dlx @modelcontextprotocol/inspector node build/index.js --cli --method tools/call --tool-name ping
pnpm dlx @modelcontextprotocol/inspector node build/index.js --cli --method tools/call --tool-name product-details --tool-arg id=test-gift-card-code

Client examples (self-hosted sample)

Reminder: for production, prefer the hosted https://api.bitrefill.com/mcp (OAuth) over the stdio config below.

Cursor / Claude-style MCP config, pass the key in env:

{
  "mcpServers": {
    "bitrefill": {
      "command": "npx",
      "args": ["-y", "bitrefill-mcp-server"],
      "env": {
        "BITREFILL_API_KEY": "your_api_key_here"
      }
    }
  }
}

Docker, e.g. -e BITREFILL_API_KEY=... or --env-file .env.

Hosted remote MCP (no install, recommended):

{
  "mcpServers": {
    "bitrefill": {
      "url": "https://api.bitrefill.com/mcp"
    }
  }
}

Documentation

License

MIT

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Bitrefill MCP Server (sample implementation) and hosted eCommerce MCP from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/bitrefill)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related finance crypto MCP Servers

Alternative and complementary servers in the same category

View all in finance crypto →
USA Spending MCP Server
usaspending-mcp-server•thsmale

A stateless streamable HTTP MCP server for interacting with the official source of government spending data.

Repository stats unavailable
Finance & Analytics
Fortnox MCP server — More AI
more-ai-chatgpt-claude-mcp-fortnox•amor3

A hosted, remote MCP server for Fortnox that lets AI assistants answer questions from a company's bookkeeping and propose changes for approval before writing them.

0
Finance & Analytics

OptimistFi is a read-only remote MCP server that provides perpetual futures market data, perps prop firm rules and pricing, and US equity investment research.

Repository stats unavailable
Finance & Analytics