AgentKit provides a simple way to create AI agents that can interact with blockchain networks. This guide will show you how to get started using our CLI tools.

Create Your First Agent

This section will guide you through the process of creating a new AgentKit project using the TypeScript CLI. Through this process, you will generate a NextJs fullstack application, or a Model Context Protocol server to use with Claude Desktop.

Prerequisites

Before you begin, make sure you have:

  1. Node.js 18 or later installed – Download here
  2. npm 9 or later installed (comes bundled with Node.js)

Check your Node.js and npm versions:

node --version  # Should be 18+
npm --version   # Should be 9+

Creating a New Project

The fastest way to get started is using our TypeScript CLI:

npm create onchain-agent@latest

This command will guide you through an interactive setup process:

  1. Choose your AI Framework

  2. Project Template (based on your framework choice)

    • LangChain & Vercel AI SDK: Full-stack Next.js application with:
      • React for the frontend
      • Tailwind CSS for styling
      • ESLint for code quality
      • TypeScript configuration
    • Model Context Protocol: MCP server project for Claude Desktop integration
  3. Blockchain Network

    • Select from preconfigured networks (Base, EVM, Solana, etc.)
    • Optionally specify custom chain IDs
  4. Wallet Provider

    • CDP Smart Wallets: Account abstraction with advanced features
    • CDP Server Wallets: Secure server-side wallet management
    • Viem: Local private key management
    • Privy Server Wallets: Managed custody solution
    • Privy Delegated Embedded Wallets: Client-side wallets with delegation

Running Your Project

Follow the instructions displayed in your CLI to get running. Be sure to check:

  • The .env-local file in your project root for instructions on obtaining API keys
  • Your generated project’s README for additional setup details and customization options

Component Generation

The CLI also installs the agentkit command globally, allowing you to generate additional components.

These generators will create TypeScript files in your current working directory.

# Available generators
agentkit generate wallet-provider    # Generate a custom wallet provider
agentkit generate action-provider    # Generate a custom action provider
agentkit generate prepare            # Generate framework-agnostic AgentKit setup
agentkit generate create-agent       # Generate framework-specific agent creation

Note: If the above commands print the error agentkit: not found, ensure the agentkit cli is installed by running the following command:

npm install -g create-onchain-agent/@latest