MCP Server (ashen-mcp)
Overview
Section titled “Overview”ashen-mcp is a Model Context Protocol (MCP) server that exposes a small,
read/write toolset for Ashen nodes. It speaks JSON-RPC 2.0 over stdio and
proxies requests to the node RPC.
Binary: ashen-mcp (src/bin/mcp_ashen.rs)
# From the repo rootcargo run --bin ashen-mcpThe server reads JSON lines from stdin and writes JSON lines to stdout. It is designed to be launched by an MCP-capable client.
Environment
Section titled “Environment”| Variable | Default | Purpose |
|---|---|---|
NODE_RPC_URL | http://127.0.0.1:3030 | Base URL for the node RPC |
NODE_AUTH_TOKEN | (unset) | Optional Bearer token for RPC auth |
Protocol
Section titled “Protocol”Supported JSON-RPC methods:
initializetools/listtools/callping
Protocol version default: 2024-11-05
ashen.status
Section titled “ashen.status”Get chain status (tip height, epoch, finalized height).
Input schema:
{}ashen.account
Section titled “ashen.account”Fetch account state by address.
Input schema:
{ "address": "0x..."}ashen.tx_submit
Section titled “ashen.tx_submit”Submit a signed transaction as a hex string.
Input schema:
{ "tx": "0x..."}ashen.contract_view
Section titled “ashen.contract_view”Execute a read-only contract call.
Input schema:
{ "contract": "0x...", "calldata": "0x...", "origin": "0x...", "gas_limit": 1000000, "value": "0"}Notes:
calldatais ABI v1 encoded:selector || borsh(args).originandvalueare optional.
Example
Section titled “Example”Request:
{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"ashen.status","arguments":{}}}Response:
{"jsonrpc":"2.0","id":1,"result":{"content":{"version":"0.1.0","chain_id":1,"tip":{"height":123}}}}Errors
Section titled “Errors”Errors are returned using JSON-RPC error objects. Common error codes:
-32700: parse error-32601: method not found-32602: invalid params-32000: RPC client init failure-32001: RPC request failure
Related
Section titled “Related”/reference/rpc-api/for the underlying node RPC/guides/using-the-cli/for CLI and calldata helpers