Hive区块链集成
STDIOAI助手通过MCP与Hive区块链交互
AI助手通过MCP与Hive区块链交互
An MCP server that enables AI assistants to interact with the Hive blockchain through the Model Context Protocol.
This server provides a bridge between AI assistants (like Claude) and the Hive blockchain, allowing AI models to:
create-post
- Creates a structured prompt to guide the AI through creating a new Hive post with the right format and tagsanalyze-account
- Generates a prompt to analyze a Hive account's statistics, posting history, and activity patternsget_account_info
- Get detailed information about a Hive blockchain accountget_post_content
- Retrieve a specific post by author and permlinkget_posts_by_tag
- Retrieve posts by tag and category (trending, hot, etc.)get_posts_by_user
- Fetch posts from a specific user or their feedget_account_history
- Get transaction history for an account with optional operation filteringget_chain_properties
- Fetch current Hive blockchain properties and statisticsget_vesting_delegations
- Get a list of vesting delegations made by a specific accountvote_on_post
- Vote on Hive content (requires posting key)create_post
- Create new blog posts on the Hive blockchain (requires posting key)create_comment
- Comment on existing posts or reply to comments (requires posting key)send_token
- Send HIVE or HBD cryptocurrency to other accounts (requires active key)sign_message
- Sign a message using a Hive private keyverify_signature
- Verify a message signature against a Hive public keyencrypt_message
- Encrypt a message for a specific Hive accountdecrypt_message
- Decrypt an encrypted message from a specific Hive accountsend_encrypted_message
- Send an encrypted message using a token transferget_encrypted_messages
- Retrieve and optionally decrypt messages from account historyThe MCP Inspector provides an interactive interface for testing and debugging the server:
npx @modelcontextprotocol/inspector npx @gluneau/hive-mcp-server
To enable authenticated operations (voting, posting, sending tokens), you'll need to set environment variables:
export HIVE_USERNAME=your-hive-username export HIVE_POSTING_KEY=your-hive-posting-private-key # For content operations export HIVE_ACTIVE_KEY=your-hive-active-private-key # For token transfers export HIVE_MEMO_KEY=your-hive-memo-private-key # For encrypted messaging
Security Note: Never share your private keys or commit them to version control. Use environment variables or a secure configuration approach.
To use this server with Claude Desktop:
Ensure you have Claude Desktop installed
Open or create the Claude configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
Add this server to your configuration:
{ "mcpServers": { "hive": { "command": "npx", "args": ["-y", "@gluneau/hive-mcp-server"], "env": { "HIVE_USERNAME": "your-hive-username", "HIVE_POSTING_KEY": "your-hive-posting-private-key", "HIVE_ACTIVE_KEY": "your-hive-active-private-key", "HIVE_MEMO_KEY": "your-hive-memo-private-key" } } } }
The same JSON configuration works for Windsurf (in windsurf_config.json
) and for Cursor (in ~/.cursor/mcp.json
for version >= 0.47).
In previous versions, you'll have to use the 1 line command format in the MCP section of the Settings :
env HIVE_USERNAME=your-hive-username env HIVE_POSTING_KEY=your-hive-posting-private-key env HIVE_ACTIVE_KEY=your-hive-active-private-key env HIVE_MEMO_KEY=your-hive-memo-private-key npx -y @gluneau/hive-mcp-server
Once connected to an MCP client, you can ask questions like:
get_account_info
Fetches detailed information about a Hive blockchain account including balance, authority, voting power, and other metrics.
username
: Hive username to fetch information forget_post_content
Retrieves a specific Hive blog post identified by author and permlink.
author
: Author of the postpermlink
: Permlink of the postget_posts_by_tag
Retrieves Hive posts filtered by a specific tag and sorted by a category.
category
: Sorting category (trending, hot, created, etc.)tag
: The tag to filter posts bylimit
: Number of posts to return (1-20)get_posts_by_user
Retrieves posts authored by or in the feed of a specific Hive user.
category
: Type of user posts to fetch (blog or feed)username
: Hive username to fetch posts forlimit
: Number of posts to return (1-20)get_account_history
Retrieves transaction history for a Hive account with optional operation type filtering.
username
: Hive usernamelimit
: Number of operations to returnoperation_filter
: Optional list of operation types to filter forget_chain_properties
Fetch current Hive blockchain properties and statistics.
get_vesting_delegations
Get a list of vesting delegations made by a specific Hive account.
username
: Hive account to get delegations forlimit
: Maximum number of delegations to retrievefrom
: Optional starting account for paginationvote_on_post
Vote on a Hive post (upvote or downvote) using the configured Hive account.
author
: Author of the post to vote onpermlink
: Permlink of the post to vote onweight
: Vote weight from -10000 (100% downvote) to 10000 (100% upvote)create_post
Create a new blog post on the Hive blockchain using the configured account.
title
: Title of the blog postbody
: Content of the blog post (Markdown supported)tags
: Tags for the postcreate_comment
Create a comment on an existing Hive post or reply to another comment.
parent_author
: Username of the post author or comment you're replying toparent_permlink
: Permlink of the post or comment you're replying tobody
: Content of the comment (Markdown supported)send_token
Send HIVE or HBD tokens to another Hive account using the configured account.
to
: Recipient Hive usernameamount
: Amount of tokens to sendcurrency
: Currency to send (HIVE or HBD)memo
: Optional memo to include with the transactionsign_message
Sign a message using a Hive private key from environment variables.
message
: Message to signkey_type
: Type of key to use (posting, active, or memo)verify_signature
Verify a digital signature against a Hive public key.
message_hash
: The SHA-256 hash of the message in hex formatsignature
: Signature string to verifypublic_key
: Public key to verify againstencrypt_message
Encrypt a message for a specific Hive account using memo encryption.
message
: Message to encryptrecipient
: Hive username of the recipientdecrypt_message
Decrypt an encrypted message received from a specific Hive account.
encrypted_message
: Encrypted message (starts with #)sender
: Hive username of the sendersend_encrypted_message
Send an encrypted message to a Hive account using a small token transfer.
message
: Message to encrypt and sendrecipient
: Hive username of the recipientamount
: Amount of HIVE to send (minimum 0.001, default: 0.001)get_encrypted_messages
Retrieve encrypted messages from account history with optional decryption.
username
: Hive username to fetch encrypted messages forlimit
: Maximum number of messages to retrieve (default: 20)decrypt
: Whether to attempt decryption of messages (default: false)src/index.ts
- Main server implementationsrc/tools/
- Implementation of all toolssrc/schemas/
- Zod schemas for tool parameterssrc/utils/
- Utility functions for interacting with the Hive blockchainsrc/config/
- Client Configuration and log level handlingISC
Contributions are welcome! Please feel free to submit a Pull Request.
See the CONTRIBUTING.md file for more detailed contribution guidelines.