Add TBNB Faucet MCP Server (Streamable HTTP)#194
Open
zzuguofa wants to merge 1 commit intobnb-chain:mainfrom
Open
Add TBNB Faucet MCP Server (Streamable HTTP)#194zzuguofa wants to merge 1 commit intobnb-chain:mainfrom
zzuguofa wants to merge 1 commit intobnb-chain:mainfrom
Conversation
|
Congratulations! You have received a Cookbook reward. Please reply with your BSC wallet address.Thanks |
Author
|
0xCf4376AAf65854d8c32355C599A31DDA8Deed7cc Glad to be of assistance. |
|
0x2160010d8d64bb44E347404C3C2AD488C4F0fcC4
…On Tue, Jan 27, 2026, 2:39 PM zzuguofa ***@***.***> wrote:
*zzuguofa* left a comment (bnb-chain/example-hub#194)
<#194 (comment)>
0xCf4376AAf65854d8c32355C599A31DDA8Deed7cc
Glad to be of assistance.
—
Reply to this email directly, view it on GitHub
<#194 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BVX4NJ36IMG2L35ZR2355QT4I4BYVAVCNFSM6AAAAACSXTUUPOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTQMBTGM4DMNJYGU>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
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.
Description
Summary
Adds a TBNB Faucet MCP Server: a server-side Model Context Protocol (MCP) server that disburses testnet BNB (TBNB) on BSC testnet. It runs as a public HTTP service, uses Streamable HTTP transport, and exposes a single
disburse_tbnbtool. Any MCP-capable agent can connect via URL (e.g.http://host:8000/mcp) to request TBNB.What’s included
disburse_tbnb— send TBNB to a BSC testnet address (default 0.1, max 1.0 TBNB).0.0.0.0:8000).ExtraDataToPOAMiddleware).FAUCET_WALLET_PRIVATE_KEY,BSC_TESTNET_RPC_URL,SERVER_HOST,SERVER_PORT.How users can connect their agents
Mermaid diagrams below show how agents integrate with the TBNB Faucet MCP Server.
1. Public HTTP faucet – multiple agents via URL
The server runs as an HTTP service. Any agent with the URL connects over Streamable HTTP; no local server process.
flowchart TB subgraph "Faucet operator" Server["TBNB Faucet MCP Server<br/>Streamable HTTP :8000/mcp"] end subgraph "Agent A" AgentA["AI Agent A"] ClientA["MCP Client<br/>url: http://host:8000/mcp"] end subgraph "Agent B" AgentB["AI Agent B"] ClientB["MCP Client<br/>url: http://host:8000/mcp"] end BSC[(BSC Testnet RPC)] AgentA -->|"tools"| ClientA AgentB -->|"tools"| ClientB ClientA -->|"HTTP / MCP"| Server ClientB -->|"HTTP / MCP"| Server Server -->|"Web3"| BSC style Server fill:#e8f5e9 style AgentA fill:#f3e5f5 style AgentB fill:#f3e5f52. End-to-end flow: agent requests TBNB
Sequence from user request to on-chain disbursement.
sequenceDiagram participant User participant Agent participant MCP as MCP Client participant Faucet as TBNB Faucet MCP Server participant BSC as BSC Testnet User->>Agent: "Send 0.1 TBNB to 0x..." Agent->>MCP: list_tools() MCP->>Faucet: GET/POST /mcp (MCP protocol) Faucet-->>MCP: [disburse_tbnb] MCP-->>Agent: tools Agent->>MCP: call_tool("disburse_tbnb", {recipient_address, amount}) MCP->>Faucet: POST /mcp (MCP call_tool) Faucet->>BSC: Sign & send transaction BSC-->>Faucet: Transaction receipt Faucet-->>MCP: {success, transaction_hash, explorer_url, ...} MCP-->>Agent: result Agent-->>User: "Sent 0.1 TBNB. Tx: 0x..."3. Connection options for agents
Ways to connect an agent to the TBNB Faucet MCP Server.
flowchart LR Faucet["TBNB Faucet MCP Server<br/>Streamable HTTP"] Faucet --> C1["Claude Desktop<br/>mcpServers.url"] Faucet --> C2["Cursor<br/>MCP url config"] Faucet --> C3["MCP Inspector<br/>Connect to URL"] Faucet --> C4["Python MCP client<br/>sse_client(url)"] Faucet --> C5["Custom MCP client<br/>Streamable HTTP"] style Faucet fill:#e8f5e94. Architecture overview
flowchart TB subgraph "Users' machines" A1["Agent (e.g. Claude, Cursor)"] A2["MCP Client"] end subgraph "Your infrastructure" S["TBNB Faucet MCP Server<br/>FastMCP + Streamable HTTP"] end BSC[(BSC Testnet)] A1 -->|"use tools"| A2 A2 -->|"HTTP / MCP<br/>http://host:8000/mcp"| S S -->|"Web3"| BSC style S fill:#e8f5e9Configuration
FAUCET_WALLET_PRIVATE_KEYBSC_TESTNET_RPC_URLhttps://data-seed-prebsc-1-s1.binance.org:8545/SERVER_HOST0.0.0.0SERVER_PORT8000MCP endpoint:
http://<host>:<port>/mcpRunning
Server listens on
http://0.0.0.0:8000; MCP athttp://localhost:8000/mcp.Testing
All tests use mocked Web3 and run offline.
Type of change
How has this been tested?
pytest test_tbnb_faucet_server.py -v(all pass).http://localhost:8000/mcp.disburse_tbnbbehavior.Checklist