Skip to content
Merged
7 changes: 4 additions & 3 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
* [Tradable Collection Example](x-tokenization/examples/txs/msgcreatecollection/tradable-nft-collection.md)
* [MsgUpdateUserApprovals Examples](x-tokenization/examples/txs/msgupdate-user-approvals/README.md)
* [Updating Outgoing Approvals](x-tokenization/examples/txs/msgupdate-user-approvals/updating-outgoing-approvals.md)
* [🤖 MCP Builder Skills](x-tokenization/examples/skills/README.md)
* [🤖 Builder Skills](x-tokenization/examples/skills/README.md)
* [Smart Token](x-tokenization/examples/skills/smart-token.md)
* [Minting](x-tokenization/examples/skills/minting.md)
* [Liquidity Pools](x-tokenization/examples/skills/liquidity-pools.md)
Expand Down Expand Up @@ -163,11 +163,12 @@
* [SDK Commands](for-developers/cli/sdk-commands.md)
* [API Commands](for-developers/cli/api-commands.md)
* [Chain Commands](for-developers/cli/chain-commands.md)
* [Build Commands](for-developers/cli/build-commands.md)
* [Builder Templates](for-developers/cli/builder-templates.md)
* [Builder Commands](for-developers/cli/builder-commands.md)
* [CLI for AI Agents](for-developers/cli/for-ai-agents.md)
* [🤖 AI Agents & Bots](for-developers/ai-agents/README.md)
* [Testnet Faucet API](for-developers/ai-agents/testnet-faucet.md)
* [MCP Builder Tools Reference](for-developers/ai-agents/mcp-builder-tools.md)
* [Builder Tools Reference](for-developers/ai-agents/builder-tools.md)
* [WebSocket Events](for-developers/ai-agents/websocket-events.md)
* [Bot Examples](for-developers/ai-agents/bot-examples.md)
* [E2E: AI Agent with USDC Vault](for-developers/ai-agents/openclaw-vault-tutorial.md)
Expand Down
12 changes: 6 additions & 6 deletions for-developers/ai-agents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,22 @@ console.log('TX Hash:', result.txHash);
| Path | Best For | Install |
|------|----------|---------|
| **CLI & Chain Binary** | Terminal agents, shell scripts, any language | `curl -fsSL .../install.sh \| sh` — [guide](../cli/for-ai-agents.md) |
| **MCP Builder Tools** | AI assistants (Claude, Cursor, etc.) | `npm i -g bitbadges-builder-mcp` |
| **BitBadges Builder Tools** | AI assistants (Claude, Cursor, etc.) | `npm i -g bitbadgesjs-sdk` |
| **SDK Signing Client** | Full-featured TypeScript bots | `npm i bitbadgesjs-sdk` |
| **Direct HTTP** | Lightweight scripts, any language | REST calls to `api.bitbadges.io` |
| **Agent Spending Authorization** | Set daily caps, time windows, and revocation | [guide](agent-spending-authorization.md) |

### MCP Quick Setup
### Quick Setup

```bash
# Claude Code (one command)
claude mcp add bitbadges-builder -- npx -y bitbadges-builder-mcp
claude mcp add bitbadges-builder -- npx -y -p bitbadgesjs-sdk bitbadges-builder

# Or install globally
npm install -g bitbadges-builder-mcp
npm install -g bitbadgesjs-sdk
```

See the full [MCP Builder Tools Reference](mcp-builder-tools.md) for all 50+ tools (including session-based per-field builders), configuration for Claude Desktop / Cursor, and workflow guides.
See the full [Builder Tools Reference](builder-tools.md) for all 50+ tools (including session-based per-field builders), configuration for Claude Desktop / Cursor, and workflow guides.

## Network Configuration

Expand All @@ -90,7 +90,7 @@ Additional endpoints (testnet):
| Page | Description |
|------|-------------|
| [Testnet Faucet API](testnet-faucet.md) | Get free testnet BADGE tokens for your bot |
| [MCP Builder Tools Reference](mcp-builder-tools.md) | All 50+ MCP tools for AI assistants |
| [Builder Tools Reference](builder-tools.md) | All 50+ builder tools for AI assistants |
| [WebSocket Events](websocket-events.md) | Subscribe to real-time blockchain events |
| [Bot Examples](bot-examples.md) | Copy-paste examples for common bot patterns |
| [E2E: AI Agent with USDC Vault](openclaw-vault-tutorial.md) | Full tutorial: wallet setup, vault rules, withdraw/deposit |
Expand Down
12 changes: 6 additions & 6 deletions for-developers/ai-agents/bot-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,9 @@ ws.on('close', () => {
});
```

## Example 5: MCP Agent Workflow
## Example 5: Builder Agent Workflow

When using the BitBadges MCP tools (e.g., in Claude Desktop or Claude Code), there are two build approaches:
When using the BitBadges builder tools (e.g., in Claude Desktop or Claude Code), there are two build approaches:

### Session-Based Build (Recommended)

Expand All @@ -197,7 +197,7 @@ add_transfer({ from: "Mint", toAddresses: ["bb1youraddress..."], balances: [...]

# 4. Verify (in parallel)
validate_transaction()
audit_collection()
review_collection()
simulate_transaction()

# 5. Export the final transaction JSON
Expand All @@ -210,10 +210,10 @@ For quick collection creation from the terminal, use the CLI build commands:

```bash
# Generate a vault token (outputs transaction JSON)
bitbadges-cli build vault --backing-coin USDC --name "My Vault" --dry-run --explain
bitbadges-cli builder templates vault --backing-coin USDC --name "My Vault" --explain

# Generate a subscription collection
bitbadges-cli build subscription --interval monthly --price 10 --denom USDC --recipient bb1...
bitbadges-cli builder templates subscription --interval monthly --price 10 --denom USDC --recipient bb1...
```

See [CLI Build Commands](../cli/build-commands.md) for the full list of 18 template builders.
Expand All @@ -227,7 +227,7 @@ search({ query: "my collection name" })
→ verify_ownership({ collectionId: "123", address: "bb1...", badgeIds: [...] })
```

> **Note:** The MCP server builds and validates transactions but does not sign or broadcast. Use the BitBadges SDK signing client or the BitBadges frontend to sign and submit.
> **Note:** The builder builds and validates transactions but does not sign or broadcast. Use the BitBadges SDK signing client or the BitBadges frontend to sign and submit.

## Tips for AI Agents

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# MCP Builder Tools Reference
# Builder Tools Reference

The [BitBadges Builder MCP server](https://github.com/BitBadges/bitbadges-builder-mcp) provides 50+ tools for AI assistants to build, audit, and validate BitBadges transactions. It works with Claude Desktop, Claude Code, Cursor, and any MCP-compatible client.
The [BitBadges Builder](https://github.com/bitbadges/bitbadgesjs/tree/main/packages/bitbadgesjs-sdk/src/builder) provides 50+ tools for AI assistants to build, audit, and validate BitBadges transactions. It works with Claude Desktop, Claude Code, Cursor, and any MCP-compatible client.

> For terminal-based workflows without MCP, use the [BitBadges CLI](../cli/) — it provides 104+ API routes, review/audit tools, and built-in docs from the command line. See [CLI for AI Agents](../cli/for-ai-agents.md).
> For terminal-based workflows without an MCP client, use the [BitBadges CLI](../cli/) — it provides 104+ API routes, review/audit tools, and built-in docs from the command line. See [CLI for AI Agents](../cli/for-ai-agents.md).

## Installation

```bash
# Install globally
npm install -g bitbadges-builder-mcp
npm install -g bitbadgesjs-sdk

# Or run directly (no install)
npx bitbadges-builder-mcp
npx -p bitbadgesjs-sdk bitbadges-builder
```

### Claude Desktop
Expand All @@ -23,7 +23,7 @@ Add to your `claude_desktop_config.json`:
"mcpServers": {
"bitbadges-builder": {
"command": "npx",
"args": ["-y", "bitbadges-builder-mcp"],
"args": ["-y", "-p", "bitbadgesjs-sdk", "bitbadges-builder"],
"env": {
"BITBADGES_API_KEY": "your-api-key",
"BITBADGES_MNEMONIC": "your mnemonic phrase"
Expand All @@ -36,7 +36,7 @@ Add to your `claude_desktop_config.json`:
### Claude Code

```bash
claude mcp add bitbadges-builder -- npx -y bitbadges-builder-mcp
claude mcp add bitbadges-builder -- npx -y -p bitbadgesjs-sdk bitbadges-builder
```

### Cursor
Expand All @@ -48,7 +48,7 @@ Add to `.cursor/mcp.json`:
"mcpServers": {
"bitbadges-builder": {
"command": "npx",
"args": ["-y", "bitbadges-builder-mcp"],
"args": ["-y", "-p", "bitbadgesjs-sdk", "bitbadges-builder"],
"env": {
"BITBADGES_API_KEY": "your-api-key"
}
Expand Down Expand Up @@ -112,8 +112,7 @@ Standalone tools for building specific non-collection resources.

| Tool | Description |
|------|-------------|
| `audit_collection` | Security audit: centralization, supply inflation, approval flaws, common bugs (9 categories) |
| `verify_standards` | Verify a collection transaction complies with BitBadges protocol standards. Returns violations with severity levels |
| `review_collection` | Unified review: audit, standards compliance, and UX findings in one call with audience filtering |
| `explain_collection` | Human-readable collection report with Q&A mode (user/developer/auditor audiences) |
| `analyze_collection` | Structured analysis of transferability, approvals, permissions, and how to obtain/transfer tokens |

Expand Down Expand Up @@ -175,7 +174,7 @@ The per-field tools build up a collection incrementally in a session. This is th
```
set_standards + set_valid_token_ids + set_invariants + add_approval + set_permissions + set_default_balances + set_collection_metadata + set_token_metadata
→ (optional) add_transfer (for auto-mint at creation)
→ validate_transaction + audit_collection + simulate_transaction (in parallel)
→ validate_transaction + review_collection + simulate_transaction (in parallel)
→ fix errors with remove_approval + re-add (max 3 attempts)
→ get_transaction (final JSON)
```
Expand All @@ -184,7 +183,7 @@ set_standards + set_valid_token_ids + set_invariants + add_approval + set_permis

1. **Build** — Call per-field tools in parallel to define the collection: standards, token IDs, invariants, approvals, permissions, metadata, balances.
2. **Auto-Mint** (optional) — If the user wants tokens minted to specific addresses at creation, call `add_transfer` to append a `MsgTransferTokens` alongside the collection creation.
3. **Verify** — Call `validate_transaction`, `audit_collection`, and `simulate_transaction` in parallel. Fix any errors with targeted `remove_approval` + re-add.
3. **Verify** — Call `validate_transaction`, `review_collection`, and `simulate_transaction` in parallel. Fix any errors with targeted `remove_approval` + re-add.
4. **Export** — Call `get_transaction` to get the final transaction JSON for signing.

### Query & Verification (No Signing)
Expand All @@ -193,7 +192,7 @@ set_standards + set_valid_token_ids + set_invariants + add_approval + set_permis
query_collection → verify_ownership → (take action based on result)
```

> **Note:** The MCP server does not handle signing or broadcasting. Transaction signing must be done externally using the BitBadges SDK, a wallet, or the BitBadges frontend.
> **Note:** The builder does not handle signing or broadcasting. Transaction signing must be done externally using the BitBadges SDK, a wallet, or the BitBadges frontend.

## Auto-Mint at Creation

Expand All @@ -210,9 +209,9 @@ Maximum 4 transfer messages per transaction.

## Skills (Guided Workflows)

The MCP server includes skill instructions accessible via `get_skill_instructions`. These guide AI agents through building specific collection types.
The builder includes skill instructions accessible via `get_skill_instructions`. These guide AI agents through building specific collection types.

For full instructions and examples for each skill, see the **[MCP Builder Skills reference](../../x-tokenization/examples/skills/README.md)**.
For full instructions and examples for each skill, see the **[Builder Skills reference](../../x-tokenization/examples/skills/README.md)**.

Common features like ownership requirements, codes, and passwords are built into the approval system directly and can be composed with any skill.

Expand All @@ -224,9 +223,9 @@ Common features like ownership requirements, codes, and passwords are built into
| **GitBook MCP** | [docs.bitbadges.io/~gitbook/mcp](https://docs.bitbadges.io/~gitbook/mcp) | Search BitBadges documentation |
| **BitBadges API** | [api.bitbadges.io](https://api.bitbadges.io) | REST API for queries and data |

## MCP Resources
## Builder Resources

The MCP server also exposes embedded documentation as resources:
The builder also exposes embedded documentation as resources:

| Resource URI | Name | Description |
|-------------|------|-------------|
Expand Down
6 changes: 3 additions & 3 deletions for-developers/ai-agents/claims-for-agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ await api.createClaim({
});
```

If you are using the BitBadges MCP tools or the AI builder, use the `build_claim` tool instead of constructing the payload manually (see MCP Tool Workflow below). The AI builder auto-generates `seedCode` and codes server-side for the `codes` plugin — you only need to specify `numCodes` in `publicParams`.
If you are using the BitBadges Builder tools or the AI builder, use the `build_claim` tool instead of constructing the payload manually (see Builder Tool Workflow below). The AI builder auto-generates `seedCode` and codes server-side for the `codes` plugin — you only need to specify `numCodes` in `publicParams`.

## Completing a Claim

Expand Down Expand Up @@ -160,9 +160,9 @@ The `prioritizedApprovals` array tells the chain which approval to check. The `a
- **Ownership-gated minting**: Use the `must-own-badges` plugin to gate minting based on existing token ownership. Users who hold token X can mint token Y.
- **Time-windowed drops**: Add `transferTimes` constraints to limit when claims can be completed.

## MCP Tool Workflow
## Builder Tool Workflow

If you are using the BitBadges MCP builder tools, the `build_claim` tool handles payload construction:
If you are using the BitBadges Builder tools, the `build_claim` tool handles payload construction:

```
build_claim({
Expand Down
2 changes: 1 addition & 1 deletion for-developers/ai-agents/openclaw-vault-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,5 +327,5 @@ Give your agent the prompt from the **AI Prompt** tab (Step 3) as part of its sy
- [MsgTransferTokens](../../x-tokenization/messages/msg-transfer-tokens.md) - Transfer message details
- [IBC Backed Paths](../../x-tokenization/concepts/ibc-backed-paths.md) - How backing works
- [Bot Examples](bot-examples.md) - More agent patterns
- [MCP Builder Tools](mcp-builder-tools.md) - If your agent uses MCP (Claude, etc.)
- [BitBadges Builder Tools](builder-tools.md) - If your agent speaks MCP (Claude, etc.)
- [Testnet Faucet](testnet-faucet.md) - Get testnet tokens for testing
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ const res = await BitBadgesApi.simulateTx(txBody); //Returned from signing steps

This will return the gas used and success statuses on a dry run of the transaction.

> **Payload shapes.** `/api/v0/simulate` accepts two payload shapes. Use the proto-encoded form (`{ mode, tx_bytes }`) shown above — this is the fully supported path and what the signing flows produce after signing. A second shape, `{ messages, memo?, fee, creatorAddress }` with unsigned JSON messages, is also accepted and proto-encoded server-side for internal agent/CLI tooling. The JSON path is still stabilizing and only covers the tokenization + baseline Cosmos message tiers, so external integrations should stick with the `tx_bytes` form.

```typescript
export interface SimulateTxRouteSuccessResponse<T extends NumberType> {
gas_info: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ console.log('Transaction hash:', result.txHash);

### Server-Side Signing (EVM Path — Recommended)

> **Building an AI agent or bot?** See the [AI Agents & Bots](../../ai-agents/) section for end-to-end examples, testnet faucet, and MCP tool reference.
> **Building an AI agent or bot?** See the [AI Agents & Bots](../../ai-agents/) section for end-to-end examples, testnet faucet, and builder tool reference.

Server-side signing uses `GenericEvmAdapter` which connects to the EVM JSON-RPC endpoint and broadcasts via precompile calls. This is the recommended path for bots, agents, and backend services.

Expand Down
10 changes: 6 additions & 4 deletions for-developers/bitbadges-sdk/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ bitbadges-cli sdk review 42 --testnet
echo '{"messages":[...]}' | bitbadges-cli sdk review -
```

If `BITBADGES_API_KEY` is set, transactions are sent to the enriched simulate endpoint. Falls back to local analysis (`validateTransaction` + `auditCollection` + `verifyStandardsCompliance`) if the API is unavailable.
If `BITBADGES_API_KEY` is set, transactions are sent to the enriched simulate endpoint. Falls back to local analysis via the unified `reviewCollection()` entry point if the API is unavailable.

For collection JSON (no `messages` field), runs `auditCollection` and `verifyStandardsCompliance` locally.
For collection JSON (no `messages` field), runs `reviewCollection()` locally.

`reviewCollection()` composes three check families — `audit` (permission/supply/centralization), `standards` (protocol conformance), and `ux` (the deterministic UX checks ported from the frontend review sidebar) — into a single `Finding[]`. Each finding carries an `audience` field (`'agent' | 'human' | 'both'`) so consumers can filter: agents get everything; the frontend sidebar passes `audienceFilter: 'human'` via `ReviewContext` to hide audit findings the MCP validators already surface during construction.

### interpret-tx

Expand Down Expand Up @@ -172,7 +174,7 @@ bitbadges-cli sdk gen-list-id bb1abc... --blacklist

### skills

List available MCP Builder skills or fetch a specific skill's instructions from the bundled docs.
List available Builder skills or fetch a specific skill's instructions from the bundled docs.

```bash
bitbadges-cli sdk skills # list all skills
Expand Down Expand Up @@ -292,7 +294,7 @@ Add that line to your `.bashrc` or `.zshrc` for persistent completions.

## Build Commands

Token building (creating collections, generating approvals, etc.) is handled by the [MCP Builder Tools](../ai-agents/mcp-builder-tools.md), not the CLI directly. The CLI focuses on analysis, review, and API access.
Token building (creating collections, generating approvals, etc.) is handled by the [BitBadges Builder Tools](../ai-agents/builder-tools.md), not the CLI directly. The CLI focuses on analysis, review, and API access.

## bitbadgeschaind Delegation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Returns a single amount. Defaults to the current time if `time` is omitted.

---

## MCP Tools
## Builder Tools

### Full flow

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ The function automatically strips sensitive claim parameters (`seedCode`, `preim

## Also Available Via

- **MCP**: The `explain_collection` tool uses this under the hood
- **Builder**: The `explain_collection` tool uses this under the hood
- **Frontend**: Displayed on collection overview pages
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ const netChanges = calculateNetChanges(parsed, fee, signerAddress);

## Also Available Via

- **MCP**: The `simulate_transaction` tool returns structured `parsedEvents` and `netChanges`
- **Builder**: The `simulate_transaction` tool returns structured `parsedEvents` and `netChanges`
- **Frontend**: The TxModal "Net Changes" tab uses this under the hood
2 changes: 1 addition & 1 deletion for-developers/claim-builder/leveraging-ai.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Leveraging AI

> **Building an AI agent or bot that interacts with BitBadges directly?** See the [AI Agents & Bots](../ai-agents/) section for signing, broadcasting, MCP tools, and bot examples.
> **Building an AI agent or bot that interacts with BitBadges directly?** See the [AI Agents & Bots](../ai-agents/) section for signing, broadcasting, builder tools, and bot examples.

A great way to implement both criteria and utility is through AI models and agents. This can be done through custom plugins created in the [developer portal](https://bitbadges.io/developer).

Expand Down
Loading