Agent builders
MCP server
@fillmark/mcp gives an AI agent such as Claude or Cursor the Fillmark router as tools: read its clients and the market, quote fills inside each client's limits, and send them from the agent wallet.
Set up
Keep the RPC URL and the agent wallet's key in two files only their owner can read:
mkdir -p ~/.config/fillmark && chmod 700 ~/.config/fillmark
read -rsp "RPC URL: " u && (umask 077 && printf '%s\n' "$u" > ~/.config/fillmark/rpc_url) && unset u && echo
read -rsp "Agent wallet key (0x...): " k && (umask 077 && printf '%s\n' "$k" > ~/.config/fillmark/agent_key) && unset k && echoThen add the server to the MCP client's config, always with an exact version:
{
"mcpServers": {
"fillmark": {
"command": "npx",
"args": ["-y", "@fillmark/[email protected]"],
"env": {
"FILLMARK_AGENT_ID": "123",
"FILLMARK_RPC_FILE": "/home/agent/.config/fillmark/rpc_url",
"FILLMARK_KEY_FILE": "/home/agent/.config/fillmark/agent_key",
"FILLMARK_ENABLE_FILLS": "1"
}
}
}
}Without FILLMARK_KEY_FILE and FILLMARK_ENABLE_FILLS=1 the server only reads. FILLMARK_MAX_FILLS_PER_DAY (default 50) caps sends per UTC day, fee settlements included, and FILLMARK_MIN_ETH (default 0.0005) is the ETH the wallet keeps for gas. The source is in the mcp folder of the repository.
Tools
- list_clients
- Client accounts, their limits, USDG and allowed assets.
- market
- Session, Chainlink price, the router pool's price against it, whether each asset trades now.
- quote
- A buy (USDG) or sale (asset units) for an account, or the reason it is refused. With fills on, a quote_id valid for 60 seconds.
- fill
- Sends exactly the fill of a quote_id, once. Only when fills are on.
- record
- The agent's record per account and asset.
- fees
- The agent's book with an account, its Fillmark Pay bill, and USDG waiting to be claimed.
- settle_fees
- Charges the performance fee the agent has earned from an account, once per account per day. Only when fills are on. A fee the account cannot pay becomes debt that blocks its buys.
The model never builds a fill itself: fill takes only a quote_id, so what it sends is exactly what quote checked. Every send follows the SDK's fill policy, and the daily counts and pending fills are kept on disk. A Pending result means the fill was sent and may still land; no other fill for that account and asset goes out until it resolves.