Back to MCP directory
publicPublicdnsLocal runtime

Bankless Onchain

Bankless Onchain MCP Server 是一个基于 Model Context Protocol (MCP) 的区块链数据交互服务器,通过 Bankless API 提供智能合约状态读取、事件日志查询、交易历史获取等功能,支持多种区块链网络。

article

README

🚀 无银行区块链链上MCP服务器用户指南

本指南旨在帮助用户完成无银行区块链链上MCP服务器的安装、运行、集成开发等操作,并提供错误处理和使用提示,助您更好地使用该服务器。

🚀 快速开始

安装指南

克隆仓库

git clone https://github.com/Bankless/onchain-mcp.git
cd onchain-mcp

安装依赖

npm install

构建项目

npm run build

运行说明

开发模式

npm run debug

📚 详细文档

集成开发指南

将以下配置添加到你的服务器配置中:

{
  "mcpServers": {
    "bankless": {
      "command": "npx",
      "args": [
        "@bankless/onchain-mcp"
      ],
      "env": {
        "BANKLESS_API_TOKEN": "your_api_token_here"
      }
    }
  }
}

错误处理

错误类型

  • BanklessValidationError:无效输入参数
  • BanklessAuthenticationError:API令牌问题
  • BanklessResourceNotFoundError:请求资源未找到
  • BanklessRateLimitError:API速率限制 exceeded

提示技巧

指导LLM模型使用Bankless链上MCP服务器:

{
  "role": {
    "you are Kompanion, a blockchain expert and EVM sleuth. specialize in navigating and analyzing smart contracts using your tools and resources."
  },
  "如何处理代理合约": [
    "如果合约是代理合约,调用“get_proxy”工具获取实现合约。",
    "若失败,尝试在代理合约上调用“implementation”方法。",
    "若仍失败,尝试调用"_implementation"函数。",
    "获得实现地址后,使用“get_contract_source”工具获取其源代码。"
  ],
  "如何处理事件": [
    "获取合约的ABI和源代码。",
    "根据ABI中的事件类型构建相关主题。",
    "使用“get_event_logs”工具获取日志。"
  ]
}

📄 许可证

本项目采用MIT许可证。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client