Emercoin MCP Server v0.2
A comprehensive Model Context Protocol (MCP) server that provides HTTP/JSON access to all Emercoin CLI functionality with integrated formatting utilities.
Features
Complete RPC Coverage: All 100+ Emercoin RPC endpoints organized by category
Formatting Integration: Built-in support for
emercoin-format.pyandemercoin-value.pyutilitiesMultiple API Styles: Category-based routes, generic RPC calls, and legacy compatibility
Enhanced Error Handling: Detailed error responses with stderr output and exit codes
Auto-Discovery:
/endpointsroute lists all available methods by categoryHealth Monitoring: Comprehensive health check with endpoint count
CORS Support: Cross-origin requests enabled
High Performance: Uses
spawnfor better process management
Prerequisites
Node.js 14.0.0 or higher
Python 3 (for formatting utilities)
Emercoin daemon (emercoind) running with RPC enabled
emercoin-cli in your PATH or specified via environment variable
Installation
Configuration
Configure using environment variables:
Running the Server
API Endpoints
Discovery & Health
GET /health- Server health and statisticsGET /endpoints- List all available RPC methods by category
Category-Based Routes
All RPC methods are available via category-based routes:
Blockchain Operations
POST /blockchain/getblockchaininfoPOST /blockchain/getblockcountPOST /blockchain/getbestblockhashPOST /blockchain/getblock- params:["blockhash", verbosity]And 20+ more blockchain endpoints...
Name Operations (Emercoin's unique feature)
POST /names/name_show- params:["name", "valuetype", "filepath"]POST /names/name_new- params:["name", "value", days, "toaddress", "valuetype"]POST /names/name_update- params:["name", "value", days, "toaddress", "valuetype"]POST /names/name_filter- params:["regexp", maxage, from, nb, "stat", "valuetype"]And 10+ more name endpoints...
Wallet Operations
POST /wallet/getbalancePOST /wallet/getnewaddress- params:["label", "address_type"]POST /wallet/sendtoaddress- params:["address", amount, "comment", "comment_to", ...]POST /wallet/listtransactionsAnd 40+ more wallet endpoints...
Other Categories
Control:
getinfo,stop,uptime, etc.Mining:
getmininginfo,getblocktemplate, etc.Network:
getpeerinfo,getnetworkinfo, etc.Raw Transactions:
createrawtransaction,signrawtransaction, etc.Utilities:
validateaddress,estimatesmartfee, etc.Randpay: Emercoin's micropayment system
ZMQ: Notification system
Generic RPC Routes
POST /rpc/:method- Call any RPC method directlyPOST /rpc- Legacy RPC passthrough
Request Format
All endpoints accept JSON with optional formatting:
Examples
Get blockchain info:
Show name with formatting:
Extract value from name:
Send EMC:
Formatting Utilities
The server integrates two Python utilities:
emercoin-format.py
Cleans text output by replacing literal \n with actual line breaks.
emercoin-value.py
Extracts the value field from JSON responses, useful for name operations.
Enable formatting by adding "format": true or "extractValue": true to your request body.
Security Considerations
Network Security: Run behind HTTPS reverse proxy
Access Control: Use firewall rules to limit access
Credentials: Use strong RPC credentials, consider
rpcauthPort Security: Default port 7331 avoids common conflicts
Input Validation: All user input is properly escaped
Error Handling
Detailed error responses include:
Error message
stderr output from emercoin-cli
Exit code
Method name for context
Development
License
MIT
This server cannot be installed
Related Resources
Related MCP Servers
- Asecurity-licenseAqualityFacilitates interaction with Ethereum blockchain data via Etherscan's API, providing real-time access to balances, transactions, token transfers, contract ABIs, gas prices, and ENS name resolutions.Last updated -726MIT License
- -securityFlicense-qualityEnables secure interactions with cryptocurrency daemon RPC interfaces through AI assistants, supporting transaction management, wallet operations, and daemon monitoring for Bitcoin-derived cryptocurrencies.Last updated -1
- AsecurityAlicenseAqualityProvides Ethereum blockchain data tools via Etherscan's API, enabling users to check ETH balances, view transactions, track token transfers, fetch contract ABIs, monitor gas prices, and resolve ENS names.Last updated -71MIT License
- AsecurityAlicenseAqualityProvides tools for AI assistants to interact with the Ethereum blockchain through standard JSON-RPC methods, enabling queries for account balances, gas prices, and smart contract code.Last updated -311MIT License