wasp-mcp-server
v0.5.2MCP server that places and wires Wasp discrete-aggregation components on a live Grasshopper canvas (bridge: GH_MCP_Wasp / wasp-mcp-bridge on Yak, TCP…
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
gh_add_component Gh Add Component
Add a stock Grasshopper component to the canvas. Use for built-in components (e.g. "Number Slider", "Panel", "Mesh", "Geometry", "Construct Plane"). For Wasp components use gh_add_wasp_component instead.
| Parameter | Type | Description |
|---|---|---|
component_type * | string | Grasshopper component name (e.g. "Number Slider"). |
x * | number | Canvas x coordinate. |
y * | number | Canvas y coordinate. |
solve | Pass false to suppress the automatic recompute (v0.3 bridge batching); finish the batch with gh_expire + gh_wait_idle. |
gh_add_wasp_component Gh Add Wasp Component
Add a Wasp component (from an installed .ghuser UserObject) to the canvas. The name is resolved against the local Wasp registry with fuzzy matching: "Basic Part", "basic_part" and "stochastic" all work. Use list_wasp_components to see what is available.
| Parameter | Type | Description |
|---|---|---|
name * | string | Wasp component name or registry key (fuzzy matched). |
x * | number | Canvas x coordinate. |
y * | number | Canvas y coordinate. |
solve | Pass false to suppress the automatic recompute (v0.3 bridge batching); finish the batch with gh_expire + gh_wait_idle. |
gh_connect Gh Connect
Connect a source component output to a target component input. Params are resolved by name OR nickname, case-insensitively. For components with a single implicit output (Panel, Number Slider) simply omit source_param (optionally pass source_index=0).
| Parameter | Type | Description |
|---|---|---|
source_id * | string | Instance guid of the source component. |
target_id * | string | Instance guid of the target component. |
solve | Pass false to suppress the automatic recompute (v0.3 bridge batching); finish the batch with gh_expire + gh_wait_idle. | |
source_index | Optional explicit output index (overrides name). | |
source_param | Output param name/nickname (omit to use index or the component's single output). | |
target_index | Optional explicit input index (overrides name). | |
target_param | Input param name/nickname (omit to use index or the component's single input). |
gh_set_slider Gh Set Slider
Set a Number Slider's value (and optionally its min/max range).
| Parameter | Type | Description |
|---|---|---|
component_id * | string | Instance guid of the Number Slider. |
value * | number | New slider value. |
maximum | Optional new upper bound. | |
minimum | Optional new lower bound. | |
solve | Pass false to suppress the automatic recompute (v0.3 bridge batching); finish the batch with gh_expire + gh_wait_idle. |
gh_set_panel Gh Set Panel
Set the text of a Panel component. Multi-line content (e.g. Wasp rule grammars, one rule per line) is passed with "\n" newlines. On a v0.3+ bridge each line becomes a SEPARATE data item by default (split_lines=true); pass split_lines=false to emit the whole text as one item (v0.1 behavior). Pre-v0.3 bridges ignore the flag and always emit one item.
| Parameter | Type | Description |
|---|---|---|
component_id * | string | Instance guid of the Panel. |
text * | string | Panel text content. |
solve | Pass false to suppress the automatic recompute (v0.3 bridge batching); finish the batch with gh_expire + gh_wait_idle. | |
split_lines | One data item per line (default true on v0.3 bridges). |
gh_set_geometry_ref Gh Set Geometry Ref
Reference Rhino document geometry into a canvas param component. Points a Geometry/Mesh/Brep parameter component at existing Rhino objects by their document GUIDs.
| Parameter | Type | Description |
|---|---|---|
component_id * | string | Instance guid of the param component on the canvas. |
object_ids * | Rhino object GUID strings to reference (JSON array; a JSON-encoded string is also accepted). | |
solve | Pass false to suppress the automatic recompute (v0.3 bridge batching); finish the batch with gh_expire + gh_wait_idle. |
gh_set_plane_values Gh Set Plane Values
Set persistent plane data directly on a floating Plane param (v0.2 bridge). Removes the need for the three-panels-into-Construct-Plane workaround: place a "Plane" param with gh_add_component, then set its planes here. On a v0.1 bridge this returns an unknown-command error — use the Construct Plane path instead (create_wasp_part does this automatically).
| Parameter | Type | Description |
|---|---|---|
component_id * | string | Instance guid of the Plane param component. |
planes * | Planes (JSON array; a JSON-encoded string is also accepted), each either {"origin":[x,y,z], "xAxis":[x,y,z], "yAxis":[x,y,z]} or a flat 9-float list [ox,oy,oz, xx,xy,xz, yx,yy,yz]. xAxis/yAxis must be… | |
solve | Pass false to suppress the automatic recompute (v0.3 bridge batching); finish the batch with gh_expire + gh_wait_idle. |
gh_set_toggle Gh Set Toggle
Set a Boolean Toggle component's value (v0.2 bridge).
| Parameter | Type | Description |
|---|---|---|
component_id * | string | Instance guid of the Boolean Toggle. |
value * | boolean | New toggle state (true/false). |
solve | Pass false to suppress the automatic recompute (v0.3 bridge batching); finish the batch with gh_expire + gh_wait_idle. |
gh_delete Gh Delete
Delete components from the Grasshopper canvas (v0.2 bridge). The WaspMCP bridge component itself is never deleted; its entry comes back with {"deleted": false, "error": "cannot delete bridge"}.
| Parameter | Type | Description |
|---|---|---|
component_ids * | Instance guids of the components to remove (JSON array; a JSON-encoded string is also accepted). |
gh_group Gh Group
Group canvas components under a labeled GH_Group (v0.4 bridge). Purely visual — grouping never triggers a recompute. An id already in another group is fine (Grasshopper supports nested/overlapping groups). Ids that don't exist get per-id error entries in "results" while the rest are still grouped.
| Parameter | Type | Description |
|---|---|---|
ids * | Instance guids of the components to group (JSON array; a JSON-encoded string is also accepted). | |
name * | string | Group label shown on the canvas (e.g. "AGGREGATION"). |
color | Optional group color as [r,g,b] or [r,g,b,a] with channels 0-255, order RGBA (alpha LAST; defaults to 150, Grasshopper's own group transparency, when omitted). JSON-encoded string also accepted. |
gh_scribble Gh Scribble
Place a text scribble (canvas note) on the Grasshopper canvas (v0.4 bridge). Use for explainer notes above groups: what a stage does and why it exists. Purely visual — never triggers a recompute. Multi-line text uses "\n".
| Parameter | Type | Description |
|---|---|---|
text * | string | Note text. |
x * | number | Canvas x of the scribble pivot (top-left). |
y * | number | Canvas y of the scribble pivot. |
size | number | Font size in points (default 14). |
gh_workflow_note Gh Workflow Note
Place a workflow-level overview note: title + wrapped paragraphs (v0.4). The 'what is this whole graph doing' paragraph that individual stage explainers don't cover. Place it at the TOP-LEFT of the workflow's canvas zone, above everything. Text is wrapped to ~width chars per line with paragraph breaks preserved, so long descriptions stay in a tidy column instead of sprawling over components. Write it for someone opening the file cold: what the workflow produces, what drives it, where to look.
| Parameter | Type | Description |
|---|---|---|
text * | string | Overview body; may be long, use "\n" for paragraph breaks. |
title * | string | Short workflow title (rendered UPPERCASE with a separator). |
x * | number | Canvas x of the note's top-left. |
y * | number | Canvas y of the note's top-left. |
width | integer | Wrap column in characters (default 64). |
gh_set_nickname Gh Set Nickname
Rename a component/param instance on the canvas (v0.4 bridge). Use to make generated workflows legible: name sliders after their role ("part count", "random seed") instead of leaving bare numbers. A pure rename never recomputes the solution; the bridge only refreshes the component's layout and repaints.
| Parameter | Type | Description |
|---|---|---|
component_id * | string | Instance guid of the component to rename. |
nickname * | string | New display name. |
gh_get_output Gh Get Output
Read the output data of a component after the solution has computed. Meshes come back as {"vertices": [[x,y,z]...], "faces": [[a,b,c(,d)]...]}, planes as {"origin","xAxis","yAxis"}, transforms as 16-float row-major arrays, primitives as-is. If the result has "truncated": true, raise max_items or bake instead. Returns error "solution_running" if the GH solution is still computing — retry after a moment.
| Parameter | Type | Description |
|---|---|---|
component_id * | string | Instance guid of the component. |
param * | string | Output param name or nickname. |
max_items | integer | Truncation limit for returned items. |
gh_canvas_state Gh Canvas State
Snapshot the whole Grasshopper canvas. Returns all components (id, name, nickname, position, runtime error/warning messages), all connections, and the solution state ("idle" or "running"). Use to drift-check after a sequence of edits or to diagnose red/orange components.
gh_expire Gh Expire
Expire components and schedule a recompute of the GH solution.
| Parameter | Type | Description |
|---|---|---|
component_ids | Instance guids to expire (JSON array; a JSON-encoded string is also accepted); omit to recompute the entire document. |
gh_wait_idle Gh Wait Idle
Block until the Grasshopper solution is idle (v0.3 bridge). Replaces client-side sleep/retry loops after gh_expire or any batch of edits. The bridge polls the solution state every ~100 ms on its TCP thread (never occupying the UI thread) and answers once two consecutive reads are idle.
| Parameter | Type | Description |
|---|---|---|
timeout_ms | integer | Max wait in milliseconds (default 30000, bridge caps at 120000). |
gh_bake Gh Bake
Bake a component output's geometry into the Rhino document.
| Parameter | Type | Description |
|---|---|---|
component_id * | string | Instance guid of the component. |
param * | string | Output param name or nickname to bake. |
layer | Target Rhino layer (e.g. "WASP::AGG"); bridge default if None. |
gh_clear Gh Clear
Clear the current Grasshopper document (removes all components).
gh_save Gh Save
Save the current Grasshopper document to a .gh file.
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute destination path for the .gh file. |
gh_capture_viewport Gh Capture Viewport
Capture a Rhino viewport to an image (v0.5 bridge). Returns the PNG as MCP image content (rendered inline by any MCP client), NOT base64 text. Use to see what an aggregation or generated geometry actually looks like.
| Parameter | Type | Description |
|---|---|---|
height | Output height in px (bridge clamps to 1080). | |
viewport | Named viewport (e.g. "Perspective", "Top"); default the active viewport. | |
width | Output width in px (bridge clamps to 1920). | |
zoom_extents | boolean | Zoom to the scene extents before capturing. The camera is NOT restored afterwards — manage it yourself if you need a fixed view. |
gh_capture_canvas Gh Capture Canvas
Capture the Grasshopper canvas to an image (v0.5 bridge). Returns the PNG as MCP image content. Use to inspect canvas organization (groups, scribbles, layout) — e.g. after expand_template.
| Parameter | Type | Description |
|---|---|---|
region | Optional canvas rectangle [x, y, w, h] in canvas coordinates (JSON array; a JSON-encoded string is also accepted) — pass a zone rect from a macro/expansion result to frame one workflow. Omit for the… | |
zoom | Output scale factor (bridge clamps total pixels to 4 MP). |
gh_list_component_types Gh List Component Types
List installed Grasshopper component types (v0.3 bridge). Enumerates Grasshopper's ComponentServer proxies — every component from every installed plugin, not just Wasp. Use gh_component_schema for the full input/output signature of one type.
| Parameter | Type | Description |
|---|---|---|
category | Case-insensitive substring matched against the component category (e.g. "Wasp", "Mesh"). | |
filter | Case-insensitive substring matched against name, nickname and description (e.g. "mesh"). | |
limit | integer | Max entries returned (default 100; "total" reports the full match count). |
gh_component_schema Gh Component Schema
Describe a Grasshopper component type's full signature (v0.3 bridge). The bridge instantiates the component IN MEMORY (never on the canvas), reads its params, and discards it. Accepts a component name (exact then substring match) or a component GUID from gh_list_component_types.
| Parameter | Type | Description |
|---|---|---|
name * | string | Component type name (e.g. "Mesh Box") or GUID. |
list_wasp_components List Wasp Components
List all Wasp components installed on this machine. Each entry has: key (use with gh_add_wasp_component and macros), filename, path, category (part/connection/rule/aggregation/field/ disco/util, guessed from the name), and cached inputs/outputs docs when the component has been placed at least once this session.
| Parameter | Type | Description |
|---|---|---|
category | Optional filter (e.g. "aggregation"). |
refresh_registry Refresh Registry
Rescan %APPDATA%/Grasshopper/UserObjects for Wasp_*.ghuser files. Use after installing or updating Wasp UserObjects while the server is running.
list_templates List Templates
Enumerate the stage templates the expander can build (v0.5). Templates are mined-and-abstracted corpus subgraphs with typed SLOTS (see docs/generation-principles.md): the same paneling stage accepts a box, a loft, or a referenced surface. Sources: server/knowledge arch_patterns.json (architectural corpus) and wasp_patterns.json (Wasp corpus). No bridge round-trip.
expand_template Expand Template
Expand a stage template into a live canvas subgraph (v0.5). Binds the template's slots, places the body (stock components BY GUID from corpus dump evidence, Wasp components via the registry), wires the exact recorded param names, batches everything with solve:false + one final recompute, and applies the v0.4 organization conventions (INPUTS group with role-nicknamed sliders, stage group, explainer scribble). ALL binding problems (unknown slots, unbound required slots, kind mismatches) are reported as one typed error BEFORE anything is placed.
| Parameter | Type | Description |
|---|---|---|
template_id * | string | Template id from list_templates (e.g. "arch.attractor_scale_grid"). |
bindings | Slot bindings (JSON object; a JSON-encoded string is also accepted). Driver slots take numbers ("count": 120) or "a To b" domain text; geometry/wasp slots take a component id string, {"component_id":… | |
x | number | Canvas x of the expansion zone's origin (drivers column). |
y | number | Canvas y of the expansion zone's origin. |
create_wasp_part Create Wasp Part
Create a Wasp Basic Part wired to referenced Rhino geometry. Places Basic Part + a Mesh param referencing the given Rhino objects + a name panel, and (optionally) Connection From Plane fed either by explicit planes or by referenced planar geometry. NOTE: connection-plane Z axes (xAxis × yAxis) must point OUTWARD from the part volume, or every placement collides with the host part.
| Parameter | Type | Description |
|---|---|---|
geometry_object_ids * | Rhino GUIDs of the part's mesh geometry (JSON array; a JSON-encoded string is also accepted). | |
name * | string | Part name (fed into the part's NAME input). |
connection_object_ids | Alternative to planes — Rhino GUIDs of planar geometry to derive connections from. | |
connection_planes | Optional connection planes (JSON array; a JSON-encoded string is also accepted), each either {"origin":[x,y,z], "xAxis":[x,y,z], "yAxis":[x,y,z]} or a flat 9-float list [ox,oy,oz, xx,xy,xz, yx,yy,yz]. | |
x | number | Canvas x for the part component. |
y | number | Canvas y for the part component. |
define_rules Define Rules
Create Wasp aggregation rules from a text grammar. Places Rule From Text fed by the grammar (one rule per line) and wires the given part components into it. Wasp rule syntax here is "PART|conn_PART|conn", e.g. "P|1_P|0": connection 1 of an existing part named P hosts connection 0 of a new part P (pipe between part name and connection index, underscore between the existing-part half and the new-part half). Rules are directional — write both directions if you want both. Wasp has two OTHER rule languages this macro rejects: "TYPE>TYPE" connection-type grammars (e.g. "END>END") belong in Rules…
| Parameter | Type | Description |
|---|---|---|
grammar_text * | string | Rule grammar, one rule per line ("\n" separated), e.g. "P|1_P|0\nP|2_P|0". |
parts_component_ids * | part_id values from create_wasp_part (JSON array; a JSON-encoded string is also accepted). | |
x | number | Canvas x for the rules component. |
y | number | Canvas y for the rules component. |
run_aggregation Run Aggregation
Place and run a Wasp aggregation. Places the aggregation component (stochastic / field / graph), wires the parts and rules into it (batched, no intermediate solves on a v0.3 bridge), pulses RESET automatically so the aggregation initializes from complete inputs (corpus files use a Button; the auto-wired Boolean Toggle produces the same False→True→False edge), then recomputes and waits for the solution to settle. Mode differences (real Wasp component signatures): - "stochastic": N count slider + optional seed slider. - "field": N slider, NO seed; REQUIRES field_component_id wired into…
| Parameter | Type | Description |
|---|---|---|
count * | integer | Number of parts to aggregate (N slider; ignored for graph). |
part_ids * | part_id values from create_wasp_part (JSON array; a JSON-encoded string is also accepted). | |
rule_id * | string | rules_component_id from define_rules (stochastic/field) or a panel id with graph rules (graph). |
catalog_component_id | Optional Wasp Parts Catalog component id; its CAT output is wired into the aggregation's CAT input for stock/proportion control. LIM=False (default) = NUM values are proportional probabilities; LIM=Tr… | |
field_component_id | Component whose FIELD output drives a field-mode aggregation (required when mode="field"). | |
global_constraint_ids | Optional Wasp global-constraint components (Plane Constraint / Mesh Constraint ids; JSON array, a JSON-encoded string is also accepted). Their constraint outputs (PC / GC) are wired into the aggregati… | |
mode | string | "stochastic" (default), "field", or "graph". |
seed | Optional random seed (stochastic mode only). | |
x | number | Canvas x for the aggregation component. |
y | number | Canvas y for the aggregation component. |
get_aggregation Get Aggregation
Extract results from a computed Wasp aggregation. out="meshes": Get Part Geometry downstream, returns serialized meshes. out="transforms": Deconstruct Part downstream, returns part transforms. out="bake": bakes the aggregated geometry into the Rhino document. Idempotent: an extractor of the right type already wired to this aggregation is reused instead of placing a duplicate ("reused_extractor" in the result says which happened).
| Parameter | Type | Description |
|---|---|---|
aggregation_id * | string | aggregation_id from run_aggregation. |
layer | Rhino layer for out="bake" (default "WASP::AGG"). | |
max_items | integer | Truncation limit when returning data. |
out | string | "meshes" (default), "transforms", or "bake". |
reset_aggregation Reset Aggregation
Reset a Wasp aggregation via its RESET input (v0.2 bridge required). Wires a Boolean Toggle onto the aggregation's RESET input if none is connected yet, then pulses it false -> true -> false with a solution expiry after each step (Wasp's own examples use a Button on RESET; the toggle pulse produces the same edge). Use after changing rules/parts/ seed to force the aggregation to recompute from scratch.
| Parameter | Type | Description |
|---|---|---|
aggregation_id * | string | aggregation_id from run_aggregation (or the instance guid of any Wasp aggregation component on the canvas). |