remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Integrations
Hedera MCP Server
Overview
The Hedera MCP Server is a production-ready, modular Node.js (TypeScript) server designed to enable decentralized communication between AI agents on the Hedera network. It implements the Model-Context-Protocol (MCP) architecture, exposing both a RESTful API and an SSE-based (Server-Sent Events) MCP interface.
Using the Hedera Agent Kit alongside the Standards Agent Kit, the server supports multiple Hedera Consensus Service (HCS) standards:
- HCS-1 (File/Data Management)
- HCS-2 (Registry for Agent Discovery)
- HCS-3 (Large Message Handling and Recursion)
- HCS-10 (Agent Communication Protocol)
- HCS-11 (Decentralized Identity/Profile Management)
This server is especially aimed at hackathon participants and developers building AI-integrated decentralized applications on Hedera. It is also compatible with tools like Cursor for autonomous agent interactions.
Folder Structure
Features
- Agent Registration & Profiles (HCS-11):
Create new Hedera accounts (or import existing ones) for AI agents. Automatically set up inbound/outbound topics and on-chain profiles. - Agent Discovery (HCS-2):
Register agents in a centralized registry topic. Discover agents by name or capability using the provided search API. - Secure Communication (HCS-10):
Initiate and accept connection requests between agents. Establish dedicated connection topics over which agents can securely exchange messages. - Large Message Handling (HCS-1 & HCS-3):
Offload large message content by storing it on dedicated file topics and returning an HRL (HCS Resource Locator) reference within messages. - MCP Interface via SSE:
Expose an MCP-compliant SSE endpoint (via FastMCP) that lets AI tools like Cursor directly invoke server “tools” (e.g., register_agent, send_message). - RESTful API:
Expose comprehensive HTTP endpoints for agent operations, connection management, and messaging, with detailed request/response formats. - Production-Ready Deployment:
Comes with Docker and Docker Compose configurations for seamless one-command deployment.
Requirements
- Node.js ≥ 18 (LTS recommended)
- npm (comes with Node)
- Docker and Docker Compose (for container deployment)
- A Hedera Testnet (or Mainnet) account with sufficient funds for transactions
(Set the following environment variables:HEDERA_OPERATOR_ID
andHEDERA_OPERATOR_KEY
.)
Getting Started
1. Clone the Repository
2. Install Dependencies
3. Configure Environment Variables
Create a .env
file in the project root with the following content (adjust with your actual credentials):
4. Build the Project
Compile the TypeScript code into JavaScript:
5. Run the Server Locally
Start the REST API and MCP SSE servers:
You should see logs indicating that:
- The REST API is listening on
http://localhost:3000
- The MCP SSE server is available at
http://localhost:3001/sse
6. Development Mode
For rapid development with automatic rebuilds, use:
API Documentation
Agent Endpoints
- POST /api/agents/register
Registers a new agent.
Request Body:Response (201 Created):CopyCopy - GET /api/agents/{accountId}
Retrieves the profile of an agent by account ID.
Response (200 OK):Copy - GET /api/agents?name=Alice&capability=0
Search for agents by name and/or capability.
Response (200 OK):Copy
Connection Endpoints
- POST /api/connections/request
Initiates a connection request to another agent.
Request Body:Response (200 OK):CopyCopy - POST /api/connections/accept
Accepts a connection request and creates a dedicated connection topic.
Request Body:Response (200 OK):CopyCopy - GET /api/connections?accountId=0.0.AAAAA
Lists all active connections for a given agent.
Response (200 OK):Copy
Messaging Endpoints
- POST /api/messages/send
Sends a message over an established connection.
Request Body:Response (200 OK):CopyCopy - GET /api/messages?connectionTopicId=0.0.CCCCC&limit=10
Retrieves recent messages from a connection topic.
Response (200 OK):Copy
MCP SSE Interface
The server exposes an MCP interface over SSE (Server-Sent Events) powered by FastMCP. This interface is available at:
Integration with Cursor
- Run the Server:
Ensure the MCP SSE server is running (default on port 3001). Usenpm start
or Docker as described below. - Configure in Cursor:
In Cursor’s MCP settings, add a new MCP server with the URL:Cursor will automatically retrieve the list of available tools (e.g.,Copyregister_agent
,request_connection
,send_message
, etc.). - Usage:
You can instruct Cursor’s AI to perform actions using these tools. For example, prompt:"Register a new agent named AliceAgent and connect me to BobAgent."
Cursor will call the respective MCP tools defined in the SSE interface.
Docker Deployment
The project comes with a Dockerfile and a docker-compose.yml file for easy one-command deployment.
Using Docker Compose
- Ensure Environment Variables:
Set your environment variables in a.env
file in the project root (as shown above). - Build and Run:This command builds the Docker image and starts the containers in detached mode. The REST API will be accessible on port 3000 and the MCP SSE server on port 3001.Copy
- Verify Deployment:
Open your browser or usecurl
to check:- Health Check:
http://localhost:3000/
- MCP SSE Endpoint:
http://localhost:3001/sse
- Health Check:
Testing
Running the Test Suite
The project uses Jest for testing. Tests are organized into unit, integration, and end-to-end suites.
Run all tests with:
Tests include:
- Unit Tests: Validate logic in individual services (e.g., file chunking in
fileService.test.ts
). - Integration Tests: Test REST API endpoints using Supertest to ensure proper responses.
- End-to-End Tests: Simulate a full agent communication flow (agent registration, connection, and messaging) on Hedera Testnet.
Note: Tests will execute live operations on Hedera Testnet. Ensure your test environment has sufficient funds and that you are aware of minimal HBAR consumption.
Maintenance & Optimization
- Logging & Monitoring:
The server includes a basic logger. In production, consider integrating a more robust logging solution (e.g., Winston or Pino) and setting up log rotation and monitoring dashboards. - Caching:
Agent profiles and connection lists are cached in memory. For high-load scenarios, consider replacing these with a persistent store (e.g., Redis or a database). - Scaling:
The server is stateless aside from in-memory caches. It can be horizontally scaled behind a load balancer. For multiple instances, ensure they share the same registry configuration so that all agents appear in the global registry. - Security Considerations:
- Secure the
.env
file and never expose private keys. - For production, implement proper authentication/authorization for API endpoints.
- Consider using HTTPS and other secure communication practices.
- Secure the
- Standards Compliance Updates:
Keep an eye on updates to the Hedera Agent Kit and Standards Agent Kit. Upgrading dependencies may require minimal adjustments if new fields or protocols are introduced.
Contributing
Contributions are welcome! Please fork the repository and open pull requests with your improvements. For major changes, please open an issue first to discuss what you would like to change.
License
This project is licensed under the MIT License.
This server cannot be installed
A 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.