Skip to main content
Glama

treegen

Stylized low-poly tree generator. Deterministic — the same seed always produces the same tree — and game-ready: exports GLB or OBJ with sane triangle counts.

treegen

Three ways to use it:

Surface

Entry point

Browser app

npm run dev

MCP server (stdio)

npm run mcp

Library

import { buildTree } from 'treegen/generator'

It is also hosted as a remote MCP server at https://mcp.andreglegg.no/treegen, so no install is needed:

claude mcp add --transport http treegen https://mcp.andreglegg.no/treegen

Library use

The generator is DOM-free and runs in Node or the browser. Only three is a runtime dependency — everything else here is dev-only.

npm install github:andreglegg/treegen
import { buildTree, meshStats, presets } from 'treegen/generator';
import { exportGlb } from 'treegen/export';

const tree = buildTree({ ...presets.oak, seed: 42, detail: 1 });
console.log(meshStats(tree));        // { meshes, triangles }
const glb = await exportGlb(tree);   // ArrayBuffer — works in Node and browser

exportGlb shims FileReader when it is missing, so the same code path works in Node and in the browser.

Related MCP server: instant-meshes-mcp

Parameters

Six presets (meadow, orchard, pine, oak, acacia, willow) and five species silhouettes (round, oak, acacia, willow, pine). Everything is bounded — see paramShape in mcp/server.js for ranges.

detail drives the triangle budget, at the generator's default foliage density:

detail

triangles

intent

0

~1k

low-poly

1

~3k

game-ready

2

~7k

hero

leafDensity moves those numbers a lot — each foliage cluster is its own mesh, so the oak preset (density 46) roughly doubles the detail-1 count. Read meshStats() rather than assuming.

Consumers

mcp/generator.js and mcp/export.js are the shared core. Anything that depends on them should pull this repo as a git dependency rather than copying the files — the copies drift.

A
license - permissive license
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • MCP server for Flux AI image generation

  • MCP server for Wan AI video generation

  • Generate, edit, and deploy immersive 3D/WebGL web projects from any MCP assistant.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/andreglegg/treegen'

If you have feedback or need assistance with the MCP directory API, please join our Discord server