Bitnob MCP Server
Officialby bitnob
README.md
# Bitnob MCP server
A local [MCP](https://modelcontextprotocol.io) server for the Bitnob API. Your AI assistant (Claude Code, Cursor, VS Code, Windsurf and others) gets tools to check balances, look up transactions, quote and send payouts, and more.
It runs on your machine and signs requests there, so your client secret never leaves it. It's read-only unless you turn on writes, and it makes changes only with sandbox credentials unless you allow production.
Not released yet.
## Set it up
The server is one file, `bitnob-mcp.js`, with no dependencies. It needs Node.js 20 or later. It isn't on npm. Get it one of two ways.
Bitnob keys only work from allowlisted IP addresses, including in sandbox. Add your machine's IP to the key's allowlist in the dashboard first.
### Claude Code plugin
Set your sandbox credentials in the environment Claude Code starts from, then install the plugin from the Bitnob marketplace:
```bash
export BITNOB_CLIENT_ID="your sandbox client ID"
export BITNOB_CLIENT_SECRET="your sandbox client secret"
```
```
/plugin marketplace add bitnob/bitnob-skills
/plugin install bitnob-mcp@bitnob
```
The plugin runs the server with its default settings. To pass flags, add the server yourself as below.
### Download a release
Download `bitnob-mcp.js` and `SHA256SUMS` from the [latest release](https://github.com/bitnob/bitnob-mcp/releases/latest), and check them:
```bash
sha256sum -c SHA256SUMS --ignore-missing
```
```bash
gh attestation verify bitnob-mcp.js --repo bitnob/bitnob-mcp
```
The second check confirms the file was built by this repo's release workflow from a tagged commit. Then add it to your MCP client. For Claude Code, Cursor and most other clients the config looks like this:
```json
{
"mcpServers": {
"bitnob": {
"command": "node",
"args": ["/path/to/bitnob-mcp.js"],
"env": {
"BITNOB_CLIENT_ID": "your sandbox client ID",
"BITNOB_CLIENT_SECRET": "your sandbox client secret"
}
}
}
}
```
## What it can do
Ask your assistant to call `whoami` first: it says whether you're on sandbox or production and what the server is allowed to do.
| Setting | Default | To change it |
|---|---|---|
| Toolsets | `balances`, `exchange-rates`, `transactions` | `--toolsets payouts,cards` or `--toolsets all` |
| Writes (anything that creates or changes something) | Off. Read-only POSTs, such as address validation, decoding and fee estimates, still load. | `--allow-writes` |
| Production credentials | Changes and reads of account data refused unless `whoami` says sandbox. Reference lists, rates and `whoami` still work. | `--production` |
| Tools that move money, cancel or disable something, or rotate a secret, with `--production` | Locked | `--allow-tools payouts_finalize,withdrawals_create` |
Add the flags to `args` after the file, for example `["/path/to/bitnob-mcp.js", "--toolsets", "payouts,balances", "--allow-writes"]`.
### Production money moves
With `--production`, two locks apply to the tools that move money, change where money goes, cancel or disable something, weaken a security control, or rotate a secret. They're marked destructive, and listed in `src/rules.ts`.
- **They don't load unless you name them** in `--allow-tools`, comma-separated. A locked tool tells the assistant to ask you, and sends nothing.
- **Each call that could use real funds asks you to confirm** in your MCP client first, showing the tool and its details. That's every Enterprise call, and Business calls unless the credentials are sandbox. If you decline, nothing is sent. The assistant can't answer the prompt for you.
The prompt shows every argument in full, so a call whose arguments are too long to show (over 2,000 characters) is refused rather than cut short. The prompt uses MCP elicitation. A client that doesn't support it can't run these tools in production; they're refused, and nothing is sent.
The tools that change where webhook events go (creating or updating an Enterprise webhook or subscription) are on the list too. Creating a webhook also returns its signing secret, once, into the conversation.
### Account data
On live credentials, reads need `--production`, the same as changes. That covers everything that returns your account's data: customers, cards, balances, payouts, beneficiaries, transactions, statements, addresses, virtual accounts and the rest. Without it, only these work: `whoami`, reference lists such as countries, banks and currencies, exchange rates and trading prices, and calls that only decode, encode or validate what you give them. The full list is `OPEN_READS` in `src/rules.ts`. A tool that isn't on it needs `--production`, so a new endpoint stays closed until it's added there.
To read live data without allowing changes, start the server with `--production` and without `--allow-writes`.
`--list-toolsets` prints every toolset. There's one per area of the API (`addresses`, `cards`, `customers`, `payouts`, `trading`, `virtual-accounts` and more), plus `enterprise-*` toolsets when `BITNOB_ENTERPRISE_API_KEY` is set. The full list is 191 tools, which is more than some clients can load at once, so load only what you need.
Tools always available:
- `whoami`: the account, sandbox or production, and the server's settings.
- `verify_webhook_signature`: checks a webhook's `x-bitnob-signature` against its raw body, locally. Uses `BITNOB_WEBHOOK_SECRET`.
- `payout_quote_and_initialize` (with `--allow-writes`): quotes a payout and attaches the beneficiary, then stops so the user can confirm before `payouts_finalize` sends it.
- `issue_card_for_customer` (with `--allow-writes`): issues a USD virtual Visa card on the prepaid program. It creates the customer (or uses `customer_id`), runs card KYC only if the customer isn't approved yet, and creates the card. It returns as soon as the card is created, often while it's still `pending` (check it with `cards_get`). The opening balance is $2 to $2,500, and at standard pricing a $2 card takes $4 (the balance, a $1 creation fee and a $1 top-up fee). If the email, phone number or ID number already belongs to a customer with different details, it stops without creating a card and says which details differ. If KYC isn't approved, it returns the status and `verification_link`; a rejected KYC comes back as an error with the reason.
- `simulate_deposit` (with `--allow-writes`, sandbox credentials only, even with `--production`): makes a test deposit arrive. For a virtual account, it simulates a bank transfer, which always credits ₦10,000; the sandbox allows ₦100,000 of these an hour. For crypto, the sandbox has no simulation, so it sends from your own balance to one of your own addresses. The amount comes back as a `deposit.success`, but the send fee (about 1 USDT) doesn't.
Every other tool maps to one API operation, generated from the OpenAPI spec. Write tools with a `reference` field fill one in when it's left out and return it as `reference_used`, so a retry can reuse it.
The server also serves the [Bitnob skill](https://github.com/bitnob/bitnob-skills) as resources (`bitnob://skill/SKILL.md` and `bitnob://skill/references/*.md`), so assistants without skills support still get the guidance.
### Enterprise API
Set `BITNOB_ENTERPRISE_API_KEY` and load `enterprise-*` toolsets. Enterprise keys are production keys, so Enterprise reads need `--production`, and writes need both `--allow-writes` and `--production`. Without `--production`, only the key's details (`enterprise_get_me`) and reference lists such as assets, chains and network fees work.
## Logs
The server writes one JSON line to stderr for each API call, so you have a record of what the assistant did apart from the chat. Your MCP client keeps stderr in its server log. Each line has the tool, the step, the method and path, the status, how long it took, and the request ID, error code, reference and idempotency key when there are any:
```json
{"ts":"2026-11-23T12:05:34.451Z","event":"api_call","tool":"transactions_get","method":"GET","path":"/api/transactions/…","duration_ms":417,"status":404,"request_id":"req_…","code":"NOT_FOUND"}
```
Request and response bodies, query strings and headers are never logged, so credentials and customer details stay out. Set `BITNOB_MCP_LOG=off` to turn the log off. Requests carry a `User-Agent` of `bitnob-mcp/<version>`.
## Development
Copy `.env.example` to `.env` with sandbox credentials. Your IP must be on the key's allowlist.
```bash
npm install
```
```bash
npm test
```
`npm test` builds the server, starts it over stdio as an MCP client would, and calls it against the sandbox: the default tools, every read tool that needs no inputs, a 30 KES sandbox payout, a simulated virtual account deposit and the card tool's wrong-customer check. Two tests cost more, so they only run with `BITNOB_RUN_COSTLY=1`: a crypto deposit (about 1 USDT in fees) and issuing a card ($4 of USDC).
`npm run test:offline` needs no credentials or network. It stubs the API and checks the safety gates (flag parsing, no tool returning card numbers or CVVs, failed, timed-out or cancelled writes returning the reference or idempotency key to retry with), the logs, the hand-written tools, and that `src/generated/tools.json` is consistent. It also copies `dist/index.js` alone into an empty directory, the way users get it, and checks that it runs there with no `node_modules` or skill folder and serves the same tools and resources as the unbundled build.
`npm run smoke` checks that your `.env` credentials sign correctly and are sandbox credentials.
Regenerate the tools after the OpenAPI spec changes. The generator prints what it leaves out, such as header parameters the server sets itself:
```bash
npm run generate -- ../../docs/bitnob-docs/api-collections/swagger
```
Check whether `src/generated/tools.json` is up to date with a spec, without changing it. It exits 1 when it's out of date:
```bash
npm run check-tools -- ../../docs/bitnob-docs/api-collections/swagger
```
Per-tool overrides of the spec (tools treated as reads or writes, marked destructive, replaced by a hand-written tool, or never loaded) are in `src/rules.ts`.
Copy the skill in after it changes:
```bash
npm run copy-skill
```
Run the server locally with `npm start`, or point an MCP client at `node dist/index.js` after `npm run build`.
`npm run build` compiles `src` to `build/`, which the offline tests import, then bundles the server into `dist/index.js` with esbuild (`scripts/bundle.mjs`). The bundle includes its dependencies, the skill's text and the version, so it runs as a single file and users run exactly the third-party code that was built and tested. `dist/THIRD_PARTY_LICENSES.md` carries the licenses of the bundled packages.
## Releases
The server isn't published to npm. To release, set `version` in `package.json`, merge, and push a matching tag such as `v0.1.0`. The release workflow (`.github/workflows/release.yml`):
1. Builds `dist/index.js` once, from the lockfile with no cache, and runs the typecheck and offline tests.
2. Publishes a GitHub release with `bitnob-mcp.js`, `SHA256SUMS` and `THIRD_PARTY_LICENSES.md`, and a build provenance attestation for `bitnob-mcp.js`.
The publishing job runs in the `release` environment, so required reviewers on that environment approve each release. Then update the Claude Code plugin in [bitnob-skills](https://github.com/bitnob/bitnob-skills) with `npm run update-mcp -- v0.1.0`. It checks the checksum and attestation before it copies the file in.
## License
[MIT](LICENSE)
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues