MCP Implementation in Hathor Forge
In addition to providing a local blockchain development environment, Hathor Forge also exposes a Model Context Protocol (MCP) server to connect to your AI model's instance.
This integration allows you to leverage AI in your development workflow, making it easier to ask questions about your code, jump start blueprint development, and even generate use cases based on your queries, allowing the AI to control the environment programmatically.
Claude Code
As an example, you could set it up with Claude Code by running the following command in your terminal:
# Terminal 1: start Hathor Forge
nix run github:HathorNetwork/hathor-forge -- --start
# Terminal 2: register the MCP server
claude mcp add --transport http hathor-forge http://127.0.0.1:9876/mcp
Make sure to replace the URL with the correct one if your MCP server is running on a different address or port.
You can refer to the Settings section in Hathor Forge for more details on how to configure the MCP server and integrate it with your AI model.
Or you can simply add the following snippet to your project's .mcp.json:
{
"mcpServers": {
"hathor-forge": {
"type": "http",
"url": "http://127.0.0.1:9876/mcp"
}
}
}
Available Tools
| Category | Tools |
|---|---|
| Node | start_node, stop_node, get_node_status |
| Miner | start_miner, stop_miner, get_miner_status |
| Wallet Service | start_wallet_service, stop_wallet_service, get_wallet_service_status |
| Wallets | generate_seed, create_wallet, get_wallet_seed, get_wallet_status, get_wallet_balance, get_wallet_addresses, send_from_wallet, close_wallet |
| Faucet | get_faucet_balance, send_from_faucet, fund_wallet |
| Blockchain | get_blocks, get_transaction |
| Quick Actions | quick_start, quick_stop, get_full_status, reset_data |
Example Use Case
You: "Start the blockchain and create a test wallet with 50 HTR"
Claude: [Uses quick_start, create_wallet, fund_wallet]
"Done! Node running at block 45, miner active.
Created wallet 'test' with 50 HTR."