Hedera MCP Server
Hedera MCP 服务器
用于与 Hedera 网络交互的模型上下文协议 (MCP) 服务器。该服务器提供用于创建 Hedera 钱包、查看账户余额、构建交易以及发送签名交易的工具。
⚠️ 安全警告
**这是一个演示实现,不应在生产环境中使用。**当前实现存在多个安全漏洞:
私钥在响应主体中发送
敏感数据未加密
没有交易验证机制
此实现旨在演示 MCP 概念,在用于生产环境之前应得到适当的保护。
Related MCP server: MCP Clusters API Server
主要目标
该 MCP 服务器的主要目的是演示 MCP 服务器如何处理交易的构建和执行,而客户端只需验证交易即可。具体来说:
交易构建完全在 MCP 服务器上进行
客户签署构建的交易
MCP 服务器负责向 Hedera 网络提交交易
这种架构允许集中交易逻辑并降低客户端复杂性
先决条件
Node.js(v18 或更高版本)
npm 或 yarn
Hedera 账户(用于测试网或主网)
安装
克隆此存储库:
git clone https://github.com/hedera-dev/hedera-mcp-server.git cd hedera-mcp-server安装依赖项:
npm install使用您的 Hedera 凭据在根目录中创建一个
.env文件:HEDERA_OPERATOR_ID=your-operator-account-id HEDERA_OPERATOR_KEY=your-operator-private-key HEDERA_NETWORK=testnet # or mainnet PORT=3000 # optional, defaults to 3000
构建应用程序
编译 TypeScript 代码:
npm run build对于使用自动重新编译的开发:
npm run dev运行服务器
启动服务器:
npm start该服务器将在http://localhost:3000 (或 .env 文件中指定的端口)上可用。
使用测试客户端进行测试
该存储库包含一个测试客户端脚本,用于演示如何连接到 MCP 服务器并使用其工具。该客户端提供了完整的端到端流程,演示了所有可用的工具。
运行测试客户端:
node test-client.js测试客户端将:
连接到 MCP 服务器
列出可用的工具
创建一个新的 Hedera 钱包(创建钱包工具)
检查新账户余额(检查余额工具)
建立一个交易,将账户的全部余额转移到操作员账户(build-transaction 工具)
使用 Hedera SDK 在客户端签署交易
将签名的交易提交到 Hedera 网络(发送交易工具)
显示交易结果
这展示了通过 MCP 服务器与 Hedera 网络交互的完整生命周期,从帐户创建到交易提交。
可用的 MCP 工具
该服务器提供以下工具:
create-wallet :创建一个具有最低初始余额的新 Hedera 帐户
无需输入参数
返回账户ID、公钥、私钥
check-balance :检查 Hedera 账户的余额
输入:
accountId(字符串)返回 tinybars 中的账户余额
build-transaction :构建转账交易(无需签名)
输入:
senderAccountId(字符串)recipientAccountId(字符串)amount(数字,以小条为单位)
返回 base64 编码的交易
send-transaction :向 Hedera 网络发送已签名的交易
输入:
signedTransaction(字符串,base64编码)返回交易状态和ID
部署
包含一个简单的部署脚本:
./deploy.sh确保首先使其可执行:
chmod +x deploy.shThis server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Tenzro Network MCP server: wallet, identity, payments, inference, staking, bridges, verification.
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
MCP server for Klever blockchain smart contract development.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables AI models to interact with the Solana blockchain, providing RPC methods, wallet management, DeFi trading capabilities, and Helius API integration for enhanced Solana development.5MIT
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server implementation that provides endpoints for wallet-based authentication, cluster management, and name registration services.1
- FlicenseNot gradedqualityDmaintenanceA production-ready Node.js server that enables decentralized communication between AI agents on the Hedera network, implementing the Model-Context-Protocol architecture with support for multiple Hedera Consensus Service standards.
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that extends AI capabilities by providing tools to interact with the Solana blockchain, enabling operations like transactions, account queries, and wallet management.1Apache 2.0
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/hedera-dev/hts-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server