How to use Trytet

1. Install

# macOS (Apple Silicon)
curl -sL https://github.com/bneb/trytet/releases/latest/download/tet-darwin-aarch64.tar.gz | tar xz
sudo mv tet /usr/local/bin/

# Or build from source
git clone https://github.com/bneb/trytet.git
cd trytet
cargo build --release --bin tet

Run tet doctor to verify the install.

2. Connect your editor

tet setup writes the MCP config automatically. Run it, restart your editor, and the tools appear.

tet setup

To configure manually, add this block to your editor's MCP config file:

Claude Desktop

# ~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "trytet": {
      "command": "tet",
      "args": ["mcp"]
    }
  }
}

Cursor

# ~/.cursor/mcp.json
{
  "mcpServers": {
    "trytet": {
      "command": "tet",
      "args": ["mcp"]
    }
  }
}

agy

# ~/.agy/mcp.json
{
  "mcpServers": {
    "trytet": {
      "command": "tet",
      "args": ["mcp"]
    }
  }
}

Restart your editor. Run tet mcp --list-tools to verify 8 tools are registered: execute, snapshot, fork, js_evaluator, regex_evaluator, jmespath_evaluator, scraper, and structured_data.

3. HTTP API

Start the API server and execute payloads through the HTTP API.

tet up    # starts the API server on port 3000

# Execute a Wasm payload
curl -X POST http://localhost:3000/v1/tet/execute \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <boot-key>" \
  -d '{"payload":[...],"allocated_fuel":1000000,"max_memory_mb":64}'

# Health check
curl http://localhost:3000/health

4. SDK quickstart

// TypeScript
import { TrytetClient } from 'trytet-client';
const client = new TrytetClient({ baseUrl: 'http://localhost:3000' });
const tools = await client.listTools();
# Python
from trytet_client import TrytetClient
async with TrytetClient("http://localhost:3000") as client:
    tools = await client.list_tools()

5. Write a cartridge

Cartridges are Wasm components implementing the cartridge-v1 WIT interface. Each runs in an isolated sandbox with its own fuel and memory budget.

wit_bindgen::generate!({ world: "tool-guest", path: "wit/cartridge.wit" });

struct MyCartridge;
impl Guest for MyCartridge {
    fn execute(input: String) -> Result<String, String> {
        Ok(input.to_uppercase())
    }
}
export!(MyCartridge);

Build with cargo component build --release. Place the .wasm in dist/cartridges/ and rebuild tet.

More