Snak

Snak

Build powerful and secure AI agents powered by Starknet.

kasarlabs

Developer Tools
Visit Server

README

<div align="center"> <picture> <!-- For users in dark mode, load a white logo --> <source media="(prefers-color-scheme: dark)" srcset="https://github.com/KasarLabs/brand/blob/main/projects/snak/snak-logo-white-no-bg.png?raw=true"> <!-- Default image for light mode --> <img src="https://github.com/KasarLabs/brand/blob/main/projects/snak/snak-logo-black-no-bg.png?raw=true" width="150" alt="Starknet Agent Kit Logo"> </picture>

<h1>Snak (alpha)</h1>

<p> <a href="https://www.npmjs.com/package/starknet-agent-kit"> <img src="https://img.shields.io/npm/v/starknet-agent-kit.svg" alt="NPM Version" /> </a> <a href="https://github.com/kasarlabs/snak/blob/main/LICENSE"> <img src="https://img.shields.io/npm/l/starknet-agent-kit.svg" alt="License" /> </a> <a href="https://github.com/kasarlabs/snak/stargazers"> <img src="https://img.shields.io/github/stars/kasarlabs/snak.svg" alt="GitHub Stars" /> </a> <a href="https://nodejs.org"> <img src="https://img.shields.io/node/v/starknet-agent-kit.svg" alt="Node Version" /> </a> </p> </div>

A toolkit for creating AI agents that can interact with the Starknet blockchain. Available as both an NPM package and a ready-to-use NestJS server with a web interface. Supports multiple AI providers including Anthropic, OpenAI, Google Gemini, and Ollama.

Quick Start

Prerequisites

  • Starknet wallet (recommended: Argent X)
  • AI provider API key (Anthropic/OpenAI/Google Gemini/Ollama)
  • Node.js and pnpm installed

Installation

git clone https://github.com/kasarlabs/snak.git
cd snak
pnpm install

Configuration

  1. Create a .env file:
# Starknet configuration (mandatory)
STARKNET_PUBLIC_ADDRESS="YOUR_STARKNET_PUBLIC_ADDRESS"
STARKNET_PRIVATE_KEY="YOUR_STARKNET_PRIVATE_KEY"
STARKNET_RPC_URL="YOUR_STARKNET_RPC_URL"

# AI Provider configuration (mandatory)
AI_PROVIDER_API_KEY="YOUR_AI_PROVIDER_API_KEY"
AI_MODEL="YOUR_AI_MODEL"
AI_PROVIDER="YOUR_AI_PROVIDER"

# NestJS server configuration
SERVER_API_KEY="YOUR_SERVER_API_KEY"
SERVER_PORT="YOUR_SERVER_PORT"

#Node Configuration # optional by default : production 
NODE_ENV="YOUR_NODE_ENV"
# Agent additional configuration

POSTGRES_USER="YOUR_POSTGRES_USER"
POSTGRES_PASSWORD="YOUR_POSTGRES_PASSWORD"
POSTGRES_ROOT_DB="YOUR_POSTGRES_ROOT_DB"
POSTGRES_HOST="YOUR_POSTGRES_HOST"
POSTGRES_PORT="YOUR_POSTGRES_PORT"
  1. Create your agent.config.json
{
  "name": "Your Agent name",
  "bio": "Your AI Agent Bio",
  "lore": ["Some lore of your AI Agent 1", "Some lore of your AI Agent 1"],
  "objectives": [
    "first objective that your AI Agent need to follow",
    "second objective that your AI Agent need to follow"
  ],
  "knowledge": [
    "first knowledge of your AI Agent",
    "second knowledge of your AI Agent"
  ],
  "interval": "Your agent interval beetween each transaction of the Agent in ms,",
  "chat_id": "Your Agent Chat-id for isolating memory",  
  "autonomous" : "Your agent is autonomous or not",
  "mcp": "Your agent can use mcp or not",
  "internal_plugins": [
    "Your first internal plugin",
    "Your second internal plugin"
  ],
  "external_plugins": [
    "Your first external plugin",
    "Your second external plugin"
  ]
}

You can simply create your own agent configuration using our tool on starkagent

Usage

Prompt Mode

Run the promt:

# start with the default.agent.json
pnpm run start

# start with your custom configuration
pnpm run start --agent="name_of_your_config.json"

Server Mode

Run the server :

# start with the default.agent.json
pnpm run start:server

# start with your custom configuration
pnpm run start:server --agent="name_of_your_config.json"

Available Modes

Interactive Mode Autonomous Mode
Prompt Mode
Server Mode

Implement Snak in your project

  1. Install snak package
#using npm
npm install @starknet-agent-kit

# using pnpm 
pnpm add @starknet-agent-kit
  1. Create your agent instance
import { StarknetAgent } from 'starknet-agent-kit';

const agent = new StarknetAgent({
  provider: new RpcProvider({ nodeUrl: process.env.STARKNET_RPC_URL }),
  accountPrivateKey: process.env.STARKNET_PRIVATE_KEY,
  accountPublicKey: process.env.STARKNET_PUBLIC_ADDRESS,
  aiModel: process.env.AI_MODEL,
  aiProvider: process.env.AI_PROVIDER,
  aiProviderApiKey: process.env.AI_PROVIDER_API_KEY,
  signature: 'key',
  agentMode: 'auto',
  agentconfig: y,
});

const response = await agent.execute("What's my ETH balance?");

Actions

To learn more about actions you can read this doc section. A comprehensive interface in the Kit will provide an easy-to-navigate catalog of all available plugins and their actions, making discovery and usage simpler.

To add actions to your agent you can easily follow the step-by-steps guide here

Contributing

Contributions are welcome! Feel free to submit a Pull Request.

License

MIT License - see the LICENSE file for details.


For detailed documentation visit docs.kasar.io

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
MCP Package Docs Server

MCP Package Docs Server

Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.

Featured
Local
TypeScript
Claude Code MCP

Claude Code MCP

An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.

Featured
Local
JavaScript
@kazuph/mcp-taskmanager

@kazuph/mcp-taskmanager

Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.

Featured
Local
JavaScript
Linear MCP Server

Linear MCP Server

Enables interaction with Linear's API for managing issues, teams, and projects programmatically through the Model Context Protocol.

Featured
JavaScript
mermaid-mcp-server

mermaid-mcp-server

A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images.

Featured
JavaScript
Jira-Context-MCP

Jira-Context-MCP

MCP server to provide Jira Tickets information to AI coding agents like Cursor

Featured
TypeScript
Linear MCP Server

Linear MCP Server

A Model Context Protocol server that integrates with Linear's issue tracking system, allowing LLMs to create, update, search, and comment on Linear issues through natural language interactions.

Featured
JavaScript
Sequential Thinking MCP Server

Sequential Thinking MCP Server

This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.

Featured
Python