Skip to content

MCP Server (ashen-mcp)

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)

Terminal window
# From the repo root
cargo run --bin ashen-mcp

The server reads JSON lines from stdin and writes JSON lines to stdout. It is designed to be launched by an MCP-capable client.

VariableDefaultPurpose
NODE_RPC_URLhttp://127.0.0.1:3030Base URL for the node RPC
NODE_AUTH_TOKEN(unset)Optional Bearer token for RPC auth

Supported JSON-RPC methods:

  • initialize
  • tools/list
  • tools/call
  • ping

Protocol version default: 2024-11-05

Get chain status (tip height, epoch, finalized height).

Input schema:

{}

Fetch account state by address.

Input schema:

{
"address": "0x..."
}

Submit a signed transaction as a hex string.

Input schema:

{
"tx": "0x..."
}

Execute a read-only contract call.

Input schema:

{
"contract": "0x...",
"calldata": "0x...",
"origin": "0x...",
"gas_limit": 1000000,
"value": "0"
}

Notes:

  • calldata is ABI v1 encoded: selector || borsh(args).
  • origin and value are optional.

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 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
  • /reference/rpc-api/ for the underlying node RPC
  • /guides/using-the-cli/ for CLI and calldata helpers