AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
MCP verified MIT Self-run

Bnbchain Mcp

mcp-bnb-chain-bnbchain-mcp · by bnb-chain

A MCP server for BNB Chain that supports BSC, opBNB, Greenfield, and other popular EVM-compatible networks.

No reviews yet
0 installs
1 views
0.0% view→install

Install

$ agentstack add mcp-bnb-chain-bnbchain-mcp

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets Used
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/mcp-bnb-chain-bnbchain-mcp)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
3mo ago

Declared compatibility

Claude CodeClaude DesktopCursorWindsurf

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Bnbchain Mcp? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

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_transfer tool with that confirmToken and your privateKey. The token expires after 5 minutes.
  • Skipping confirmation (per call): Pass skipConfirmation: true in 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=true so 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:

  1. Call transfer_native_token with toAddress, amount, network (and optionally privateKey). Do not set skipConfirmation.
  2. The server returns { preview: { toAddress, amount, network }, confirmToken: "...", message: "..." }.
  3. Review the preview, then call confirm_transfer with confirmToken and privateKey to execute the transfer.

Integration with Cursor

To connect to the MCP server from Cursor:

  1. Open Cursor and go to Settings (gear icon in the top right)
  2. Click on "MCP" in the left sidebar
  3. Click "Add new global MCP server"
  4. 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.
  • BNBCHAINMCPSKIPTRANSFERCONFIRMATION: 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:

  1. Open Claude Desktop and go to Settings
  2. Click on "Developer" in the left sidebar
  3. Click the "Edit Config" Button
  4. Add the following configuration to the claude_desktop_config.json file:
{
  "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.

  1. 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](./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

  1. Clone the repository:
git clone https://github.com/bnb-chain/bnbchain-mcp.git
cd bnbchain-mcp
  1. 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)
  1. 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 reload
  • bun build: Build the project
  • bun test: Run test suite

Available Prompts and Tools

Prompts

| Name | Description | | ---------------------- | ------------------------------------------------------------------- | | analyzeblock | Analyze a block and provide detailed information about its contents | | analyzetransaction | Analyze a specific transaction | | analyzeaddress | Analyze an EVM address | | interactwithcontract | Get guidance on interacting with a smart contract | | explainevmconcept | Get an explanation of an EVM concept | | comparenetworks | Compare different EVM-compatible networks | | analyzetoken | Analyze an ERC20 or NFT token | | howtoregistermcpaserc8004_agent | Get guidance on registering an MCP server as an ERC-8004 agent |

Tools

| Name | Description | | ---------------------------- | ---------------------------------------------------------------------------- | | getblockbyhash | Get a block by hash | | getblockbynumber | Get a block by number | | getlatestblock | Get the latest block | | gettransaction | Get detailed information about a specific transaction by its hash | | gettransactionreceipt | Get a transaction receipt by its hash | | estimategas | Estimate the gas cost for a transaction | | transfernativetoken | Transfer native tokens (BNB, ETH, MATIC, etc.) to an address | | approvetokenspending | Approve another address to spend your ERC20 tokens | | transfernft | Transfer an NFT (ERC721 token) from one address to another | | transfererc1155 | Transfer ERC1155 tokens to another address | | transfererc20 | Transfer ERC20 tokens to an address | | getaddressfromprivatekey | Get the EVM address derived from a private key | | getchaininfo | Get chain information for a specific network | | getsupportednetworks | Get list of supported networks | | resolveens | Resolve an ENS name to an EVM address | | iscontract | Check if an address is a smart contract or an externally owned account (EOA) | | readcontract | Read data from a smart contract by calling a view/pure function | | writecontract | Write data to a smart contract by calling a state-changing function | | geterc20tokeninfo | Get ERC20 token information | | getnativebalance | Get native token balance for an address | | geterc20balance | Get ERC20 token balance for an address | | getnftinfo | Get detailed information about a specific NFT | | checknftownership | Check if an address owns a specific NFT | | geterc1155tokenmetadata | Get the metadata for an ERC1155 token | | getnftbalance | Get the total number of NFTs owned by an address from a specific collection | | geterc1155_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 | | ----------------------- | --------------------------------------------------------------------------- | | registererc8004agent | Register an agent on the ERC-8004 Identity Registry; returns agent ID | | seterc8004agenturi | Update the metadata URI for an existing ERC-8004 agent (owner only) | | geterc8004agent | Get agent info (owner and tokenURI) from the Identity Registry | | geterc8004agentwallet| Get the verified payment wallet for an agent (for x402 / payments) |

Greenfield tools

| Name | Description | | ----------------------------- | --------------------------------------------------- | | gnfdgetbucketinfo | Get detailed information about a specific bucket | | gnfdlistbuckets | List all buckets owned by an address | | gnfdcreatebucket | Create a new bucket | | gnfddeletebucket | Delete a bucket | | gnfdgetobjectinfo | Get detailed information about a specific object | | gnfdlistobjects | List all objects in a bucket | | gnfduploadobject | Upload an object to a bucket | | gnfddownloadobject | Download an object from a bucket | | gnfddeleteobject | Delete an object from a bucket | | gnfdcreatefolder | Create a folder in a bucket | | gnfdgetaccountbalance | Get the balance for an account | | gnfddeposittopayment | Deposit funds into a payment account | | gnfdwithdrawfrompayment | Withdraw funds from a payment account | | gnfddisablerefund | Disable refund for a payment account (IRREVERSIBLE) | | gnfdgetpaymentaccounts | List all payment accounts owned by an address | | gnfdgetpaymentaccountinfo | Get detailed information about a payment account | | gnfdcreatepayment | Create a new payment account | | gnfdgetpayment_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](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.

Contributing

We welcome contributions to BNBChain MCP! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to your branch
  5. Create a Pull Request

Please ensure your code follows our coding standards and includes appropriate tests.

License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

References and Acknowledgments

This project is built upon and inspired by the following open-source projects:

We extend our gratitude to the original authors for their contributions to th

Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.