Skip to main content
Glama
Axel-Jalonen

lego-mcp

by Axel-Jalonen

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
LEGO_MCP_HOMENoOptional path to a directory for storing build files. If not set, defaults to the repo's builds/ directory or ~/.lego-mcp/builds.

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
new_buildA

Start a fresh build on an empty baseplate of width x depth studs. Replaces the current build (previous one stays saved on disk).

list_partsA

List every part in the catalog (the ONLY placeable pieces) and all colors. Sizes are studs; height is in plates (brick=3, plate/tile=1). Tiles have smooth tops. Slopes have studs only on their non-sloped rows (at rotation 0 the slope descends toward +y; rotate 90/180/270 to face it). Baseplates have studs on top, nothing underneath, and only go at z=0.

place_brickA

Place a part with its minimum-x,y corner at stud (x,y), bottom at plate height z (z=0 on the ground; on top of a brick placed at z=0 means z=3). rotation is 0, 90, 180 or 270 (90/270 swap the footprint; slopes descend toward +y at 0 and rotate with the piece). Fails with an explanation if the placement collides, floats, or leaves the build area.

remove_brickA

Remove a piece by id. Refused if other pieces would be left floating.

get_buildA

Current build state: piece list with positions, inventory, dimensions.

view_layersA

Top-down ASCII map of each plate layer (pieces shown by id, '.' empty). Optionally limit to plate range [z_from, z_to).

load_buildA

Load a previously saved build by name (see saved .json files in builds/). The save is re-validated piece by piece on load.

export_buildA

Export the build. fmt='ldraw' writes builds/.ldr (openable in BrickLink Studio / LeoCAD); fmt='blender' writes builds/_blender.py, a bpy script that constructs the model in Blender.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

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/Axel-Jalonen/lego-mcp'

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