✨ From vibe coding to vibe deployment. UBOS MCP turns ideas into infra with one message.

Learn more

Hedera MCP Server: Simplifying Blockchain Interaction with UBOS

The Hedera Model Context Protocol (MCP) Server is a pivotal tool designed to streamline interactions with the Hedera network. As a demo implementation, it showcases how developers can construct Hedera wallets, verify account balances, create transactions, and dispatch signed transactions more efficiently. This server is engineered to abstract the complexities of blockchain interaction, making it more accessible and manageable for developers.

Important Security Warning:

It’s crucial to highlight that this implementation is for demonstration purposes only and is NOT intended for production environments. The current version has significant security vulnerabilities, including the transmission of private keys in response bodies, a lack of sensitive data encryption, and the absence of transaction verification mechanisms. Therefore, before considering its use in any live application, thorough security enhancements are essential.

Main Objectives

The primary goal of the Hedera MCP Server is to illustrate how transaction construction and execution can be effectively managed by the server, requiring only client-side transaction verification. This approach offers several advantages:

  1. Centralized Transaction Construction: All transaction-related logic resides on the MCP server, simplifying client-side development.
  2. Client-Side Signing: Clients retain control by signing constructed transactions.
  3. Server-Side Submission: The MCP server manages the submission of signed transactions to the Hedera network.

This architecture promotes centralized transaction logic, reduces complexity on the client side, and ensures a smoother interaction with the Hedera network.

Use Cases

While the demo implementation should not be used directly in production, the concepts behind the Hedera MCP Server unlock several potential use cases, especially when integrated with a platform like UBOS:

  • Streamlined Blockchain Integration: For applications requiring interaction with the Hedera network, the MCP server simplifies the process of creating wallets, checking balances, and sending transactions. This is particularly useful for decentralized finance (DeFi) applications, supply chain management solutions, and other blockchain-based services.
  • Simplified Development: By abstracting the complexities of transaction construction and submission, the MCP server reduces the burden on developers, allowing them to focus on building the core functionality of their applications. This can lead to faster development cycles and reduced costs.
  • Centralized Transaction Logic: The MCP server centralizes transaction logic, making it easier to maintain and update. This is especially valuable for organizations with complex transaction requirements or those that need to comply with strict regulatory guidelines.
  • AI-Powered Blockchain Interaction (with UBOS): Integrate the MCP Server with UBOS to enable AI Agents to interact with the Hedera network. For example, an AI Agent could automatically create wallets, monitor account balances, or execute transactions based on predefined rules or events. This opens up new possibilities for automation and optimization in blockchain-based applications.

Potential Use Cases Enhanced by UBOS:

  • Automated Micro-Payments: Imagine an AI Agent within UBOS configured to automatically distribute micro-payments to content creators on a decentralized social media platform, leveraging the MCP Server for transaction execution.
  • Smart Contract Interaction: UBOS-orchestrated AI Agents could monitor smart contract events and trigger actions, such as transferring assets or updating records, using the MCP Server to construct and submit the necessary transactions.
  • Supply Chain Optimization: AI Agents could track goods as they move through the supply chain, automatically executing payments and updating records using the MCP Server, ensuring transparency and efficiency.
  • Decentralized Identity Management: An AI Agent within UBOS could manage user identities on a decentralized network, creating and managing Hedera wallets using the MCP Server.

Key Features

  • Wallet Creation: The create-wallet tool allows developers to programmatically create new Hedera accounts with a minimal initial balance.
  • Balance Checking: The check-balance tool provides a simple way to retrieve the balance of a Hedera account.
  • Transaction Building: The build-transaction tool enables the construction of transfer transactions without signing, allowing for greater flexibility and control.
  • Transaction Sending: The send-transaction tool facilitates the submission of signed transactions to the Hedera network.
  • Test Client: A test client script is included to demonstrate how to connect to the MCP server and use its tools, providing a complete end-to-end flow.

Prerequisites and Installation

To get started with the Hedera MCP Server, you’ll need the following prerequisites:

  • Node.js (v18 or higher)
  • npm or yarn
  • A Hedera account (for testnet or mainnet)

Installation involves cloning the repository, installing dependencies, and creating a .env file with your Hedera credentials:

bash git clone https://github.com/hedera-dev/hedera-mcp-server.git cd hedera-mcp-server npm install

Create a .env file:

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

Building and Running the Server

Compile the TypeScript code:

bash npm run build

For development with automatic recompilation:

bash npm run dev

Start the server:

bash npm start

The server will be available at http://localhost:3000 (or the port specified in your .env file).

Testing with the Test Client

The repository includes a test client script that demonstrates how to connect to the MCP server and use its tools. This client provides a complete end-to-end flow demonstrating all available tools.

Run the test client:

bash node test-client.js

UBOS: Enhancing MCP Server Capabilities

UBOS is a full-stack AI Agent development platform that can significantly enhance the capabilities of the Hedera MCP Server. By integrating the MCP Server with UBOS, you can empower AI Agents to interact with the Hedera network, automate tasks, and optimize processes.

How UBOS Complements the MCP Server:

  • AI Agent Orchestration: UBOS provides a platform for orchestrating AI Agents, allowing you to define complex workflows and automate interactions with the Hedera network through the MCP Server.
  • Enterprise Data Connectivity: UBOS enables AI Agents to connect to your enterprise data sources, allowing them to make informed decisions and execute transactions based on real-time data.
  • Custom AI Agent Building: UBOS allows you to build custom AI Agents tailored to your specific needs, leveraging your own LLM models and data.
  • Multi-Agent Systems: UBOS supports the creation of multi-agent systems, allowing you to build complex applications that involve multiple AI Agents interacting with each other and the Hedera network.

Potential UBOS + MCP Server Integrations:

  • Automated Account Management: An AI Agent within UBOS could automatically create and manage Hedera accounts for your users, simplifying the onboarding process.
  • Smart Contract Monitoring: An AI Agent could monitor smart contracts on the Hedera network and trigger actions based on predefined events, such as transferring assets or updating records.
  • Supply Chain Automation: AI Agents could track goods as they move through the supply chain, automatically executing payments and updating records on the Hedera network.
  • Decentralized Identity Management: UBOS could be used to build a decentralized identity management system that leverages the Hedera network and the MCP Server to securely manage user identities.

By combining the Hedera MCP Server with the power of UBOS, you can unlock new possibilities for automation, optimization, and innovation in blockchain-based applications. While the current MCP Server implementation is a demo, the concepts it demonstrates, coupled with the capabilities of UBOS, offer a glimpse into the future of decentralized application development.

Disclaimer: Remember to thoroughly secure any implementation based on the MCP Server before deploying it in a production environment. UBOS provides a secure and scalable platform for building and deploying AI Agent-powered applications, but it is your responsibility to ensure that your application meets all applicable security and compliance requirements.

Featured Templates

View More
AI Characters
Your Speaking Avatar
169 928
Verified Icon
AI Assistants
Speech to Text
137 1882
AI Assistants
AI Chatbot Starter Kit v0.1
140 913
Data Analysis
Pharmacy Admin Panel
252 1957

Start your free trial

Build your solution today. No credit card required.

Sign In

Register

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.