MCP setup
@hartii/agent-mcp is a stdio MCP server,
served straight from hartiilabs.com (packed from source on every deploy; sha256 at
hartii-agent-mcp.tgz.sha256). Node 20+ runs it as
npx -y https://hartiilabs.com/downloads/hartii-agent-mcp.tgz, with HARTII_AGENT_KEY_FILE (a local file holding the agent wallet's
private key — see "Generate a key" below) or HARTII_AGENT_KEY (the raw key itself) and
HARTII_VAULT (the vault address) set. It never builds calldata itself — every tool calls the
Agent API, simulates the result with a read-only quai_call from the agent's own
address, and only then signs and sends.
Hartii never generates, sees, or handles an agent's private key — not in the browser, not on Hartii's servers. The only thing the AgentVault wizard at hartiilabs.com/agent ever accepts is the agent's public address.
Generate a key
On the machine that will run your agent:
npx -y https://hartiilabs.com/downloads/hartii-agent-mcp.tgz keygenThis generates a fresh key entirely on that machine, grinds it in-zone (see below), writes it
to ~/.hartii-agent/agent.key by default (owner-only file permissions; --file <path> for a
different location, --force to overwrite), and prints only the derived address and the file
path — never the key itself. Paste that address (not the file) into the vault wizard.
A Quai-specific detail: the agent key must be a Cyprus-1 address
Quai Network is sharded into zones, and a vault's agent key must resolve to an address in
Cyprus-1 — the only zone AgentVault and the rest of Hartii operate in. A randomly generated
private key lands in Cyprus-1 only about 1 in 512 times, so a key is never usable as-is straight
off of a plain random-bytes generator. npx -y https://hartiilabs.com/downloads/hartii-agent-mcp.tgz keygen handles this for you
already: it grinds keys locally until it finds one where both quais.isQuaiAddress(address) and
quais.getZoneForAddress(address) === quais.Zone.Cyprus1 are true. @hartii/agent-mcp's server
itself does not generate or validate keys at startup beyond that zone check — it signs with
whatever key HARTII_AGENT_KEY_FILE / HARTII_AGENT_KEY resolves to, and refuses to start
(rather than fail every send later) if that key is out of zone.
Env vars
| Variable | Required | Default |
|---|---|---|
HARTII_AGENT_KEY_FILE | one of these two | — |
HARTII_AGENT_KEY | one of these two | — |
HARTII_VAULT | yes | — |
HARTII_API | no | https://hartiilabs.com |
HARTII_RPC | no | https://rpc.quai.network/cyprus1 |
Set exactly one of HARTII_AGENT_KEY_FILE or HARTII_AGENT_KEY — setting both is a startup error.
Claude Code / Claude Desktop
{
"mcpServers": {
"hartii-agent": {
"command": "npx",
"args": ["-y", "https://hartiilabs.com/downloads/hartii-agent-mcp.tgz"],
"env": { "HARTII_AGENT_KEY_FILE": "/home/you/.hartii-agent/agent.key", "HARTII_VAULT": "0x..." }
}
}
}Codex
[mcp_servers.hartii-agent]
command = "npx"
args = ["-y", "https://hartiilabs.com/downloads/hartii-agent-mcp.tgz"]
env = { HARTII_AGENT_KEY_FILE = "/home/you/.hartii-agent/agent.key", HARTII_VAULT = "0x..." }Tools
hartii_status, hartii_quote, hartii_buy, hartii_sell, hartii_launch_token, hartii_swap,
hartii_add_liquidity, hartii_remove_liquidity, hartii_launch_nft, hartii_fish_cast,
hartii_fly_start, hartii_fly_next — the full README (published with the package) documents
every input.
Full setup + security notes: the package's own README.md, inside
the tarball.