mcp-server-hyperledger-fabric
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| FABRIC_KEY | Yes | Path to the private key (PEM). | |
| FABRIC_TLS | No | Use TLS. Set to false only for local/dev test-network use. | true |
| FABRIC_CERT | Yes | Path to the enrollment signcert (PEM). | |
| FABRIC_MSP_ID | Yes | MSP ID of the identity. | |
| FABRIC_CHANNEL | No | Default channel named in the server instructions sent to the client. | |
| FABRIC_REST_URL | No | Gateway REST API base URL, used for get_blockchain_info. | |
| FABRIC_READ_ONLY | No | Register only read tools; invoke_chaincode and endorse_chaincode are not exposed. | false |
| REQUEST_TIMEOUT_MS | No | Deadline for each network call in milliseconds. | 30000 |
| FABRIC_CHAINCODE_API | No | Chaincode API descriptions file or directory generated by mcp-server-hyperledger-fabric scan. | ./chaincode-api |
| FABRIC_LOG_TRANSIENT | No | Log transientData values in full. Default logs only keys, byte sizes, and a short hash. | false |
| FABRIC_PEER_ENDPOINT | Yes | gRPC endpoint of the gateway peer, in host:port format. | |
| FABRIC_PEER_TLS_CERT | No | Path to the peer's TLS CA cert (PEM). Required when TLS is enabled, which is the default. | |
| FABRIC_DEDUP_WINDOW_MS | No | Dedup window for invoke_chaincode in milliseconds. 0 disables deduplication. | 0 |
| FABRIC_PEER_TLS_SERVER_NAME | No | Override TLS server name, for example when using an SSH tunnel. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Hyperledger Fabric gateway server for peer peer0.org1.example.com:7051, MSP Org1MSP. Channel is a required argument of every ledger tool; use the one the user names. Read with query_chaincode. Write with invoke_chaincode (returns txid and commit status); endorse_chaincode dry-runs a write without committing. After an invoke commit-status timeout the transaction may still have committed: check get_transaction before retrying.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| resources | {
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| query_chaincodeA | Evaluate a chaincode read function on Hyperledger Fabric and return its result. Use for reads, never for state changes. |
| invoke_chaincodeA | Submit a chaincode transaction that changes state. Returns transaction ID and commit status. Use only when a state change is intended. A commit-status timeout does NOT mean the transaction failed — it may still commit; check get_transaction before retrying. |
| get_blockA | Read a block from the Fabric ledger by block number and return a summary (number, hashes, transactions). |
| get_blockchain_infoA | Read ledger height and hashes for a channel via the Fabric Gateway REST API. Requires FABRIC_REST_URL. |
| get_chaincode_eventsB | Read recent chaincode events from the Fabric ledger (event name, transaction, block, payload). |
| get_transactionA | Find a transaction by its ID by scanning blocks forward from startBlock. Returns the block summary containing the transaction. |
| get_block_by_hashA | Find a block by its data hash by scanning blocks forward from startBlock. Returns the block summary. |
| endorse_chaincodeA | Validate a chaincode transaction by endorsing it without submitting to the orderer. Nothing is committed. Use to check a write will pass before invoking. |
| check_network_statusA | Check peer health: ledger height, last block, response latency. Use before a series of calls to confirm the peer is reachable. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 9 tools
Most tools have clearly distinct purposes: read chaincode, invoke, endorse, block/transaction lookup, and event retrieval are well separated. The main overlap is between get_blockchain_info and check_network_status, both of which report ledger height/status, though one is channel-level info and the other is peer health.
All tool names use consistent snake_case with a verb_noun pattern such as get_block, query_chaincode, invoke_chaincode, and check_network_status. The convention is predictable throughout.
Nine tools is well-scoped for a Hyperledger Fabric gateway server, covering reads, writes, endorsement, events, transactions, blocks, and health checks without excessive surface area.
The set covers core ledger and chaincode operations including reads, state-changing invokes, endorsement checks, transaction lookup, block lookup, and events. Minor gaps exist around chaincode metadata, channel listing, or richer event filtering, but the main workflows are supported.