FourTrader MCP Server

FourTrader MCP Server

Enables AI assistants to trade Four.meme tokens on BNB Smart Chain via the Model Context Protocol, supporting buy/sell operations, real-time data, and wallet management.

Category
访问服务器

README

FourTrader MCP Server - BNB Chain (Four.meme)

MCP (Model Context Protocol) server for trading Four.meme tokens on BNB Smart Chain. Enables AI assistants to interact with Four.meme through a standardized protocol.

🌟 Features

  • Four.meme Trading: Buy and sell tokens on the Four.meme platform
  • Real-time Data: Access prices, trades, and bonding curves via Bitquery API
  • Wallet Management: Check BNB and token balances
  • Claude Integration: Use directly with Claude for Desktop

📋 Prerequisites

  • Node.js (v18+)
  • TypeScript
  • BNB wallet with private key
  • Bitquery API key (for token data)
  • Claude for Desktop (optional, for integration)

🚀 Installation

1. Clone/Create Project

```bash mkdir fourtrader-mcp cd fourtrader-mcp ```

2. Create Structure

``` fourtrader-mcp/ ├── src/ │ ├── server.ts │ ├── providers/ │ │ ├── fourMeme.ts │ │ └── bitqueryApi.ts │ └── utils/ │ ├── config.ts │ └── logger.ts ├── .env ├── package.json ├── tsconfig.json └── mcp-startup.js ```

3. Install Dependencies

```bash npm install ```

4. Configure Environment

Copy `.env.example` to `.env` and fill in:

```env

Server Configuration

SERVER_NAME=fourtrader-mcp SERVER_VERSION=1.0.0

BNB Chain Configuration

WALLET_ADDRESS=0xYourWalletAddress WALLET_PRIVATE_KEY=your_private_key_here BNB_RPC_ENDPOINT=https://bsc-dataseed.binance.org/

Four.meme Configuration

FOURMEME_CONTRACT_ADDRESS=0x5c952063c7fc8610FFDB798152D69F0B9550762b

Bitquery API Configuration

BITQUERY_API_KEY=your_bitquery_key_here BITQUERY_API_ENDPOINT=https://streaming.bitquery.io/graphql ```

⚠️ IMPORTANT:

  • Get Bitquery API key from: https://bitquery.io/
  • Never share your private key!

5. Build Project

```bash npm run build ```

6. Start Server

```bash npm start ```

🔧 Claude Desktop Configuration

To use the server with Claude for Desktop:

1. Find Configuration File

  • macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
  • Windows: `%APPDATA%\Claude\claude_desktop_config.json`

2. Add Server

```json { "mcpServers": { "fourtrader": { "command": "node", "args": [ "/full/path/to/fourtrader-mcp/mcp-startup.js" ], "cwd": "/full/path/to/fourtrader-mcp" } } } ```

Replace `/full/path/to/` with your actual path!

Example paths:

  • macOS: `/Users/username/Desktop/fourtrader-mcp`
  • Windows: `C:\\Users\\username\\Desktop\\fourtrader-mcp`

3. Restart Claude Desktop

Close completely and reopen Claude Desktop.

4. Verify Connection

Open Claude Desktop → Click settings icon (bottom left) → You should see "fourtrader" in the connected servers list.

🛠️ Available Tools

Tool Description Parameters
`get_token_info` Get detailed token information `address` (string)
`get_token_price` Get current token price `address` (string)
`get_recent_tokens` Get recent tokens on Four.meme `limit` (number, optional)
`get_bonding_curve_progress` Get bonding curve progress `address` (string)
`get_latest_trades` Get latest trades for a token `address` (string), `limit` (number)
`buy_token` Buy a token `address`, `bnbAmount`, `slippage`, `gasLimit`
`sell_token` Sell a token `address`, `tokenAmount`, `slippage`, `gasLimit`
`get_bnb_balance` Get wallet BNB balance none
`get_token_balance` Get balance of specific token `address` (string)

💬 Usage Examples with Claude

Once connected, you can ask Claude:

  • "Show me recent tokens on Four.meme"
  • "What's the price of token 0x..."
  • "Buy 0.1 BNB of this token: 0x..."
  • "What's my BNB balance?"
  • "Show me the bonding curve progress for token 0x..."

🧪 Testing with MCP Inspector

To test the server before using with Claude:

```bash npx @modelcontextprotocol/inspector node build/server.js ```

Open http://127.0.0.1:6274 in your browser and test the tools.

📚 Bitquery API

The project uses Bitquery to access Four.meme on-chain data:

  • Documentation: https://docs.bitquery.io/docs/blockchain/BSC/four-meme-api/
  • Dashboard: https://bitquery.io/
  • GraphQL Playground: https://graphql.bitquery.io/

Supported Queries

  • Token metadata
  • Real-time prices
  • Trade history
  • Bonding curve progress
  • Liquidity events
  • Newly created tokens

🔐 Security

⚠️ WARNING:

  1. Private Key: Never share or commit to Git
  2. API Keys: Keep your API keys secure
  3. Testnet: Always test on testnet first (BSC Testnet)
  4. Amounts: Start with small amounts for testing
  5. .env: Add `.env` to `.gitignore`

```bash echo ".env" >> .gitignore ```

🐛 Troubleshooting

Server not connecting to Claude

  1. Verify the path in `claude_desktop_config.json` is correct
  2. Check logs:
    • macOS: `~/Library/Logs/Claude/mcp*.log`
    • Windows: `%APPDATA%\Claude\logs\mcp*.log`
  3. Restart Claude Desktop completely

"Bitquery API" errors

  • Verify your API key is valid
  • Check rate limits: https://bitquery.io/pricing
  • Some data may not be available for all tokens

"Insufficient funds" errors

  • Ensure you have enough BNB in wallet
  • Consider gas fees (approximately 0.001-0.005 BNB per transaction)

Transaction failed

  • Increase `gasLimit` in parameters
  • Check that token exists and is tradeable
  • Verify `slippage` (try increasing to 5-10% for volatile tokens)

📝 Important Notes

  1. Four.meme has no public REST API: We use Bitquery to access on-chain data
  2. Smart Contract: Four.meme address: `0x5c952063c7fc8610FFDB798152D69F0B9550762b`
  3. BNB Chain: Always use BNB Smart Chain (BSC), not BNB Beacon Chain
  4. Gas Fees: Transactions cost gas in BNB (typically 0.001-0.005 BNB)

🔄 Differences vs Solana Project

Aspect Solana (PumpFun) BNB (Four.meme)
Blockchain Solana BNB Smart Chain
Library @solana/web3.js ethers.js
Data API Moralis Bitquery
Native Token SOL BNB
Gas Fees ~0.00001 SOL ~0.001-0.005 BNB

🤝 Support

  • Bitquery Docs: https://docs.bitquery.io/
  • Four.meme: https://four.meme/
  • BNB Chain: https://docs.bnbchain.org/
  • MCP Protocol: https://modelcontextprotocol.io/

📄 License

MIT

⚠️ Disclaimer

This software is provided "as is". Cryptocurrency trading involves risks. Use at your own risk.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
mcp-server-qdrant

mcp-server-qdrant

这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。

官方
精选
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选