Asentum

AI Agents (MCP)

Asentum MCP in OpenClaw and Personal Agents

OpenClaw and other self-hosted agents · Estimated read time: 6 minutes

OpenClaw supports MCP servers natively. It keeps them in its own registry under mcp.servers in ~/.openclaw/openclaw.json, and the openclaw mcp commands manage that registry. Note the key: it is mcp.servers, not the mcpServers block other clients use. The steps below follow the OpenClaw docs; the last section covers any other self-hosted agent that speaks MCP.

Prerequisites

  • Node.js 18.17 or newer. Check with node --version. The current LTS release from nodejs.org is a good choice.
  • OpenClaw installed, with the Gateway set up. The MCP server runs on the same machine as the Gateway, so Node.js must be installed there (on your VPS, if that is where the Gateway runs).
  • No account and no key for reads, contract validation, simulation and docs. A key is only needed if you want the agent to send testnet transactions.

Check the package runs before you wire it into a client:

npx -y @asentum/mcp --version

It should print a version such as 0.1.0. The first run downloads the package, which takes a few seconds.

First: agents you can message

A personal agent is often reachable from chat apps such as WhatsApp or Telegram. Anyone who can message the agent can ask it to use its tools. Start read-only, and if you add a key, follow the write steps below: a dedicated wallet with a few test ASE, and the signing tools filtered out of any agent that strangers can reach.

Add it with the CLI

Commands that change the MCP registry need the Gateway stopped. Stop it, add the server, then start it again:

openclaw gateway stop

openclaw mcp add asentum \
  --command npx \
  --arg -y \
  --arg @asentum/mcp

openclaw gateway start

Each --arg is one argument, in order. This is the read-only setup: chain reads, contract validation and simulation, and the docs.

Or edit openclaw.json

The same server written by hand. The file is JSON5, so comments and trailing commas are fine. Merge the mcp block into your existing config rather than replacing the file:

~/.openclaw/openclaw.json

{
  mcp: {
    servers: {
      asentum: {
        command: "npx",
        args: ["-y", "@asentum/mcp"],
        transport: "stdio",
        enabled: true,
      },
    },
  },
}

With Gateway hot reload on, the next turn picks up the change. If it does not, run openclaw gateway restart.

Over HTTP

If you would rather run the MCP server as its own long-lived process (for example as a service next to the Gateway, or for several agents), start it in HTTP mode and register the URL. HTTP mode leaves the signing tools out.

# keep this running (a systemd service, tmux, etc.)
npx -y @asentum/mcp --http 3333      # serves http://127.0.0.1:3333/mcp

Set the transport explicitly. OpenClaw treats a URL server as sse unless told otherwise, and this server speaks streamable HTTP:

openclaw gateway stop
openclaw mcp add asentum \
  --url http://127.0.0.1:3333/mcp \
  --transport streamable-http
openclaw gateway start

~/.openclaw/openclaw.json

{
  mcp: {
    servers: {
      asentum: {
        url: "http://127.0.0.1:3333/mcp",
        transport: "streamable-http",
        enabled: true,
      },
    },
  },
}

Keep it on 127.0.0.1. For a server other machines reach, see Running it as a shared HTTP server.

Enable writes with a testnet key

Writes (deploy_contract, call_contract, send_ase) need a signing key. Give the agent its own testnet wallet, not the one you use day to day. The safest way is a key file: the key never appears in the client's config, in your shell history or in a screenshot of your settings.

1. Create a fresh testnet key. This writes a random 32-byte seed to .asentum-mcp/testnet.key in your home folder, readable only by you, and prints the full path. It refuses to overwrite a key that is already there. Works in macOS and Linux terminals, PowerShell and Command Prompt:

node -e "const fs=require('fs'),path=require('path'),dir=path.join(require('os').homedir(),'.asentum-mcp'),f=path.join(dir,'testnet.key');fs.mkdirSync(dir,{recursive:true});fs.writeFileSync(f,require('crypto').randomBytes(32).toString('hex'),{mode:0o600,flag:'wx'});console.log(f)"

You can also use the 64 hex character seed of a new account you made in the Asentum browser extension: save it as the only content of that file instead.

2. Point the server at it with ASENTUM_KEY_FILE, using the full path the command printed (snippets below). An absolute path is safest; a leading ~/ also works.

3. Fund it with a little test ASE. Ask the agent "Show my Asentum wallet". get_wallet prints the ase1 address. Send it a few test ASE from your usual testnet wallet, or use the faucet (see Get Test ASE). A few ASE is plenty for deploys and calls.

Try a dry run first

Add ASENTUM_DRY_RUN=1 to the env while you get used to it. The server signs but never submits, so you can see exactly what the agent would send. Remove it when you are happy.

Prefer not to use a file? ASENTUM_PRIVATE_KEY takes the 64 hex character seed directly. It works the same way, but the key then sits in plain text in the client's config file, so the key file is the better choice. If both are set, ASENTUM_PRIVATE_KEY wins.

Run the key command on the Gateway machine, then pass the path with --env. OpenClaw starts MCP servers as child processes and does not hand them your shell's variables, so the env must be on the server entry:

openclaw gateway stop

openclaw mcp unset asentum        # if you added the read-only one first

openclaw mcp add asentum \
  --command npx \
  --arg -y \
  --arg @asentum/mcp \
  --env ASENTUM_KEY_FILE=/home/you/.asentum-mcp/testnet.key \
  --env ASENTUM_DRY_RUN=1

openclaw gateway start

~/.openclaw/openclaw.json

{
  mcp: {
    servers: {
      asentum: {
        command: "npx",
        args: ["-y", "@asentum/mcp"],
        transport: "stdio",
        env: {
          ASENTUM_KEY_FILE: "/home/you/.asentum-mcp/testnet.key",
          ASENTUM_DRY_RUN: "1", // remove to really send
        },
        enabled: true,
      },
    },
  },
}

Keep the signing tools away from public chats

OpenClaw can filter which tools of a server the agent sees, with --include and --exclude (or toolFilter in the config). For an agent that other people can message, leave the three tools that spend out:

openclaw mcp add asentum \
  --command npx \
  --arg -y \
  --arg @asentum/mcp \
  --exclude 'deploy_contract,call_contract,send_ase'

~/.openclaw/openclaw.json

asentum: {
  command: "npx",
  args: ["-y", "@asentum/mcp"],
  transport: "stdio",
  toolFilter: {
    exclude: ["deploy_contract", "call_contract", "send_ase"],
  },
},

The simplest rule: no key at all on an agent that is reachable by anyone but you.

Check it is connected

openclaw mcp list                     # the saved servers
openclaw mcp status --verbose         # resolved config for each, no network calls

openclaw gateway stop
openclaw mcp doctor asentum --probe   # actually starts it and lists its tools
openclaw gateway start

Then message your agent:

What's the Asentum chain status?

It should call get_chain_status and reply with chain id 1423, the finalized and tip heights and how far finality is behind. With a key, "Show my Asentum wallet" should report writesEnabled: true and the ase1 address.

Example prompts

Some things to try once it is connected. Replace the ase1 address and the hash with your own.

Deploy an ARC-20 token

Create an ARC-20 token called Demo (DMO) with 1,000,000 supply and
18 decimals. Validate it, simulate a transfer, then deploy it to the
Asentum testnet and show me the token's ase1 address and receipts.

Uses the create_arc20_token prompt, validate_contract, simulate_call and, with a key, deploy_contract.

Validate my contract

Validate the Asentum contract in contracts/counter.js and fix anything
it flags. Then simulate increment() from two different senders and
show me what ends up in storage.

Runs on a local copy of the VM the nodes use. Nothing touches the chain and no key is needed.

Build a dapp frontend

Build a Next.js frontend for my contract at
ase1v0myp2de3dhj3crvkhxqlnjaw2mvp64a9efkpl with @asentum/connect:
a connect button, free reads of its view methods, and signed writes
that show "in block" and then "final".

Uses the build_dapp_frontend prompt, get_contract for the real method names and the wallet connect docs.

Check a transaction's finality

Is Asentum transaction 0x<transaction hash> final yet? Wait until
it is, then tell me what it did and which events it emitted.

Uses get_receipt with waitFor: "final" and get_transaction to decode it.

A personal agent is also good at watching things. For example: "Every morning, tell me if Asentum finality is more than 10 blocks behind the tip."

Troubleshooting

  • openclaw mcp add refuses. The Gateway is running. Stop it with openclaw gateway stop, make the change, then openclaw gateway start.
  • The agent does not see new settings. Reload the process that owns the connection: openclaw gateway restart. A CLI openclaw mcp reload does not reset a separate Gateway.
  • A URL server will not connect. Check the entry says transport: "streamable-http"; without it OpenClaw uses sse. Check the server is up with curl http://127.0.0.1:3333/health, which answers {"ok":true}.
  • Node not found on the Gateway machine. The Gateway service may run with a smaller PATH than your shell. Use the full path to npx as --command (from which npx).
  • An env variable is ignored. OpenClaw blocks some runtime variables such as NODE_OPTIONS for MCP servers. The ASENTUM_* variables are not affected; set them on the server entry, not in your shell.
  • "npx: command not found" or an old Node. Install Node.js 18.17 or newer and open a new terminal. If you use nvm, fnm or Volta, a GUI app may not see that Node: use the full path to npx (from which npx on macOS and Linux, where npx on Windows) as the command.
  • Writes refuse. No key is configured, the key file path is wrong, ASENTUM_DISABLE_WRITES is set, or the RPC is not testnet 1423. Ask the agent to run get_wallet: it says which.
  • "insufficient balance for value plus gas". The agent's wallet needs test ASE. See Get Test ASE.
  • HTTP 429 from the chain. The public gateway allows about 25 requests a second per IP. For heavy use, point ASENTUM_RPC_URL at your own node (see Run Your Own RPC).

Any MCP-capable agent

Other self-hosted agents and agent frameworks name things differently, but almost all of them take one of these two shapes. Check your agent's docs for where the block goes.

stdio (the agent starts the server)

The common mcpServers form:

{
  "mcpServers": {
    "asentum": {
      "command": "npx",
      "args": ["-y", "@asentum/mcp"],
      "env": {
        "ASENTUM_KEY_FILE": "/absolute/path/to/testnet.key"
      }
    }
  }
}

Leave env out for read-only.

Streamable HTTP (the server runs on its own)

npx -y @asentum/mcp --http 3333

Then point the agent at http://127.0.0.1:3333/mcp with the transport set to streamable HTTP (some agents call it http, streamable-http or streamableHttp; not sse). The server is stateless and answers POST /mcp only, which the spec allows.

If your agent has no MCP support at all, it cannot use this server directly. The same building blocks are available as code through the SDK and the Node API.

Read next