Interact with BNBChain and EVM Networks
Interact with BNB Chain and other EVM networks from an AI assistant: query blocks, transfer tokens/NFTs, and manage Greenfield storage.
Maintainer of this project? Claim this page to edit the listing.
1.5.1Add to Favorites
Why it matters
Seamlessly interact with BNB Chain and other EVM-compatible networks using AI interfaces. This asset provides comprehensive tools for blockchain development and smart contract interaction.
Outcomes
What it gets done
Query and manage blockchain blocks and transactions.
Perform ERC20, ERC721, and ERC1155 token operations, including transfers.
Manage Greenfield files and buckets.
Estimate gas, transfer native tokens, and resolve ENS names.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-bnbchain-mcp | bash Capabilities
Tools your agent gets
Get a block by hash
Get a block by number
Get the latest block
Get detailed information about a specific transaction by its hash
Get a transaction receipt by its hash
Estimate gas cost for a transaction
Transfer native tokens (BNB, ETH, MATIC, etc.) to an address
Allow another address to spend your ERC20 tokens
Overview
BNBChain MCP Server
An MCP server for BNB Chain and EVM-compatible networks, covering block/transaction queries, token and NFT transfers, ENS resolution, and Greenfield file/bucket management. Reach for this when an AI assistant needs to query or transact on BNB Chain or other EVM networks - supply a private key only for wallets meant to actively transact.
What it does
This MCP server gives an AI assistant blockchain development tools and smart contract interaction across BNB Chain and other EVM-compatible networks (BSC, opBNB, Greenfield, Ethereum, and others). It covers blocks and transactions (get_block_by_hash, get_block_by_number, get_latest_block, get_transaction, get_transaction_receipt, estimate_gas), token/NFT transfers (transfer_native_token, approve_token_spending, transfer_nft for ERC721, transfer_erc1155, transfer_erc20), wallet and network utilities (get_address_from_private_key, get_chain_info, get_supported_networks, resolve_ens), Greenfield file/bucket management, and ERC-8004 on-chain AI agent identity registration and resolution.
Transfer and payment tools use a preview-then-confirm flow by default: calling a transfer tool returns a preview (recipient, amount, network) and a short-lived confirmToken without moving any funds; executing requires a separate call to confirm_transfer with that token and a private key, and the token expires after 5 minutes. This can be bypassed per call with skipConfirmation: true, or server-wide by setting BNBCHAIN_MCP_SKIP_TRANSFER_CONFIRMATION=true for headless/scripted environments.
When to use - and when NOT to
Use this when you want an AI assistant to query blockchain data (blocks, transactions, gas estimates), execute token/NFT transfers on BNB Chain, opBNB, Greenfield, or other EVM-compatible networks, look up ENS-resolved addresses, manage Greenfield buckets and objects, or register/resolve an ERC-8004 on-chain agent identity.
Do NOT deploy this server on the public internet without adding an authentication layer first - the SSE endpoint has no built-in authentication, and there is no centralized service custodying private keys or funds, so anyone who can reach an unauthenticated deployment can use it. Prefer setting PRIVATE_KEY in the server environment rather than passing it in tool parameters, since parameters can end up in conversation history or logs.
Capabilities
- Blocks/transactions:
get_block_by_hash,get_block_by_number,get_latest_block,get_transaction,get_transaction_receipt,estimate_gas. - Transfers:
transfer_native_token,approve_token_spending,transfer_nft,transfer_erc1155,transfer_erc20, gated by the preview/confirm flow above. - Wallet/network:
get_address_from_private_key,get_chain_info,get_supported_networks,resolve_ens,is_contract,read_contract,write_contract. - Balances/info:
get_native_balance,get_erc20_balance,get_erc20_token_info,get_nft_info,check_nft_ownership,get_nft_balance. - Greenfield:
gnfd_list_buckets,gnfd_create_bucket,gnfd_upload_object,gnfd_download_object,gnfd_get_account_balance,gnfd_deposit_to_payment,gnfd_withdraw_from_payment, and related bucket/object/payment-account tools. - ERC-8004 agents:
register_erc8004_agent,set_erc8004_agent_uri,get_erc8004_agent,get_erc8004_agent_wallet- supported on BSC, BSC Testnet, Ethereum, Base, Polygon, and their testnets.
How to install
Configure Cursor or Claude Desktop:
{
"mcpServers": {
"bnbchain-mcp": {
"command": "npx",
"args": ["-y", "@bnb-chain/mcp@latest"],
"env": {
"PRIVATE_KEY": "your_private_key_here. (optional)",
"BNBCHAIN_MCP_SKIP_TRANSFER_CONFIRMATION": "false"
}
}
}
}
For SSE mode, add "--sse" to args. PRIVATE_KEY is optional but required for any transaction operation; BNBCHAIN_MCP_SKIP_TRANSFER_CONFIRMATION defaults to false (preview-then-confirm) and can be set true to execute transfers immediately. Local development requires bun v1.2.10+ and Node.js v17+, and ships an @modelcontextprotocol/inspector-based test UI via bun run test.
Who it's for
Web3 developers who want an AI assistant to query blockchain state and execute token/NFT transfers or Greenfield file operations across BNB Chain and other EVM networks, with a built-in confirmation step to guard against unintended fund movement.
Source README
BNBChain MCP (Model Context Protocol)
A powerful toolkit for interacting with BNB Chain and other EVM-compatible networks through natural language processing and AI assistance.
Description
BNBChain MCP is a Model Context Protocol implementation that enables seamless interaction with blockchain networks through AI-powered interfaces. It provides a comprehensive set of tools and resources for blockchain development, smart contract interaction, and network management.
Core Modules
The project is organized into several core modules:
- Blocks: Query and manage blockchain blocks
- Contracts: Interact with smart contracts
- Network: Network information and management
- NFT: NFT (ERC721/ERC1155) operations
- Tokens: Token (ERC20) operations
- Transactions: Transaction management
- Wallet: Wallet operations and management
- Common: Shared utilities and types
- Greenfield: Support file management operations on Greenfield network including, uploading, downloading, and managing files and buckets
- Additional features coming soon (Greenfield, Swap, Bridge, etc.)
- Agents (ERC-8004): Register and resolve on-chain AI agent identities (ERC-8004 Trustless Agents) on BSC and BSC Testnet
Important Notes
We do not recommend deploying this MCP Server on the public internet. (1) The SSE endpoint has no authentication-anyone who can reach it can use the server. (2) There is no centralized service that custodies private keys or funds; keys and signing are the responsibility of the client. If you still need to deploy it publicly, add an authentication layer in front (e.g. API keys, JWT, or a reverse proxy with auth), or deploy a keyless version that only exposes read-only or non-sensitive tools.
Credentials: Prefer setting PRIVATE_KEY in the MCP server environment. Do not pass the private key in tool parameters when avoidable, as it may be stored in conversation history, client logs, or request logs and lead to exposure.
Transfer and payment confirmation
Transfer and payment tools (e.g. transfer_native_token, transfer_erc20, approve_token_spending, transfer_nft, transfer_erc1155, gnfd_deposit_to_payment, gnfd_withdraw_from_payment, gnfd_create_payment_account) use a preview-then-confirm flow by default so that no funds move until the user explicitly confirms.
- Default behavior: Calling a transfer or payment tool returns a preview (recipient, amount, network, etc.) and a short-lived confirmToken. No transaction is sent. To execute, call the
confirm_transfertool with thatconfirmTokenand yourprivateKey. The token expires after 5 minutes. - Skipping confirmation (per call): Pass
skipConfirmation: truein the tool arguments when the caller has already confirmed or when running in an automated script. The tool will then execute immediately and return the transaction result. - Skipping confirmation (server-wide): Set the environment variable
BNBCHAIN_MCP_SKIP_TRANSFER_CONFIRMATION=trueso that all transfer/payment tools execute immediately without returning a preview. Use this for headless or scripted environments where you do not need a confirmation step.
Example flow with confirmation:
- Call
transfer_native_tokenwithtoAddress,amount,network(and optionallyprivateKey). Do not setskipConfirmation. - The server returns
{ preview: { toAddress, amount, network }, confirmToken: "...", message: "..." }. - Review the preview, then call
confirm_transferwithconfirmTokenandprivateKeyto execute the transfer.
Integration with Cursor
To connect to the MCP server from Cursor:
- Open Cursor and go to Settings (gear icon in the top right)
- Click on "MCP" in the left sidebar
- Click "Add new global MCP server"
- Enter the following details:
Default mode
{
"mcpServers": {
"bnbchain-mcp": {
"command": "npx",
"args": ["-y", "@bnb-chain/mcp@latest"],
"env": {
"PRIVATE_KEY": "your_private_key_here. (optional)",
"BNBCHAIN_MCP_SKIP_TRANSFER_CONFIRMATION": "false"
}
}
}
}
- PRIVATE_KEY: Optional. Prefer setting here instead of passing in tool parameters.
- BNBCHAIN_MCP_SKIP_TRANSFER_CONFIRMATION: Optional. Set to
"true"to make all transfer/payment tools execute immediately (no preview step). Default"false"uses the preview-then-confirm flow.
SSE mode
{
"mcpServers": {
"bnbchain-mcp": {
"command": "npx",
"args": ["-y", "@bnb-chain/mcp@latest", "--sse"],
"env": {
"PRIVATE_KEY": "your_private_key_here. (optional)",
"BNBCHAIN_MCP_SKIP_TRANSFER_CONFIRMATION": "false"
}
}
}
}
Integration with Claude Desktop
To connect to the MCP server from Claude Desktop:
- Open Claude Desktop and go to Settings
- Click on "Developer" in the left sidebar
- Click the "Edit Config" Button
- Add the following configuration to the
claude_desktop_config.jsonfile:
{
"mcpServers": {
"bnbchain-mcp": {
"command": "npx",
"args": ["-y", "@bnb-chain/mcp@latest"],
"env": {
"PRIVATE_KEY": "your_private_key_here",
"BNBCHAIN_MCP_SKIP_TRANSFER_CONFIRMATION": "false"
}
}
}
}
Optional env: BNBCHAIN_MCP_SKIP_TRANSFER_CONFIRMATION=true to execute transfers immediately without preview/confirm.
- Save the file and restart Claude Desktop
Once connected, you can use all the MCP prompts and tools directly in your Claude Desktop conversations. For example:
- "Analyze this address: 0x123..."
- "Explain the EVM concept of gas"
- "Check the latest block on BSC"
Integration with Other Clients
If you want to integrate BNBChain MCP into your own client, please check out the examples directory for more detailed information and reference implementations.
The examples demonstrate:
- How to set up the MCP client
- Authentication and configuration
- Making API calls to interact with blockchain networks
- Handling responses and errors
- Best practices for integration
Local Development
Prerequisites
Quick Start
- Clone the repository:
git clone https://github.com/bnb-chain/bnbchain-mcp.git
cd bnbchain-mcp
- Set up environment variables:
cp .env.example .env
Edit .env file with your configuration:
PRIVATE_KEY: Your wallet private key (required for transaction operations)LOG_LEVEL: Set logging level (DEBUG, INFO, WARN, ERROR)PORT: Server port number (default: 3001)
- Install dependencies and start development server:
# Install project dependencies
bun install
# Start the development server
bun dev:sse
Testing with MCP Clients
Configure the local server in your MCP clients using this template:
{
"mcpServers": {
"bnbchain-mcp": {
"url": "http://localhost:3001/sse",
"env": {
"PRIVATE_KEY": "your_private_key_here"
}
}
}
}
Testing with Web UI
We use @modelcontextprotocol/inspector for testing. Launch the test UI:
bun run test
Available Scripts
bun dev:sse: Start development server with hot reloadbun build: Build the projectbun test: Run test suite
Available Prompts and Tools
Prompts
| Name | Description |
|---|---|
| analyze_block | Analyze a block and provide detailed information about its contents |
| analyze_transaction | Analyze a specific transaction |
| analyze_address | Analyze an EVM address |
| interact_with_contract | Get guidance on interacting with a smart contract |
| explain_evm_concept | Get an explanation of an EVM concept |
| compare_networks | Compare different EVM-compatible networks |
| analyze_token | Analyze an ERC20 or NFT token |
| how_to_register_mcp_as_erc8004_agent | Get guidance on registering an MCP server as an ERC-8004 agent |
Tools
| Name | Description |
|---|---|
| get_block_by_hash | Get a block by hash |
| get_block_by_number | Get a block by number |
| get_latest_block | Get the latest block |
| get_transaction | Get detailed information about a specific transaction by its hash |
| get_transaction_receipt | Get a transaction receipt by its hash |
| estimate_gas | Estimate the gas cost for a transaction |
| transfer_native_token | Transfer native tokens (BNB, ETH, MATIC, etc.) to an address |
| approve_token_spending | Approve another address to spend your ERC20 tokens |
| transfer_nft | Transfer an NFT (ERC721 token) from one address to another |
| transfer_erc1155 | Transfer ERC1155 tokens to another address |
| transfer_erc20 | Transfer ERC20 tokens to an address |
| get_address_from_private_key | Get the EVM address derived from a private key |
| get_chain_info | Get chain information for a specific network |
| get_supported_networks | Get list of supported networks |
| resolve_ens | Resolve an ENS name to an EVM address |
| is_contract | Check if an address is a smart contract or an externally owned account (EOA) |
| read_contract | Read data from a smart contract by calling a view/pure function |
| write_contract | Write data to a smart contract by calling a state-changing function |
| get_erc20_token_info | Get ERC20 token information |
| get_native_balance | Get native token balance for an address |
| get_erc20_balance | Get ERC20 token balance for an address |
| get_nft_info | Get detailed information about a specific NFT |
| check_nft_ownership | Check if an address owns a specific NFT |
| get_erc1155_token_metadata | Get the metadata for an ERC1155 token |
| get_nft_balance | Get the total number of NFTs owned by an address from a specific collection |
| get_erc1155_balance | Get the balance of a specific ERC1155 token ID owned by an address |
ERC-8004 Agent tools
Register and resolve AI agents on the ERC-8004 Identity Registry (Trustless Agents). Supported networks: BSC (56), BSC Testnet (97), Ethereum, Base, Polygon, and their testnets where the official registry is deployed. The agentURI should point to a JSON metadata file following the Agent Metadata Profile (name, description, image, and services such as MCP endpoint).
| Name | Description |
|---|---|
| register_erc8004_agent | Register an agent on the ERC-8004 Identity Registry; returns agent ID |
| set_erc8004_agent_uri | Update the metadata URI for an existing ERC-8004 agent (owner only) |
| get_erc8004_agent | Get agent info (owner and tokenURI) from the Identity Registry |
| get_erc8004_agent_wallet | Get the verified payment wallet for an agent (for x402 / payments) |
Greenfield tools
| Name | Description |
|---|---|
| gnfd_get_bucket_info | Get detailed information about a specific bucket |
| gnfd_list_buckets | List all buckets owned by an address |
| gnfd_create_bucket | Create a new bucket |
| gnfd_delete_bucket | Delete a bucket |
| gnfd_get_object_info | Get detailed information about a specific object |
| gnfd_list_objects | List all objects in a bucket |
| gnfd_upload_object | Upload an object to a bucket |
| gnfd_download_object | Download an object from a bucket |
| gnfd_delete_object | Delete an object from a bucket |
| gnfd_create_folder | Create a folder in a bucket |
| gnfd_get_account_balance | Get the balance for an account |
| gnfd_deposit_to_payment | Deposit funds into a payment account |
| gnfd_withdraw_from_payment | Withdraw funds from a payment account |
| gnfd_disable_refund | Disable refund for a payment account (IRREVERSIBLE) |
| gnfd_get_payment_accounts | List all payment accounts owned by an address |
| gnfd_get_payment_account_info | Get detailed information about a payment account |
| gnfd_create_payment | Create a new payment account |
| gnfd_get_payment_balance | Get payment account balance |
Supported Networks
Supports BSC, opBNB, Greenfield, Ethereum, and other major EVM-compatible networks. For more details, see src/evm/chains.ts.
ERC-8004 agent registration is available on chains where the official registry is deployed: BSC (56), BSC Testnet (97), Ethereum (1), Sepolia (11155111), Base (8453), Base Sepolia (84532), Polygon (137), Polygon Amoy (80002), Arbitrum (42161), Arbitrum Sepolia (421614). Private key is used only to sign the registration or update transaction and is not stored or logged.
References and Acknowledgments
This project is built upon and inspired by the following open-source projects:
- TermiX-official/bsc-mcp - Original BSC MCP implementation
- mcpdotdirect/evm-mcp-server - EVM-compatible MCP server implementation
We extend our gratitude to the original authors for their contributions to the blockchain ecosystem.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.