How to Deploy an AI Agent on Injective in 5 Minutes
~5 MINUTESFour 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.)
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 --versionFirst time using pnpm global binaries? Run pnpm setup && source ~/.zshrc first.
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.
{
"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 →Common issues.
Injective Agent CLI not found after pnpm install: 'command not found: inj-agent'
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
Registered agent not showing in Injective agent registry: troubleshooting steps
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
.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.