TON接入MCP服务器
TON区块链的生产就绪模型上下文协议(MCP)服务器实现,基于 吨级通道 图书馆。
什么是MCP?
这 模型上下文协议(MCP) 是Anthropic开发的一个开放协议,它规范了应用程序如何为大型语言模型(LLM)提供上下文。它遵循客户端-服务器架构,其中LLM应用程序(主机)连接到MCP服务器,MCP服务器为LLM提供上下文、工具和提示。
特性
- 完整的MCP实施:实现将AI助手连接到TON区块链的完整MCP规范
- 去中心化访问:使用多个节点实现可靠性和分散化
- 健康检查:自动检查节点健康状况并选择健康节点
- 负载平衡:使用加权随机算法分发请求
- 多个网络:支持主网和测试网
- 多个协议:支持不同的RPC协议(TonCenter HTTP API v2、TonHub HTTP API v4)
安装
# Clone the repository
git clone https://github.com/your-org/ton-access-mcp.git
cd ton-access-mcp
# Install dependencies
npm install
# Build the project
npm run build
# Start the server
npm start快速开始
import { TonAccessMCPServer } from 'ton-access-mcp';
// Create and start the server
const server = new TonAccessMCPServer({
port: 3000,
host: 'localhost'
});
server.start().then(() => {
console.log('TON Access MCP Server is running on http://localhost:3000');
});可用工具
TON Access MCP服务器提供以下工具:
- ton.getbalance:获取TON钱包地址的余额
- ton.getTransaction:获取TON区块链交易的详细信息
- 吨计量块:获取TON区块链块的详细信息
- ton.callgetter:在TON智能合约上调用getter方法
- ton.get主链信息:获取TON主链的最新信息
- ton.getAccountState:获取TON帐户的当前状态
文档
有关详细文档,请参阅 文档 目录。
许可证
此项目根据MIT许可证获得许可-有关详细信息,请参阅许可证文件。
