bitrefill-mcp-server AGENTS.md

Repository instructions for building and testing a Bitrefill MCP server. Bitrefill is a service whose API is accessed over HTTP, and an MCP server exposes tools that an AI agent can call.

In plain words
What is it for?
Working on the TypeScript server, installing dependencies, building it, running type checks and linting, and performing MCP smoke tests or opening its inspector.
Why use it?
They tell contributors how the server connects to Bitrefill, handles its API key, and should be built, checked, linted, and tested.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/bitrefill/bitrefill-mcp-server/agents-md
Clone the repo
git clone --depth 1 https://github.com/bitrefill/bitrefill-mcp-server

Made for: Codex, OpenCode.

Per session 1,020 This file is loaded in full into every session.
When invoked 1,020 The same file — it is already loaded in full.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01020 $0.01020
Opus 5 $0.00510 $0.00510
Sonnet 5 $0.00204 $0.00204
Haiku 4.5 $0.00102 $0.00102

Measured 2d ago against content hash ea449a90ad80, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

bitrefill-mcp-server AGENTS.md scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

| thump mcp in node | `scripts/smoke-mcp.mjs` `scripts/*inspector*.sh` | not rest curl only |
AGENTS.md · 54 lines

What it actually says

OGG BRAIN: BITREFILL MCP

Me speak short. You read. Big meaning small word.

What file: Other robot read this before dig code. AGENTS.md = many tool (Cursor, Codex, see agents.md). Deep folder win over root. CLAUDE.md? Symlink here if Claude. Paper lie—Zod+CI true. Host IDE: Skills, MCP, subagent = not this repo. This repo = make MCP server, HTTP to Bitrefill. Subagent: give path + this file, no dump whole tree. Fresh token = strong token.

Repo in one breath: stdio process → MCP tools → GET/POST https://api.bitrefill.com/v2 + Authorization: Bearer ${BITREFILL_API_KEY}. KEY missing → zero tools (v2 no anon). zod only on tool args. Response = raw JSON string, no parse-lock. Table of tools, env: README.md.

Stack: ts esm node pnpm tsc eslint zod.

Run (copy):

Ugg need Ogg do
install pnpm install
build first always before run pnpm run build
type pnpm run typecheck
lint pnpm run lint
smoke mcp (real stdio) pnpm run build && pnpm run smoke
human poke gui pnpm run build && pnpm run inspector
one script test inspector pnpm run build && pnpm run smoke:inspector
all tools thump pnpm run test:inspector:all-tools

Done? small change: typecheck + lint. touch tools/transport: + build + smoke. Inspector CLI: npx thing want --tool-arg k=v many time—not one fat JSON. README say more.

Where dig:

Ugg Path Why
boot mcp src/index.ts stdio
list tool/resource src/handlers/tools.ts src/handlers/resources.ts name→handler
zod in src/schemas/ in only
http+bearer+error src/utils/api/base.ts src/utils/api/authenticated.ts v2 one way
call api src/services/ by domain
type lie only src/types/api.ts ts help human not machine
fixed string src/constants/ pay cat
thump mcp in node scripts/smoke-mcp.mjs scripts/*inspector*.sh not rest curl only

rg toolName src/handlers find bone.

New tool work order: schemas/ + maybe services/ + handlers/tools.ts + README if user see. kebab like-this. v2 path match. error = BitrefillApiError from base.ts. import style = neighbor file not fight linter. Me kill idea unauth "public" client. v2 = Bearer or starve.

Always: build before smoke/node build/index.js. in-Zod, out-raw, policy no flip unless human shout. new tool: kebab + match doc.

Ask big brain first: any tool that take moneybuy-products pay-invoice create-esim-invoice pay-esim-invoice + later pay-shaped tool. test key, read Bitrefill doc, no assume free sandbox. change base url / auth = ask.

Never: commit key, .env, token. smoke must hit this pack build/index.js stdio—not Bitrefill hosted mcp, not "only curl api" and say mcp work.

Subagent short: scout: read src scripts README, no edit. builder: this file + files touch only. checker: pnpm typecheck pnpm lint pnpm build && pnpm smoke. Remember: child agent test server; inside server already got http client. no confuse layer.

Edit this ogg when: script change, flag change, same dumb mistake two time—add one line, point src/. file fat like mammoth? nest AGENTS.md in folder or shove long story README—root stay thin for small token.

Ugg. End.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 54 lines · 1,020 tokens per session scan A ea449a90ad80

Subscribe to this mod's changes

bitrefill-mcp-server AGENTS.md is an instructions file published in the GitHub repository bitrefill/bitrefill-mcp-server (2 stars, last pushed 4mo ago), licensed MIT. It adds 1,020 tokens to every session, about $0.0051 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.