egon-mcp

v0.2.0
egon-mcp Checked 2 days ago Published 16 days ago

MCP server for creating, editing, validating and rendering Egon.io domain stories

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

create_story Create domain story

Creates a new, empty domain story with Egon's default icon set and returns its storyId. Use build_story instead to create a whole story from sentences in one call.

ParameterTypeDescription
title *stringStory title. Egon 3 reads the title from the file name, so saved files are named after it.
descriptionstringText Egon shows under the title.
scopeobjectScope of the story as shown in Egon's properties panel.

build_story Build domain story from sentences

Creates a complete domain story in one call from numbered sentences ("Customer tells Order to Clerk"), then lays it out. Each sentence becomes one step, except that sentences given the number of an earlier step share it. Actors with the same name are one element. Each sentence draws its own work object, except that the first sentence naming a declared work object uses it and reuseWorkObject continues the previous one. Returns the storyId, the narrative and any validation issues.

ParameterTypeDescription
sentences *arrayThe steps of the story in order.
title *stringStory title. Egon 3 reads the title from the file name, so saved files are named after it.
actorsarrayActors to create first, to choose their icon or color.
annotationsarrayNotes for variations, rules and open questions.
descriptionstringText Egon shows under the title.
groupsarrayBoxes around elements that belong together, by members or by steps as add_group takes them. Groups by steps come out the same in any order: fewer steps go before more, and a group by steps takes in ev…
layoutbooleanArrange elements automatically (default true).
scopeobjectScope of the story as shown in Egon's properties panel.
workObjectsarrayWork objects to create first, to choose their icon or color. The first sentence that names one uses it, and a workObjectIcon on that sentence replaces its icon; later sentences draw new ones with the…

open_story Open story file

Opens an Egon story file (.egn, .egn.svg, or legacy .dst / .dst.svg) from the workspace directory and returns its storyId.

ParameterTypeDescription
path *stringPath relative to the workspace root, as listed by list_story_files.

import_story Import story from text

Opens a story from the text of an .egn, .dst or .egn.svg file, for example one the user pasted. Use open_story for files in the workspace.

ParameterTypeDescription
content *stringThe full file content.
fileNamestringOriginal file name; decides how the content is read and gives the title for old files.

list_stories List open stories

Lists the stories open in this session with their storyId, title, file path, size and whether they have unsaved changes.

close_story Close story

Closes an open story without saving it. Save first with save_story if it has unsaved changes.

ParameterTypeDescription
storyId *stringId of an open story, as returned by create_story, build_story, open_story or list_stories.

save_story Save story to file

Writes a story into the workspace directory. For .egn and .egn.svg files it opens the written file the way open_story would: groupChangesOnOpen lists the group changes that would make, such as a shape in no group joining the smallest group box over its top-left corner, and reopenError says why the file would not open. Egon itself only reads who is in a group. The extension picks the format: .egn (Egon file), .egn.svg (image with the story embedded, importable by Egon), .svg (image only) or .md (narrative). Without a path the story goes back to the file it was opened from, or to "<title>.egn".…

ParameterTypeDescription
storyId *stringId of an open story, as returned by create_story, build_story, open_story or list_stories.
layoutstring.egn layout: egon3 works in egon.io 3.x and Egon 4; egon4 also keeps title and scope. Default: when saving back to the file the story came from or was last saved to, the layout it last had there; else…
overwritebooleanReplace an existing file that this story did not open or write, or that changed since it did. Ask the user first.
pathstringTarget path relative to the workspace root.

list_story_files List story files

Lists Egon story files (.egn, .egn.svg, .dst, .dst.svg) in the workspace directory, skipping node_modules and hidden folders.

ParameterTypeDescription
directorystringSubdirectory to search, relative to the workspace root.

get_story Get story contents

Returns the story as actors, work objects, activities (with step numbers and names and ids of both ends), groups, annotations (with attachedTo and attachedToId for the element a note is attached to), the numbered sentences and a count of validation issues.

ParameterTypeDescription
storyId *stringId of an open story, as returned by create_story, build_story, open_story or list_stories.
includePositionsbooleanAlso return x/y of each shape.

narrate_story Narrate story

Reads the story back as numbered sentences in Markdown, the way Egon's replay walks through it. Use it to check that the story says what the domain expert said.

ParameterTypeDescription
storyId *stringId of an open story, as returned by create_story, build_story, open_story or list_stories.

validate_story Validate story

Checks a story for problems: errors that break the import into Egon (dangling references, actor-to-actor activities, unknown icons) and warnings that hurt readability (unnamed elements, unlabeled activities, gaps in step numbers, unconnected or overlapping elements, group boxes that enclose shapes outside the group or overlap another group).

ParameterTypeDescription
storyId *stringId of an open story, as returned by create_story, build_story, open_story or list_stories.

set_story_info Set title, description or scope

Changes the title, description or scope of a story. Pass scope: null to clear it.

ParameterTypeDescription
storyId *stringId of an open story, as returned by create_story, build_story, open_story or list_stories.
descriptionstringText Egon shows under the title.
scope
titlestringStory title. Egon 3 reads the title from the file name, so saved files are named after it.

add_actor Add actor

Adds an actor: a person, group or system that does something. The default icon is Person; use Group or System for those, or search_icons for others.

ParameterTypeDescription
name *stringName shown below the element, in the words of the domain.
storyId *stringId of an open story, as returned by create_story, build_story, open_story or list_stories.
colorstringColor as hex, for example #1E88E5.
iconstringName of a built-in Egon icon (see search_icons) or a custom icon added with add_custom_icon.
xnumberLeft edge in Egon canvas pixels, at most a billion either way. Give x and y together, or omit both to place the element automatically.
ynumberTop edge in Egon canvas pixels, at most a billion either way. Give x and y together, or omit both to place the element automatically.

add_work_object Add work object

Adds a work object: something actors work with, such as a document, call, email or payment. The default icon is Document; search_icons finds others.

ParameterTypeDescription
name *stringName shown below the element, in the words of the domain.
storyId *stringId of an open story, as returned by create_story, build_story, open_story or list_stories.
colorstringColor as hex, for example #1E88E5.
iconstringName of a built-in Egon icon (see search_icons) or a custom icon added with add_custom_icon.
xnumberLeft edge in Egon canvas pixels, at most a billion either way. Give x and y together, or omit both to place the element automatically.
ynumberTop edge in Egon canvas pixels, at most a billion either way. Give x and y together, or omit both to place the element automatically.

add_activity Add activity

Draws an activity arrow between two elements. From an actor to a work object it gets the next step number. From a work object to an actor it names the recipient and has no number. Two actors cannot be connected directly.

ParameterTypeDescription
from *stringId of an element, or the exact name of an actor, work object, group or annotation text.
label *stringThe verb or preposition shown on the arrow.
storyId *stringId of an open story, as returned by create_story, build_story, open_story or list_stories.
to *stringId of an element, or the exact name of an actor, work object, group or annotation text.
colorstringColor as hex, for example #1E88E5.
numberintegerJoin an existing step to show parallel activities.

add_sentence Add sentence

Adds one domain story sentence as a new step: actor, verb, work object and optional recipients ("Customer tells Order to Clerk"). Actors are matched by name (case-insensitive) or created; the work object is drawn new for this sentence unless reused (see workObject).

ParameterTypeDescription
activity *stringThe verb, for example "orders" or "writes".
actor *stringName of the actor who acts. Created if missing.
storyId *stringId of an open story, as returned by create_story, build_story, open_story or list_stories.
workObject *stringName of the work object. Each sentence draws a new one, as in Egon, with the icon and color of the previous one of that name. Exceptions: an id of an existing work object, reuseWorkObject, or a work o…
actorIconstringName of a built-in Egon icon (see search_icons) or a custom icon added with add_custom_icon.
numberintegerJoin an existing step (parallel activities) instead of adding a new one.
reuseWorkObjectbooleanUse the latest work object with this name instead of drawing a new one.
toarrayActors who receive the work object.
workObjectIconstringName of a built-in Egon icon (see search_icons) or a custom icon added with add_custom_icon.

add_group Add group

Draws a box around elements that belong together, such as a department or subdomain. Give members, or the step numbers of sentences as steps, and the box fits around them, holding them and the notes attached to them. An existing group whose actors and work objects are all chosen goes in whole; to put an existing group inside the new one in any case, name it in members. Named members move in from any group. The new group goes into the innermost group around the work objects of its steps, or without steps around its members, and that group grows to fit; run auto_layout when members came from dif…

ParameterTypeDescription
name *stringLabel in the top-left corner of the box.
storyId *stringId of an open story, as returned by create_story, build_story, open_story or list_stories.
colorstringColor as hex, for example #1E88E5.
heightnumberBox height with x and y, at most a billion pixels; default 200. Not with members or steps.
membersarrayElements to put in the group; a name means every element with that name. The box fits around them.
stepsarrayStep numbers as narrate_story shows them (parallel sentences share one): the work objects that first appear in those sentences go into the group and their actors stay outside, the usual way to mark a…
widthnumberBox width with x and y, at most a billion pixels; default 300. Not with members or steps, whose box fits around them.
xnumberLeft edge of the box, at most a billion pixels either way. Give x and y together, and not with members or steps.
ynumberTop edge of the box, at most a billion pixels either way. Give x and y together.

add_annotation Add text annotation

Adds a note, optionally attached to an element with a dashed line. Use it for variations, business rules and open questions.

ParameterTypeDescription
storyId *stringId of an open story, as returned by create_story, build_story, open_story or list_stories.
text *stringThe note.
attachTostringElement the note belongs to; omit for a free-standing note.
xnumberLeft edge in Egon canvas pixels, at most a billion either way. Give x and y together, or omit both to place the element automatically.
ynumberTop edge in Egon canvas pixels, at most a billion either way. Give x and y together, or omit both to place the element automatically.

update_element Update element

Changes an element: rename it, change its icon or color, move or resize it, edit an annotation's text, or move an activity to another step number (the other steps shift). Pass color: "" to reset the color. As in Egon, a shape joins the group whose box it is moved into and leaves a group it is moved out of. Moving a group moves everything in it, and a moved or resized group takes in the shapes its box now covers.

ParameterTypeDescription
element *stringId of an element, or the exact name of an actor, work object, group or annotation text.
storyId *stringId of an open story, as returned by create_story, build_story, open_story or list_stories.
colorstringNew color as hex, or "" to reset it.
heightnumberNew height (groups and annotations), at most a billion pixels.
iconstringName of a built-in Egon icon (see search_icons) or a custom icon added with add_custom_icon.
namestringNew name or activity label.
numberintegerActivities from an actor: move to this step; later steps shift by one.
textstringText annotations: the new text.
widthnumberNew width (groups and annotations), at most a billion pixels.
xnumberNew left edge (shapes only), at most a billion pixels either way.
ynumberNew top edge (shapes only), at most a billion pixels either way.

remove_element Remove element

Removes an element. Removing an actor or work object also removes its activities; step numbers close up afterwards.

ParameterTypeDescription
element *stringId of an element, or the exact name of an actor, work object, group or annotation text.
storyId *stringId of an open story, as returned by create_story, build_story, open_story or list_stories.

renumber_steps Renumber steps

Closes gaps in the step numbers (1, 2, 3 ...) while keeping their order and parallel steps.

ParameterTypeDescription
storyId *stringId of an open story, as returned by create_story, build_story, open_story or list_stories.

auto_layout Auto layout

Arranges actors and work objects on a grid in reading order and reroutes every arrow. It keeps the members of each group together in a block of their own below the story, nested groups and annotations in a group included, puts an actor whose arrows all lead into groups beside the group it works in most (outside the box, its notes below it, narrowed to fit), refits the group boxes, moves other annotations next to their element and moves groups without members to the end. A note goes into the group of the element it is attached to, a note on a group into that group, and notes on nothing go after…

ParameterTypeDescription
storyId *stringId of an open story, as returned by create_story, build_story, open_story or list_stories.

add_custom_icon Add custom icon

Adds an icon that Egon does not ship, as an SVG. The story file carries the SVG, so Egon can draw it. The name must not clash with a built-in icon.

ParameterTypeDescription
kind *stringWhether the icon is offered for actors or work objects.
name *stringLetters, digits, "-" and "_".
storyId *stringId of an open story, as returned by create_story, build_story, open_story or list_stories.
svg *stringA complete <svg>...</svg> document, ideally with a 24x24 viewBox.

search_icons Search icons

Finds built-in Egon icons by name or keyword, for example "car", "invoice" or "phone". Use the returned name as icon in other tools.

ParameterTypeDescription
query *stringWords to look for, for example "invoice" or "delivery truck".
limitintegerMaximum number of results (default 10).

list_icons List icons

Lists the names of all built-in Egon icons, plus the default icon set Egon starts with.

export_story Export story

Returns the story as text without writing a file: egn (Egon JSON), egn.svg (image with embedded story), svg (image only) or markdown (narrative). Use save_story to write a file instead.

ParameterTypeDescription
format *stringegn: Egon file. egn.svg: image Egon can import. svg: image only. markdown: numbered sentences.
storyId *stringId of an open story, as returned by create_story, build_story, open_story or list_stories.
titlebooleanFor svg: draw the title and description above the story (default true).

open_in_egon Open in Egon

Serves the story from a local link and returns an Egon app URL that loads it, so the user can see and edit it in the browser. The link always serves the latest state; reload Egon after further edits. Egon may ask the browser for permission to access the local network.

ParameterTypeDescription
storyId *stringId of an open story, as returned by create_story, build_story, open_story or list_stories.
startReplaybooleanStart Egon's step-by-step replay right away.