BSC MCP Server
A Model Context Protocol (MCP) server for interacting with the Binance Smart Chain (BSC) network. This server enables LLMs to access blockchain data and perform queries on the BSC network.
Features
- Get current block number
- Retrieve block details by number or hash
- Fetch transaction details
- Get transaction receipts
- Check wallet BNB balance
- Check BEP-20 token balances
- Create Four.meme tokens on BSC
Prerequisites
- Node.js (v16 or higher)
- npm or yarn
Installation
Usage
Configuration
By default, the server connects to the BSC mainnet. You can customize the RPC URL and set the private key (required for token creation) using environment variables:
Running the STDIO Server
The STDIO server is designed to be integrated with LLM clients that support the MCP protocol:
Running the HTTP/SSE Server
The HTTP/SSE server allows connections over HTTP using Server-Sent Events:
By default, the server runs on port 3000. You can customize the port using the PORT
environment variable.
Client Examples
Several client implementations are provided to demonstrate how to use the BSC MCP server:
API Endpoints (HTTP Server)
The HTTP server exposes the following endpoints:
Endpoint | Method | Description |
---|---|---|
/ | GET | Server status check |
/mcp/hello | POST | Get server information and available tools |
/mcp/tools/:toolName | POST | Call a specific tool with arguments |
/mcp/sse | GET | Server-Sent Events (SSE) endpoint for streaming connections |
MCP Tools
This server exposes the following MCP tools:
Tool Name | Parameters | Description |
---|---|---|
get-block-number | None | Returns the current BSC block number |
get-block | blockHashOrNumber : string or number | Returns block details for the given block hash or number |
get-transaction | txHash : string | Returns transaction details for the given transaction hash |
get-transaction-receipt | txHash : string | Returns transaction receipt for the given transaction hash |
get-balance | address : string | Returns BNB balance for the given wallet address |
get-token-balance | tokenAddress : string, walletAddress : string | Returns BEP-20 token balance for the given token and wallet address |
create-four-meme-token | name : string, symbol : string, initialSupply : number, decimals : number, ownerAddress : string | Creates a new Four.meme token with specified parameters |
Creating Four.meme Tokens
The BSC MCP server includes functionality to create new Four.meme tokens on the Binance Smart Chain. This allows users to easily deploy custom meme tokens with the following parameters:
name
: The full name of the token (e.g., "Four Meme Token")symbol
: The token symbol (e.g., "4MEME")initialSupply
: The initial token supply to mintdecimals
: The number of decimal places for the token (typically 18)ownerAddress
: The BSC address that will receive the initial token supply
Example using HTTP Client
Integration with MCP.so
To properly display this service on mcp.so, please ensure that your repository contains the following:
- A well-documented README.md (this file)
- Code examples demonstrating how to use the tools
- Clearly defined tool specifications
Development
Project Structure
Building the Project
License
ISC
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Troubleshooting
Token Creation Issues
- Ensure the
BSC_PRIVATE_KEY
environment variable is set correctly - Verify you have enough BNB to cover the gas fees for token deployment
- Check that the owner address is a valid BSC address
Connection Issues
- Verify the RPC URL is correct and accessible
- Check network connectivity
- Ensure the server is running on the expected port
Support
For any questions or support, please open an issue on the GitHub repository.
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
模型上下文协议服务器,使 LLM 能够访问币安智能链数据、执行区块链查询并创建 Four.meme 代币。
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol server that gives LLMs the ability to interact with Ethereum networks, manage wallets, query blockchain data, and execute smart contract operations through a standardized interface.Last updated -45138MIT License
- -securityAlicense-qualityA Model Context Protocol server that enables LLMs to interact with databases (currently MongoDB) through natural language, supporting operations like querying, inserting, deleting documents, and running aggregation pipelines.Last updated -MIT License
- -securityAlicense-qualityA Model Context Protocol server that exposes Binance cryptocurrency exchange data to LLMs, allowing agents to access real-time prices, order books, and historical market data without requiring API keys.Last updated -12MIT License
- -securityAlicense-qualityA Python implementation of the Model Context Protocol that allows applications to provide standardized context for LLMs, enabling creation of servers that expose data and functionality to LLM applications through resources, tools, and prompts.Last updated -MIT License