本指南旨在帮助用户完成无银行区块链链上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许可证。