Add Bitrefill hybrid plugin for Base MCP agent commerce#87
Open
marcopesani wants to merge 1 commit into
Open
Conversation
Add spec-conformant plugin for gift cards, top-ups, and eSIMs via Bitrefill MCP/CLI/REST with usdc_base x402 settlement through Base MCP. Register in SKILL.md plugins table and plugin-spec conformance table. Co-authored-by: Cursor <cursoragent@cursor.com>
Collaborator
🟡 Heimdall Review Status
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Bitrefill as the eighth native plugin in the Base MCP skill — a hybrid integration that lets agents discover and purchase real-world digital goods (gift cards, mobile top-ups, eSIMs) and settle
usdc_baseinvoices through Base Account on Base.This extends the Base MCP agent-commerce surface beyond DeFi: an agent can search Bitrefill's catalog, create an invoice via Bitrefill MCP/CLI/REST, and pay with USDC on Base using Base MCP's x402 flow (primary) or a direct
sendfallback — both routed through the same approval-mode UX documented inreferences/approval-mode.md.What's included
skills/base-mcp/plugins/bitrefill.md— full hybrid plugin reference (detection, installation, auth, surface routing, orchestration, submission, risks)skills/base-mcp/SKILL.md— registers Bitrefill in the native plugins tableskills/base-mcp/references/plugin-spec.md— new routing tags (gift-cards,esim,mobile-topup,payments) and conformance rowDesign choices (aligned with Base MCP patterns)
integration: hybridsendfallbackbuy-productsexcluded fromautoApprovechains: [base]risk: [pii, irreversible]Live validation
End-to-end purchase tests were run in Cursor with Base MCP + Bitrefill MCP connected, following the plugin orchestration flow. Product: Amazon.it Italy 10 EUR (
amazon_it-italy,usdc_base).Onchain proof (Base mainnet)
initiate_x402_request→complete_x402_requestffd6b0cd-…sendfallback4cf05e37-…payment_detected→complete→ gift card delivered (~37s)ddda365c-…get-invoice-by-id→complete→ delivered;complete_x402_requestreturned HTTP 500 but payment settledAll three transactions settle USDC on Base (
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913) to Bitrefill payment addresses. Invoice amounts: 10.59 USDC per 10 EUR denomination.Operational notes surfaced during testing
These are documented in the plugin so future agents don't hit the same dead ends:
get-invoice-by-idafter every payment path — even whencomplete_x402_requestreturns HTTP 500, Bitrefill may still mark the invoicecomplete(observed on the successful x402 retry).signedstatus without settlement; funding the Base Account resolved it.sendfallback is production-viable — identical invoice lifecycle (unpaid→payment_detected→complete) with reliable MCP polling.update-ordertracks spend viaremaining_amount.Why this fits the Base MCP ecosystem
Bitrefill is an x402-enabled merchant on Base with a first-party MCP (
api.bitrefill.com/mcp). This plugin documents the handoff boundary clearly:send, with Base Account approvalThat split keeps Base MCP focused on wallet operations while enabling agent commerce — a concrete use case for x402 on Base that complements existing DeFi plugins (Morpho, Uniswap, etc.).
Upstream references: Bitrefill agents repo, Bitrefill docs.
Test plan
references/plugin-spec.md(frontmatter, sections, conformance table)SKILL.mdnative plugins listsearch-products→get-product-details→buy-productsinitiate_x402_request→ user approval →complete_x402_request→get-invoice-by-idpollsendfallback: USDC transfer → invoicecomplete→ redemption deliveredupdate-orderwithremaining_amount: 0complete_x402_request(payment still settles — worth confirming expected)Reviewer notes
Happy to adjust wording, tag vocabulary, or orchestration steps based on Base team feedback. The plugin intentionally defers tool parameter names to the live MCP catalogs (per existing native plugin convention) so it stays resilient as Base MCP and Bitrefill MCP evolve.
/cc — this is a contribution toward agent-native commerce on Base; appreciate any guidance on x402 edge cases or allowlist requirements for
api.bitrefill.com.Made with Cursor