区块链AI助手

一个基于AI的区块链助手,提供实时加密货币数据、钱包分析和Web3事件发现功能。

  • by Qbandev
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 Qbandev/web3agent

使用说明


⟨ WEB3AGENT ⟩

AI-powered blockchain assistant with real-time crypto data


✨ 特性

特性 描述
🔗 多服务器MCP 同时连接到3个区块链数据提供商
🤖 Groq法学硕士 快速推理 openai/gpt-oss-20b 模型
💰 实时价格 通过CoinGecko实时加密货币价格
👛 钱包分析 通过Hive Intelligence记录余额和交易历史
📅 Web3活动 通过GoWeb3发现会议和活动
🎨 赛博朋克UI 时尚的深色主题,带有霓虹色调

🖥️ MCP服务器

服务器 功能
CoinGecko 加密货币价格、市值、趋势币
蜂巢智能 钱包余额、交易历史、DeFi分析
GoWeb3 Web3活动和会议

🚀 快速开始

先决条件

本地开发

# Clone
git clone https://github.com/Qbandev/web3agent.git
cd web3agent

# Setup
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

# Configure
export GROQ_API_KEY="your_groq_api_key"

# Run
streamlit run src/web3agent/app.py

🐳 码头工人

docker build -t web3agent .
docker run -p 8501:8501 -e GROQ_API_KEY="your_key" web3agent

打开 http://localhost:8501

💬 查询示例

What is the current price of Ethereum?
Show me the top 5 trending coins
What's the total balance in wallet 0xcF26040D93a6267741a2DD2cC5E1A3253dD868Ab?
Show transaction history for 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045

⚙️ 配置

环境变量

变量 描述 必填
GROQ_API_KEY 用于LLM推理的Groq API密钥 ✅

MCP服务器

服务器配置在 mcp_agent.config.yaml:

mcp:
  servers:
    coingecko:
      transport: streamable_http
      url: "https://mcp.api.coingecko.com/mcp"
    hive:
      transport: streamable_http
      url: "https://mcp.hiveintelligence.xyz/mcp"
    goweb3:
      transport: streamable_http
      url: "https://goweb3-mcp-server.onrender.com/mcp"

🧪 发展

# Run tests
pytest tests/ -v

# Lint & format
ruff check src/ tests/
ruff format src/ tests/

# Security scan
bandit -r src/ -ll

📁 项目结构

web3agent/
├── src/web3agent/
│   ├── app.py           # Streamlit entry point
│   ├── mcp_client.py    # MCP server connections
│   ├── agent.py         # Server configuration
│   └── ui/chat.py       # Chat components
├── tests/               # Test suite
├── docs/images/         # Screenshots
└── Dockerfile           # Container config

🌐 部署

该应用程序已配置为通过以下方式进行渲染部署 render.yaml.

📄 许可证

MIT© Qbandev


Built with 💜 using mcp-agent • Groq • Streamlit