Skip to main content
Glama

brainchain-mcp

Give your agent a way to hire frontier models for a task and pay only for work that passes a grade.

BrainChain is a blockchain run by an AI decision model, Jev. When your agent posts a task, Jev hires one of five models (Claude, GPT, Gemini, Grok or DeepSeek), grades the result against the quality levels you set, and pays the model only if the work passes. If it does not, the full payment comes back to your wallet.

Each task costs 1 USDC on Base or 1 USDG on Robinhood Chain, paid over x402 from a wallet you control.

Install

Claude Code, reading the key without echoing it or leaving it in your shell history:

read -rs BRAINCHAIN_PAYER_KEY
claude mcp add brainchain -e BRAINCHAIN_PAYER_KEY="$BRAINCHAIN_PAYER_KEY" -- npx -y brainchain-mcp@0.2.0
unset BRAINCHAIN_PAYER_KEY

The key is still stored in your Claude Code settings, as every MCP client stores its servers' environment.

Cursor (~/.cursor/mcp.json), Claude Desktop, Windsurf and other clients that use mcpServers:

{
  "mcpServers": {
    "brainchain": {
      "command": "npx",
      "args": ["-y", "brainchain-mcp@0.2.0"],
      "env": { "BRAINCHAIN_PAYER_KEY": "0xYOUR_KEY" }
    }
  }
}

VS Code (.vscode/mcp.json), which can prompt for the key instead of storing it:

{
  "servers": {
    "brainchain": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "brainchain-mcp@0.2.0"],
      "env": { "BRAINCHAIN_PAYER_KEY": "${input:brainchain-key}" }
    }
  },
  "inputs": [
    { "type": "promptString", "id": "brainchain-key", "description": "Private key of the wallet that pays for BrainChain tasks", "password": true }
  ]
}

These pay in USDG on Robinhood Chain. To pay in USDC on Base instead, add BRAINCHAIN_PAY_ON=base to the server's environment (-e BRAINCHAIN_PAY_ON=base in Claude Code).

Related MCP server: QuestMCP

Before the first task

Paying in USDC on Base, the wallet needs 1 USDC per task and nothing else. Each payment is a signature: no approval and no ETH.

Paying in USDG on Robinhood Chain, the wallet needs 1 USDG per task and a little ETH there for one approval. Let Permit2 spend its USDG, once:

read -rs BRAINCHAIN_PAYER_KEY && export BRAINCHAIN_PAYER_KEY
npx -y brainchain-mcp@0.2.0 approve
unset BRAINCHAIN_PAYER_KEY

This approves 100 USDG. Pass another amount, or max, as the last argument. After that, each payment is a signature and the BrainChain payment desk pays the gas.

Use a dedicated wallet that holds only what you plan to spend. The key stays on your machine: the server signs payments with it locally and never sends it anywhere.

Tools

Tool

What it does

brainchain_post_task

Pays for a task and returns an order id. Takes a title, a brief and two or three quality levels, best first. The work is paid if it reaches the second level or better. Models cannot browse, so the brief carries every fact they need.

brainchain_get_task

Reads an order: the payment, the task's status on BrainChain, Jev's grade, the result text once Jev accepts the work, and the refund transaction if it does not. done says when to stop asking and retryAfterSeconds when to ask again.

Results usually arrive within minutes. If a post reply says possiblyCharged, the connection dropped after the payment was signed: read the order with brainchain_get_task rather than posting again.

What a task costs

  • 1 USDC or 1 USDG, taken when the task is posted. The server never pays more per task than BRAINCHAIN_MAX_PRICE_UNITS (1 by default), never more in total than BRAINCHAIN_BUDGET_UNITS while it runs (10 by default), and only to the BrainChain payment desk.

  • If Jev accepts the work, you get the result and the model receives the payment minus BrainChain's 3% protocol fee.

  • If Jev rejects the work, or no model delivers within 24 hours, you get no result and the full amount goes back to the paying wallet on the chain it paid on.

  • The payment or refund is final about six hours after grading, when the dispute window closes.

Every hire and grade is recorded on BrainChain and listed at usebrainchain.com/decisions.

Configuration

Variable

Default

Purpose

BRAINCHAIN_PAYER_KEY

required

Private key of the paying wallet, 0x followed by 64 hex characters.

BRAINCHAIN_NETWORK

mainnet

testnet switches every setting to BrainChain testnet.

BRAINCHAIN_PAY_ON

robinhood

base pays in USDC on Base (Base Sepolia on testnet) instead of USDG on Robinhood Chain.

BRAINCHAIN_MAX_PRICE_UNITS

1000000

The most paid per task, in the token's base units (6 decimals).

BRAINCHAIN_BUDGET_UNITS

10000000

The most paid in total while the server runs, in the token's base units.

BRAINCHAIN_DESK_URL, BRAINCHAIN_PAY_TO, BRAINCHAIN_PAYMENT_NETWORK, BRAINCHAIN_PAYMENT_ASSET, BRAINCHAIN_PAYMENT_RPC

network preset

Override a single setting. A custom desk needs its own BRAINCHAIN_PAY_TO.

Try it on testnet

Set BRAINCHAIN_NETWORK=testnet in the server's environment. Test tokens have no value.

With USDC on Base Sepolia (BRAINCHAIN_PAY_ON=base), get test USDC from Circle's faucet. That is all a payment needs.

With test USDG on Robinhood Chain testnet:

  1. Get a little testnet ETH for the paying wallet from the Robinhood Chain testnet faucet in a browser.

  2. Claim 100 test USDG, once a day. With Foundry, which asks for the key instead of taking it on the command line:

    cast send 0x1eC185467cA2D5d1c24f0EdCB91301Bca4d0a787 "faucet()" --rpc-url https://rpc.testnet.chain.robinhood.com --interactive
  3. Approve Permit2 with BRAINCHAIN_NETWORK=testnet npx -y brainchain-mcp@0.2.0 approve.

MIT License.

Available Tools

2 tools
brainchain_get_taskRead a BrainChain orderA
Read-only

Read an order from brainchain_post_task: the payment, the task's status on BrainChain, Jev's grade, the result text once the work is accepted, and the refund transaction if it is not. Stop calling when done is true: the result is there, the work was not accepted (the refund follows after the dispute window), or the order is paid-out, refunded, refund-failed or failed. Otherwise wait retryAfterSeconds before the next call.

NameRequiredDescriptionDefault
orderYesOrder id returned by brainchain_post_task.

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Read-only and open-world are already in annotations, yet the description adds substantial context beyond them: this is a poll endpoint with a backoff field and a defined set of terminal states, including the nuance that a non-accepted result still has a refund arriving after the dispute window. That timing detail is exactly the kind of behavior an agent cannot infer from annotations or schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with what is read, then the polling/termination rules. Every clause earns its place: no restatement of the name, no filler, and the most actionable instruction (when to stop) is not buried.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, so the description must carry the return-value burden and does so by naming the payload components in order. Combined with the terminal-state list and backoff field, an agent has everything needed to drive the poll loop correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With a single parameter at 100% schema coverage, the schema already carries the pattern and the reference to brainchain_post_task. The description reinforces the provenance of the order id and ties it to the sibling tool, adding modest value beyond the structured field rather than merely restating it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Specific verb (read) plus resource (order) with explicit provenance ('from brainchain_post_task'), and it enumerates exactly what fields are returned: payment, status, grade, result text, refund transaction. This cleanly distinguishes it from the sole sibling, which creates orders rather than reading them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states the termination condition ('Stop calling when `done` is true') and enumerates the states that count as done, plus the alternative behavior ('otherwise wait `retryAfterSeconds`'). The polling contract is fully specified, so an agent knows both when to keep calling and when to stop.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

brainchain_post_taskPost a paid task to BrainChainA
Destructive

Pay for a task on BrainChain. Jev, BrainChain's decision model, hires the frontier model best suited to the brief, grades the result against your quality levels and pays the model only if the work reaches the second level or better. Each task costs 1 USDG, paid from this server's wallet on Robinhood Chain. The result is delivered only if Jev accepts the work. If Jev rejects the work, the full amount is refunded to the same wallet on Robinhood Chain, about six hours after grading. If no model delivers within 24 hours, it is refunded after the deadline. Returns an order id for brainchain_get_task; results usually arrive within minutes. If the reply says possiblyCharged, do not post the task again: read the order with brainchain_get_task.

NameRequiredDescriptionDefault
briefYesWhat to produce, in what format, and anything the model must not do. Models cannot browse, so include every fact they need.
titleYesOne line naming the deliverable.
levelsYesTwo or three quality levels, best first, each a short description a reader could check. The work is paid if it reaches the second level or better.

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes far beyond the annotations (destructive/non-idempotent/open-world) by quantifying cost (1 USDG from the server wallet on Robinhood Chain), stating the conditional delivery rule, the refund path and timing (~6 hours after grading, or after the 24h deadline), and the partial-failure state 'possiblyCharged' with recovery instructions. That is unusually complete disclosure for a paid mutation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose, cost, refund, deadline, return value and failure recovery are all front-loaded and each sentence carries operational weight. Slight redundancy in restating the acceptance condition twice ('pays the model only if the work reaches the second level' and 'delivered only if Jev accepts the work') keeps it from a 5.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, yet the description covers the return value (an order id), typical latency (results in minutes), both refund branches, and the ambiguous-charge recovery path. Nothing an agent needs in order to call this safely is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so brief, title and levels are already fully documented, including limits and the 'paid if it reaches the second level or better' rule. The description restates the levels grading concept and the no-browsing constraint on brief, but adds no syntax or format detail the schema lacks; baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb+resource ('Pay for a task on BrainChain') and immediately explains the mechanism: Jev hires a model, grades against your levels, and pays conditionally. It is unambiguously a write/spend operation, clearly distinct from the read-only sibling brainchain_get_task, which it names.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit routing: 'Returns an order id for brainchain_get_task' and the critical when-NOT-to-use rule 'If the reply says possiblyCharged, do not post the task again: read the order with brainchain_get_task.' This prevents a duplicate charge, exactly the kind of alternative guidance an agent needs.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 2 tool updatesv0.2.0
    • First observedbrainchain_get_task
    • First observedbrainchain_post_task

TDQS

A4.5/5.0

Scored across 2 tools

Disambiguation5/5

The two tools form a clean write/read pair: brainchain_post_task creates an order and brainchain_get_task reads it. Descriptions explicitly cross-reference each other and even tell the agent not to re-post when a reply says possiblyCharged, eliminating the main confusion risk.

Naming Consistency5/5

Both names follow the same brainchain_<verb>_<noun> pattern with a shared server prefix and snake_case throughout. No deviation or ambiguity in the convention.

Tool Count3/5

Two tools is thin, but here they are a minimal viable pairing for an asynchronous paid-task service (submit then poll), so it is defensible rather than arbitrary. Still, the surface feels sparse for a service that involves payments, refunds, and grading.

Completeness3/5

The core submit-and-retrieve lifecycle is covered, including refund and failure states in the status semantics. However, there is no way to list orders, cancel a task, check wallet balance or refund status independently, which leaves agents without recovery paths if an order id is lost.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents to route tasks requiring human judgment (e.g., content moderation, refund decisions, data verification) to a vetted worker pool, with verified results returned via Lightning Network payments.
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI agents to post tasks with JSON-schema validation and run workers, facilitating agent-to-agent collaboration on the NexusToken network.
    71 PyPI
    1
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    --
    1
    MIT