本项目是一个强大的工具集合,它将 Model Context Protocol (MCP) 集成到 Hive 区块链 中,可执行各类区块链操作。借助 @hiveio/dhive 和 @modelcontextprotocol/sdk 开发,为区块链应用开发提供了便利。
本项目是用于使用 MCP 与 Hive 区块链交互的工具集合。只需配置环境变量,就能轻松实现签名、加密、区块链交易等功能。
使用以下命令进行安装:
npm install hive-mcp-server
interface GetBalanceParams {
account?: string;
}
export async function getBalance(params: GetBalanceParams): Promise<Balance> {
// 实现获取账户余额的逻辑
}
interface GetHistoryParams {
account?: string;
limit?: number;
operationFilter?: string[];
}
export async function getHistory(params: GetHistoryParams): Promise<Transaction[]> {
// 实现获取交易历史的逻辑
}
interface CreatePostParams {
title: string;
body: string;
tags: string[];
// 其他可选参数
}
export async function createPost(params: CreatePostParams): Promise<Post> {
// 实现发布博客的逻辑
}
interface CreateCommentParams {
parentAuthor: string;
parentPermlink: string;
body: string;
// 可选参数
}
export async function createComment(params: CreateCommentParams): Promise<Comment> {
// 实现发布评论的逻辑
}
interface VotePostParams {
author: string;
permlink: string;
weight: number;
}
export async function votePost(params: VotePostParams): Promise<void> {
// 实现投票逻辑
}
src/index.ts
- 服务器主程序src/tools/
- 各个工具的实现src/schemas/
- Zod 架构用于参数验证src/utils/
- 辅助函数用于与 Hive 区块链交互src/config/
- 客户端配置和日志等级处理本项目采用 ISC 协议。
欢迎贡献!请随意提交 Pull Request。更多详细的贡献指南,请参阅 CONTRIBUTING.md 文件。