TypeScriptADK-TS

MCP ATP

Interact with the IQ AI Agent Tokenization Platform

Usage with ADK TypeScript

import {McpAtp} from "@iqai/adk";

const toolset = McpAtp({
  env: {
    ATP_WALLET_PRIVATE_KEY: process.env.WALLET_PRIVATE_KEY,
    ATP_API_KEY: process.env.ATP_API_KEY,
  },
})
const tools = await toolset.getTools()
import {McpToolset} from "@iqai/adk";

const toolset = new McpToolset({
  name: "ATP MCP Client",
  description: "Client for the @iqai/mcp-atp server",
  transport: {
    mode: "stdio",
    command: "pnpm",
    args: ["dlx", "@iqai/mcp-atp"],
    env: {
      ATP_WALLET_PRIVATE_KEY: process.env.WALLET_PRIVATE_KEY,
      ATP_API_KEY: process.env.ATP_API_KEY,
      PATH: process.env.PATH || "",
    },
  },
})

const tools = await toolset.getTools()
{
  "mcpServers": {
    "atp-server": {
      "command": "pnpm",
      "args": ["dlx", "@iqai/mcp-atp"],
      "env": {
        "ATP_WALLET_PRIVATE_KEY": "your_wallet_private_key_here",
        "ATP_API_KEY": "your_iq_atp_api_key_here"
      }
    }
  }
}

Features

  • Interact with the IQ AI Agent Tokenization Platform
  • Fetch statistics and details for a specific AI agent
  • Retrieve the user's current holdings in ATP AI tokens
  • Purchase AI agent tokens using IQ as the base currency
  • Sell AI agent tokens back to the protocol
  • Retrieve logs for a specific AI agent, with pagination
  • Add a new log entry for a specific AI agent

Available Tools

ATP_AGENT_STATS
tokenContract:string

Description

Get statistics and details of a given AI agent on the ATP platform.

ATP_GET_AGENTS
sort:stringlimit:integer

Description

Retrieve a list of AI agents from the ATP platform with optional sorting and limiting.

ATP_GET_AGENT_LOGS
agentTokenContract:stringpage:integerlimit:integer

Description

Retrieve logs for a specific AI agent, with pagination.

ATP_ADD_AGENT_LOG
agentTokenContract:stringcontent:stringtxHash:stringchainId:integer

Description

Add a new log entry for a specific AI agent. Requires API key as a parameter.

ATP_BUY_AGENT
tokenContract:stringamount:string

Description

Buy AI agent tokens using IQ as the base currency.

ATP_SELL_AGENT
tokenContract:stringamount:string

Description

Sell AI agent tokens back to the protocol.

ATP_GET_AGENT_POSITIONS

No parameters

Description

Retrieve the positions of the user's agent tokens.

Environment Variables

  • ATP_WALLET_PRIVATE_KEY: Required for position and trading operations
  • ATP_API_KEY: Required for certain backend API calls

Usage Examples

  • "Add log for agent 0x1234...5678: Just executed weekly yield distribution"
  • "Create log entry for Frax God: Updated pricing model" (Works only if token contract found in previous messages)
  • "Log for agent 0x1234...5678 with transaction hash 0xabc...def: Distribution complete"

Response Format

Actions return structured responses including:

āœ” Transaction status & hash (for trades) šŸ”— āœ” Formatted token amounts šŸ’² āœ” Error messages when applicable ⚠ āœ” Agent addresses and statistics šŸ· āœ” Formatted agent logs šŸ“„

Error Handling

Error Scenarios

The plugin handles various error scenarios gracefully.

🚨 Invalid token contracts šŸ’ø Insufficient balances šŸ”„ Transaction failures 🌐 Network issues šŸ›‘ Input validation errors šŸ”‘ Missing API key for log creation