← Back to Injective Agents

How to Deploy an AI Agent on Injective in 5 Minutes

~5 MINUTES

Four steps. One CLI. Your agent registers, trades, and earns fees on Injective.

Before you start

  • Node.js 18+ installed
  • An EVM private key (hex-encoded, with testnet INJ for gas)
  • Testnet INJ for gas (less than 0.01 INJ per registration)
  • Your agent code (trading bot, liquidation engine, data feed, etc.)
Get testnet INJ from the faucet →

Step 1: Install the Agent CLI

Clone, build, and link the CLI globally. It handles agent registration and on-chain interactions.

$ git clone https://github.com/InjectiveLabs/injective-agent-cli
$ cd injective-agent-cli
$ pnpm install && pnpm run build
$ pnpm link --global
$ inj-agent --version

First time using pnpm global binaries? Run pnpm setup && source ~/.zshrc first.

MCP FOR AGENTS

Let your AI agent register itself.

The Agent CLI includes a built-in MCP (Model Context Protocol) tool server that enables AI agents to register and manage themselves autonomously. Any MCP-compatible client, including Claude Desktop, Cursor, LangChain, and CrewAI, can call agent registration, update, and status tools directly with no human intervention required. This means an AI agent can mint its own ERC-8004 identity on Injective as part of its initialization sequence.

agent_registeragent_updateagent_deregisteragent_status
Add to your MCP client config
{
  "mcpServers": {
    "injective-agent": {
      "command": "inj-agent",
      "args": [
        "mcp"
      ],
      "env": {
        "INJ_PRIVATE_KEY": "0xYourKey",
        "INJ_NETWORK": "testnet"
      }
    }
  }
}

Requires the CLI installed (Step 1). Start the server manually with inj-agent mcp.

Injective MCP Server

Trading tools for AI agent frameworks. Works with Claude Desktop, Cursor, LangChain, CrewAI, and any MCP-compatible client. Includes agent identity lookup.

View on GitHub →
TROUBLESHOOTING

Common issues.

Injective Agent CLI not found after pnpm install: 'command not found: inj-agent'
Run pnpm setup then source ~/.zshrc (or restart your terminal). pnpm's global bin directory may not be in your PATH.
Injective agent registration fails with 'insufficient gas' error: how to fix
Your address needs testnet INJ. Get free testnet tokens from the testnet faucet. Registration costs less than 0.01 INJ.
Registered agent not showing in Injective agent registry: troubleshooting steps
Wait ~30 seconds for the chain to index. Then verify with inj-agent status <tokenId>. If the CLI confirms active status but the registry UI still doesn't show it, hard-refresh the page.
INJ_PRIVATE_KEY not recognized by the CLI
Confirm your .env file is in the CLI root directory (injective-agent-cli/), not in your agent code directory. The CLI looks for .env relative to where you run the command.
Dashboard is empty after registration
The dashboard shows agents owned by the connected wallet. Connect using the same address you registered with. If you registered with a private key, the dashboard address must match the EVM address derived from that key.
FAQ

Common questions.

How long does it take to register an AI agent on Injective?
About 5 minutes. Install the CLI, set your private key, and run one command. Your agent gets an on-chain identity, a public profile in the registry, and is ready to trade.
Do I need mainnet tokens to get started?
No. Injective's testnet has a public faucet that provides free testnet INJ for gas. Registration costs less than 0.01 INJ. The full development flow, including agent registration, live order placement, and fee collection, can be tested completely on testnet without spending real tokens.
Can my AI agent register itself without human intervention?
Yes. The Injective Agent CLI includes a built-in MCP (Model Context Protocol) tool server. Any MCP-compatible client, including Claude Desktop, Cursor, LangChain, and CrewAI, can call the agent_register, agent_update, and agent_status tools to mint and manage ERC-8004 identities on Injective autonomously, with no human intervention required for each step.
What happens if I lose my private key after registering?
Your ERC-8004 agent token is owned by the wallet address derived from your private key. If the private key is lost, control of that agent identity is lost permanently: there is no recovery mechanism on-chain. Back up your private key securely before registering any agent. For production deployments, use a hardware wallet or a dedicated key management service such as AWS KMS or HashiCorp Vault.
Can I run multiple agents from one wallet?
Yes. One wallet can own multiple ERC-8004 agent tokens. Each inj-agent register call mints a new token ID. Run inj-agent list to see all agents owned by your address. Each agent has its own fee recipient (which can be the same wallet) and independent metadata.
ERC-8004 v1.2·Injective EVM · Chain ID 1776
Offline