Manage Hyperledger Fabric networks and chaincode lifecycle
MCP server that connects AI agents to Hyperledger Fabric test networks for automated blockchain network management, chaincode deployment, and lifecycle
1.0.0Add to Favorites
Why it matters
Automate the complete lifecycle of Hyperledger Fabric blockchain test networks and chaincode deployment, from network setup through chaincode installation, approval, and commitment using modular MCP tools.
Outcomes
What it gets done
Spin up and tear down Fabric test network environments
Package and install chaincode on peer nodes
Approve and commit chaincode definitions across organizations
Query and invoke chaincode functions for testing
Source
Get it from source
Spark does not host a copy of it.
Open sourceReports
Agent outcome reports
No reports yet
Overview
Hyperledger Fabric Agent Suite MCP Server
A modular MCP server that connects AI agents to Hyperledger Fabric test networks through a Go REST API (hlf-controller) and Python MCP tool (hlf-mcp). It automatically downloads Fabric binaries, manages network topology via config.yaml, and provides full lifecycle management for bringing networks up/down, creating channels, and deploying, invoking, and querying chaincode through natural language interactions in Claude Desktop and Cursor. Use this when you need AI agents to automate Hyperledger Fabric test-network operations, script blockchain deployments during development, or provide conversational interfaces for chaincode management. It fits scenarios where developers want to interact with Fabric networks through LLM clients instead of manual CLI commands, specifically for test environments rather than production networks.
What it does
Hyperledger Fabric Agent Suite is a modular MCP server that enables AI agents to manage Hyperledger Fabric blockchain test networks through natural language. It combines a Go-based REST API (hlf-controller) for network and chaincode operations with a Python-based MCP tool (hlf-mcp) that exposes these capabilities to LLM clients like Claude Desktop and Cursor. The controller automatically downloads and configures Hyperledger Fabric binaries on first run, then provides full lifecycle management for bringing networks up/down, creating channels, and deploying, invoking, and querying chaincode.
When to use - and when NOT to
Use this MCP server when you need AI agents to automate Hyperledger Fabric test-network operations, script blockchain deployments, or provide conversational interfaces for chaincode management during development and testing. It is ideal for developers who want to interact with Fabric networks through Claude or Cursor instead of manual CLI commands. Do NOT use this for production Fabric networks - it is explicitly designed for test-network environments only. Avoid this tool if you need support for custom Fabric network topologies beyond the standard test-network configuration.
Inputs and outputs
Users provide network topology configuration via a central config.yaml file in the hlf-controller directory, including peer/orderer details, certificate paths, and timeouts. Environment variables can override paths: HLF_CONFIG_PATH for custom config location, HLF_NETWORK_SCRIPT_PATH for the Fabric network.sh script path, and HLF_API_BASE for the controller API URL (defaults to http://localhost:8081). The hlf-controller provides a REST API available at http://localhost:8081 for network and chaincode operations that AI agents can interact with through the hlf-mcp tool.
Integrations
The hlf-mcp tool integrates with Cursor and Claude Desktop through MCP configuration files. For Cursor, add to ~/.cursor/mcp.json:
"hlf-controller": {
"command": "uv",
"args": [
"--directory",
"/Users/padamarajkore/Desktop/hlf-mcp",
"run",
"mcp_hlf_tool.py"
]
}
For Claude Desktop, add to claude_desktop_config.json (typically in ~/Library/Application Support/Claude/):
"hlf-controller": {
"command": "/Users/padamarajkore/.local/bin/uv",
"args": [
"--directory",
"/Users/padamarajkore/Desktop/hlf-mcp",
"run",
"mcp_hlf_tool.py"
]
}
The hlf-controller uses the network.sh script from fabric-samples, with the path configurable via HLF_NETWORK_SCRIPT_PATH environment variable or config.yaml (defaults to ~/fabric-samples/test-network/network.sh).
Who it's for
This MCP server is built for blockchain developers and DevOps engineers working with Hyperledger Fabric who want to leverage AI agents for network automation and chaincode management. It suits teams prototyping blockchain applications in test environments who prefer conversational interfaces over manual command-line operations. The tool requires Go 1.18+ for the controller and Python 3.9+ with httpx for the MCP component, making it accessible to developers familiar with either language ecosystem.
Source README
Hyperledger Fabric Agent Suite
https://github.com/user-attachments/assets/75c3414a-3901-42ff-bf33-8f57b0ca96b4
Works for test-network.
A modular toolkit for managing Hyperledger Fabric test networks and chaincode lifecycle, featuring:
- hlf-controller: A Go-based REST API for network and chaincode operations.
- hlf-mcp: A Python-based MCP tool for automation, scripting, and agent integration.
Features
- Automated Fabric Setup: The
hlf-controllerautomatically downloads and configures Hyperledger Fabric binaries and samples on first run. - Dynamic Configuration: Easily configure the entire Fabric network topology via a central
config.yamlfile. - Full Lifecycle Management: Bring up/down the network, create channels, deploy, invoke, and query chaincode via a simple REST API.
- Agent-Ready: The
hlf-mcptool allows LLMs (like those in Cursor or Claude Desktop) to interact with your Fabric network seamlessly.
Prerequisites
- Go (1.18+)
- Python (3.9+)
- pip (for Python dependencies)
Setup Instructions
1. Clone the Repo
git clone <your-repo-url>
cd <repo-root>
2. Set Up and Run hlf-controller (Go REST API)
The controller handles its own prerequisites.
cd hlf-controller
go run main.go
- The first time you run this, it will check for
fabric-samplesand download them to your home directory if they are missing. The server will not start until this process is complete. - The API will then be available at
http://localhost:8081.
3. Set Up hlf-mcp (Python MCP Tool)
cd ../hlf-mcp
pip install httpx
# (Optional) Install any other agent/MCP dependencies
Configuration
hlf-controller
The Go controller is configured via the hlf-controller/config.yaml file. This is the primary way to define your network topology, including peer/orderer details, certificate paths, and timeouts.
Environment Variables
HLF_CONFIG_PATH: Path to a customconfig.yamlfile for the controller.HLF_NETWORK_SCRIPT_PATH: Overrides the path to your Fabricnetwork.sh. If not set, the path fromconfig.yamlis used, which in turn defaults to~/fabric-samples/test-network/network.sh.HLF_API_BASE: Base URL for the hlf-controller API (used byhlf-mcp, defaults tohttp://localhost:8081).
How to Use
Integration
- Cursor: Add the hlf-mcp tool to your
~/.cursor/mcp.json(see hlf-mcp/README.md). - Claude Desktop: Add to
claude_desktop_config.json(see hlf-mcp/README.md).
Example JSON Configurations for Integration
Cursor (~/.cursor/mcp.json)
Add the following entry to your ~/.cursor/mcp.json file to integrate the MCP tool with Cursor:
"hlf-controller": {
"command": "uv",
"args": [
"--directory",
"/Users/padamarajkore/Desktop/hlf-mcp", //change it to your local path for hlf-mcp folder
"run",
"mcp_hlf_tool.py"
]
}
Claude Desktop (claude_desktop_config.json)
Add the following entry to your claude_desktop_config.json file (usually found in ~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
"hlf-controller": {
"command": "/Users/padamarajkore/.local/bin/uv", //change it to your local path for uv binary
"args": [
"--directory",
"/Users/padamarajkore/Desktop/hlf-mcp", //change it to your local path for hlf-mcp folder
"run",
"mcp_hlf_tool.py"
]
}
Note:
- Adjust the
--directoryand script name to match the actual location and filename of your MCP tool. - Adjust the path to the
uvcommand if it is installed elsewhere on your system. - Place these entries inside the top-level JSON object, alongside your other tool definitions.
Project Structure
.
├── hlf-controller/ # Go REST API server with its own config.yaml
├── hlf-mcp/ # Python MCP tool
├── README.md # This file
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.