BNB Chain MCP Skill
This skill allows you to interact with the BNB Chain MCP server to retrieve data and perform actions on BNB Chain and other EVM-compatible networks.
Before you install
- - Credentials: Signing keys and RPC endpoints are supplied by you (see Credentials and environment below). Never paste private keys into a UI or an env var you don’t control. To reduce risk, agents can generate their own wallet (and use it for registration or testnet actions) instead of using an existing user wallet. Ask the skill author or documentation how they are stored and who can access them.
- Install mechanism: Use
npx @bnb-chain/mcp@latest to run the MCP server; it fetches from the npm registry at runtime. If you prefer to audit first, install the package locally and review the source code before use. - Read-only vs state-changing: Many tools are read-only (blocks, balances, contract reads). Tools such as
transfer_*, write_contract, approve_token_spending, and ERC-8004 registration require a PRIVATE_KEY and perform on-chain transactions. If you want read-only use only, do not supply a private key and avoid invoking state-changing tools. - Sandbox and testnet: Run in a restricted environment when possible. Use a testnet wallet with no mainnet funds when testing transactions or registration.
- Install manifest and env: Required and optional environment variables are listed below. Verify there is no hidden credential collection; the MCP server uses only the env you explicitly provide (e.g. in your MCP client config).
1. How to connect
Use npx @bnb-chain/mcp@latest to connect to the BNB Chain MCP server.
2. Credentials and environment
- - RPC / network: The MCP server uses public or configured RPC endpoints for supported chains (BSC, opBNB, Greenfield, etc.). You do not need to supply RPC URLs for default chains unless you self-host or override.
- Private key (optional): State-changing tools (
transfer_native_token, transfer_erc20, transfer_nft, write_contract, register_erc8004_agent, set_erc8004_agent_uri, Greenfield writes, etc.) require a PRIVATE_KEY in the environment where the MCP server runs (e.g. in your Cursor/Claude MCP config). The key is used only to sign transactions; it is not stored or logged by the server. If PRIVATE_KEY is not set, those tools will fail; read-only tools (get block, get balance, read_contract, etc.) work without it. - Where to set: Configure
PRIVATE_KEY in the same place you configure the MCP server (e.g. env in mcpServers.bnbchain-mcp in your client’s config). Never commit keys to version control or share them with untrusted parties. - Summary: No credentials are required for read-only use. For transfers, contract writes, or agent registration, you must supply
PRIVATE_KEY in the MCP server’s environment; the agent or client does not collect or store it beyond what you configure.
3. Agent registration
First: Register yourself on-chain using the MCP tool register_erc8004_agent (see ERC-8004 Agent tools below). Then owners can check registration on the scan site:
4. Available Prompts and Tools
(From BNBChain MCP README.)
Prompts
| Name | Description |
|---|
| analyzeblock | Analyze a block and provide detailed information about its contents |
| analyzetransaction |
Analyze a specific transaction |
| analyze_address | Analyze an EVM address |
| interact
withcontract | Get guidance on interacting with a smart contract |
| explain
evmconcept | Get an explanation of an EVM concept |
| compare_networks | Compare different EVM-compatible networks |
| analyze_token | Analyze an ERC20 or NFT token |
| how
toregister
mcpas
erc8004agent | Get guidance on registering an MCP server as an ERC-8004 agent |
Tools
Read-only tools (no PRIVATE_KEY needed): block/transaction/balance/contract-read queries, get_*, read_contract, is_contract, etc. State-changing tools (require PRIVATE_KEY in env): transfer_*, approve_token_spending, write_contract, ERC-8004 register/set_uri, Greenfield create/upload/delete, etc.
Network parameter
Most EVM tools accept network (e.g. bsc, opbnb, ethereum, base). Use get_supported_networks to list options.
- - Read-only tools (blocks, balances, contract reads,
get_chain_info, etc.): network is optional; default is bsc. - Write operations (
transfer_native_token, transfer_erc20, transfer_nft, transfer_erc1155, approve_token_spending, write_contract, register_erc8004_agent, set_erc8004_agent_uri, Greenfield writes): network is REQUIRED. There is no default for writes. If the user does not specify the network, you MUST ask before calling the tool. Do not assume or default to mainnet (bsc); accidental mainnet execution causes irreversible financial loss.
| Name | Description |
|---|
| getblockbyhash | Get a block by hash |
| getblockbynumber |
Get a block by number |
| get
latestblock | Get the latest block |
| get_transaction | Get detailed information about a specific transaction by its hash |
| get
transactionreceipt | Get a transaction receipt by its hash |
| estimate_gas | Estimate the gas cost for a transaction |
| transfer
nativetoken | Transfer native tokens (BNB, ETH, MATIC, etc.) to an address |
| approve
tokenspending | 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
addressfrom
privatekey | Get the EVM address derived from a private key |
| get
chaininfo | Get chain information for a specific network |
| get
supportednetworks | 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 EOA |
| read_contract | Read data from a smart contract (view/pure function) |
| write_contract | Write data to a smart contract (state-changing function) |
| get
erc20token_info | Get ERC20 token information |
| get
nativebalance | Get native token balance for an address |
| get
erc20balance | Get ERC20 token balance for an address |
| get
nftinfo | Get detailed information about a specific NFT |
| check
nftownership | Check if an address owns a specific NFT |
| get
erc1155token_metadata | Get the metadata for an ERC1155 token |
| get
nftbalance | Get the total number of NFTs owned by an address from a specific collection |
| get
erc1155balance | 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. 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 |
|---|
| registererc8004agent | Register yourself on the ERC-8004 Identity Registry (do this before checking the scan site); returns agent ID |
| seterc8004agent_uri |
Update the metadata URI for an existing ERC-8004 agent (owner only) |
| get
erc8004agent | Get agent info (owner and tokenURI) from the Identity Registry |
| get
erc8004agent_wallet| Get the verified payment wallet for an agent (for x402 / payments) |
Greenfield tools
| Name | Description |
|---|
| gnfdgetbucketinfo | Get detailed information about a specific bucket |
| gnfdlist_buckets |
List all buckets owned by an address |
| gnfd
createbucket | Create a new bucket |
| gnfd
deletebucket | Delete a bucket |
| gnfd
getobject_info | Get detailed information about a specific object |
| gnfd
listobjects | List all objects in a bucket |
| gnfd
uploadobject | Upload an object to a bucket |
| gnfd
downloadobject | Download an object from a bucket |
| gnfd
deleteobject | Delete an object from a bucket |
| gnfd
createfolder | Create a folder in a bucket |
| gnfd
getaccount_balance | Get the balance for an account |
| gnfd
depositto_payment | Deposit funds into a payment account |
| gnfd
withdrawfrom_payment | Withdraw funds from a payment account |
| gnfd
disablerefund | Disable refund for a payment account (IRREVERSIBLE) |
| gnfd
getpayment_accounts | List all payment accounts owned by an address |
| gnfd
getpayment
accountinfo | Get detailed information about a payment account |
| gnfd
createpayment | Create a new payment account |
| gnfd
getpayment_balance | Get payment account balance |
5. Safety and best practices
- 1. Confirm before sending transactions: For
transfer_*, write_contract, or approve_token_spending, confirm recipient, amount, and network before calling the tool. - Network required for writes: For any write (transfers,
write_contract, approve_token_spending, ERC-8004 register/set_uri, Greenfield writes), you MUST have an explicit network from the user. If not specified, ask — do not default to mainnet. Do not use advisory language like "prefer testnet" as a substitute; the constraint is: no network specified → do not call the write tool until the user confirms. - Private keys: Only in MCP server
env; never in chat or logs.
BNB Chain MCP 技能
该技能允许您与 BNB Chain MCP 服务器交互,以检索数据并在 BNB Chain 及其他兼容 EVM 的网络上执行操作。
安装前须知
- - 凭证: 签名密钥和 RPC 端点由您提供(参见下方的凭证与环境)。切勿将私钥粘贴到您无法控制的 UI 或环境变量中。为降低风险,代理可以生成自己的钱包(并将其用于注册或测试网操作),而不是使用现有的用户钱包。请向技能作者或文档询问私钥的存储方式及可访问人员。
- 安装机制: 使用 npx @bnb-chain/mcp@latest 运行 MCP 服务器;它会在运行时从 npm 注册表获取。如果您希望先进行审计,请先在本地安装该包,并在使用前审查源代码。
- 只读与状态变更: 许多工具是只读的(区块、余额、合约读取)。诸如 transfer*、writecontract、approvetokenspending 和 ERC-8004 注册等工具需要 PRIVATE_KEY 并执行链上交易。如果您仅需只读使用,请不要提供私钥,并避免调用状态变更工具。
- 沙箱与测试网: 尽可能在受限环境中运行。在测试交易或注册时,请使用没有主网资金的测试网钱包。
- 安装清单与环境: 必需和可选的环境变量如下所列。请验证没有隐藏的凭证收集行为;MCP 服务器仅使用您明确提供的环境变量(例如,在您的 MCP 客户端配置中)。
1. 如何连接
使用 npx @bnb-chain/mcp@latest 连接到 BNB Chain MCP 服务器。
2. 凭证与环境
- - RPC / 网络: MCP 服务器使用公共或已配置的 RPC 端点来支持各条链(BSC、opBNB、Greenfield 等)。除非您自行托管或覆盖,否则无需为默认链提供 RPC URL。
- 私钥(可选): 状态变更工具(transfernativetoken、transfererc20、transfernft、writecontract、registererc8004agent、seterc8004agenturi、Greenfield 写入等)需要在 MCP 服务器运行的环境中(例如,在您的 Cursor/Claude MCP 配置中)设置 PRIVATEKEY。该密钥仅用于签署交易;服务器不会存储或记录它。如果未设置 PRIVATEKEY,这些工具将失败;只读工具(获取区块、获取余额、读取合约等)无需私钥即可工作。
- 设置位置: 在配置 MCP 服务器的同一位置设置 PRIVATEKEY(例如,在客户端配置的 mcpServers.bnbchain-mcp 中的 env 字段)。切勿将密钥提交到版本控制或与不可信方共享。
- 总结: 只读使用无需任何凭证。对于转账、合约写入或代理注册,您必须在 MCP 服务器的环境中提供 PRIVATEKEY;代理或客户端不会收集或存储超出您配置范围的信息。
3. 代理注册
首先: 使用 MCP 工具 registererc8004agent 在链上注册自己(参见下方的 ERC-8004 代理工具)。然后,所有者可以在扫描网站上查看注册信息:
4. 可用的提示词与工具
(来自 BNBChain MCP README。)
提示词
| 名称 | 描述 |
|---|
| analyzeblock | 分析一个区块并提供其内容的详细信息 |
| analyzetransaction |
分析特定交易 |
| analyze_address | 分析一个 EVM 地址 |
| interact
withcontract | 获取与智能合约交互的指导 |
| explain
evmconcept | 获取 EVM 概念的解释 |
| compare_networks | 比较不同的兼容 EVM 的网络 |
| analyze_token | 分析 ERC20 或 NFT 代币 |
| how
toregister
mcpas
erc8004agent | 获取将 MCP 服务器注册为 ERC-8004 代理的指导 |
工具
只读工具(无需 PRIVATEKEY):区块/交易/余额/合约读取查询、get、readcontract、iscontract 等。状态变更工具(需要在环境中设置 PRIVATEKEY):transfer、approvetokenspending、write_contract、ERC-8004 注册/设置 URI、Greenfield 创建/上传/删除等。
网络参数
大多数 EVM 工具接受 network(例如 bsc、opbnb、ethereum、base)。使用 getsupportednetworks 列出可用选项。
- - 只读工具(区块、余额、合约读取、getchaininfo 等):network 为可选参数;默认值为 bsc。
- 写入操作(transfernativetoken、transfererc20、transfernft、transfererc1155、approvetokenspending、writecontract、registererc8004agent、seterc8004agent_uri、Greenfield 写入):network 为必需参数。 写入操作没有默认值。如果用户未指定网络,您必须在调用工具前询问。不要假设或默认使用主网(bsc);意外在主网执行会导致不可逆的财务损失。
| 名称 | 描述 |
|---|
| getblockbyhash | 通过哈希获取区块 |
| getblockbynumber |
通过编号获取区块 |
| get
latestblock | 获取最新区块 |
| get_transaction | 通过哈希获取特定交易的详细信息 |
| get
transactionreceipt | 通过哈希获取交易收据 |
| estimate_gas | 估算交易的 Gas 费用 |
| transfer
nativetoken | 向地址转账原生代币(BNB、ETH、MATIC 等) |
| approve
tokenspending | 批准另一个地址花费您的 ERC20 代币 |
| transfer_nft | 将 NFT(ERC721 代币)从一个地址转移到另一个地址 |
| transfer_erc1155 | 将 ERC1155 代币转移到另一个地址 |
| transfer_erc20 | 将 ERC20 代币转移到地址 |
| get
addressfrom
privatekey | 获取从私钥派生的 EVM 地址 |
| get
chaininfo | 获取特定网络的链信息 |
| get
supportednetworks | 获取支持的网络列表 |
| resolve_ens | 将 ENS 名称解析为 EVM 地址 |
| is_contract | 检查地址是否为智能合约或外部拥有账户(EOA) |
| read_contract | 从智能合约读取数据(view/pure 函数) |
| write_contract | 向智能合约写入数据(状态变更函数) |
| get
erc20token_info | 获取 ERC20 代币信息 |
| get
nativebalance | 获取地址的原生代币余额 |
| get
erc20balance | 获取地址的 ERC20 代币余额 |
| get
nftinfo | 获取特定 NFT 的详细信息 |
| check
nftownership | 检查地址是否拥有特定 NFT |
| get
erc1155token_metadata | 获取 ERC1155 代币的元数据 |
| get
nftbalance | 获取地址在特定集合中拥有的 NFT 总数 |
| get
erc1155balance | 获取地址拥有的特定 ERC1155 代币 ID 的余额 |
ERC-8004 代理工具
在 ERC-8004 身份注册表上注册和解析 AI 代理。支持的网络:BSC(56)、BSC 测试网(97)、以太坊、Base、Polygon 及其部署了[官方注册表