@radicaltools/mcp 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,9 +10,9 @@ Use Node.js 20.11 or newer. Run the published server without cloning this reposi
10
10
  npx -y @radicaltools/mcp --folder /absolute/path/to/my-model
11
11
  ```
12
12
 
13
- For reproducible setups, pin a version, for example `@radicaltools/mcp@0.1.1`.
13
+ For reproducible setups, pin a version, for example `@radicaltools/mcp@0.2.0`.
14
14
  To connect a coding agent, use `npx` as the command, with
15
- `["-y", "@radicaltools/mcp@0.1.1", "--folder", "/absolute/path/to/my-model"]`
15
+ `["-y", "@radicaltools/mcp@0.2.0", "--folder", "/absolute/path/to/my-model"]`
16
16
  as its arguments. On Windows, use `npx.cmd` as the command and an absolute Windows
17
17
  folder path. The server waits for MCP messages on stdin and prints no banner to stdout.
18
18
 
@@ -42,15 +42,17 @@ Launch Studio with `npm run dev:web` from the repository root, open it in Chromi
42
42
  The server binds to one folder at launch, then reads it afresh for every tool call. Its tools are the shared AI tool catalogue from `@radical/common/ai/tools`, the one Studio's AI chat and Radical Forge use, minus the canvas-only `set_active_view` and `focus_node` and the destructive `reset_diagram`. It provides:
43
43
 
44
44
  - `get_model_summary` (counts, views, sequences, milestones, presentations, the modelling rules Studio's chat and Forge follow, and the metamodel rules) and `search_model` (a small query language, including `LIST SEQUENCES` and `GET SEQUENCE`);
45
- - the `forge_*` tools: a Radical Forge run with the agent's model. After every step the server writes where the run stands to `.radical/forge-run.json` (next to the selection, also out of git), and marks it closed when the client goes away, so Studio open on the folder can show it on its Forge button;
45
+ - the `forge_*` tools: a Radical Forge run with the agent's model, ending with a Review stage over the whole model. Each stage may fill gaps in earlier stages, but only by asking: `forge_propose_refinement` checks a proposal and returns exactly what it would write, for the agent to show the user, and `forge_answer_refinement` writes it only if the user accepts (while a stage is open the server refuses direct writes to earlier stages, and every write while a proposal waits for its answer). `forge_complete_stage` lists what the stage refined, with the gaps the completeness rules still find. In a folder with no base from git, `forge_start` saves the model as it was before the run to `.radical/base.json`, so Studio's Changes on branch shows the run. After every step the server writes where the run stands to `.radical/forge-run.json` (next to the selection, also out of git), and marks it closed when the client goes away, so Studio open on the folder can show it on its Forge button;
46
46
  - `get_issues`: every rule the model breaks now, as the Validation list in Studio's metamodel editor shows it. A write is refused when it brings in a new error; the warnings it brings in (a state machine without an initial state, a reference to no node, …) come back with its result, since a model is often incomplete while it is being built;
47
47
  - `get_selection`: what is selected on Studio's canvas for this folder (the view on screen, each selected node in full, selected relations), so you can say "fix the selected mockup" instead of naming it. Studio writes it to `.radical/selection.json` in the model folder whenever the selection or the view changes, and clears it when you switch to another model; `.radical/` carries its own `.gitignore`, and the file is not part of the model, so writing it never conflicts with model edits;
48
+ - `get_changes`: what changed in the model since its version in git, for an agent asked to implement a change made in the model. It lists the elements and relations added, removed and changed (uncommitted edits included), each changed field with its old and new value, and each element with its place and its relations, such as the component that satisfies a requirement and the scenarios that verify it. Views, positions, sizes and folding are left out. `since` names the branch, tag or commit to compare with; by default it is the merge base with the default branch (`origin/main`), so every model change on the branch counts. `radical diff` prints the same list. Without `since` it also saves that base to `.radical/base.json`, for Studio to show the same changes (Changes on branch);
48
49
  - `add_`, `update_` and `delete_` tools for nodes and relations, and `move_node` to change a node's parent (it keeps the node's canvas position and enforces the metamodel's `allowedParents`). A reference property (a transition's `event` and `raises`) takes node ids or tempIds from the same connection and refuses a node of the wrong type;
49
- - `create_view`, `update_view` (name, kind, linked sequence, hidden relations), `set_view_nodes` and `delete_view`;
50
+ - `create_view`, `update_view` (name, folder in the list of views, line style, kind, linked sequence, hidden relations, elements shown open or folded, filter chain, or `viewpoint`: one of the metamodel's viewpoints, whose kind and chain the view then follows; `null` keeps them for the view alone), `set_view_nodes`, `order_views` (the order of views, and so of their folders) and `delete_view`;
50
51
  - `create_sequence`, `update_sequence` and `delete_sequence`: ordered relation flows that a `dynamic` view plays;
51
52
  - `create_presentation`, `update_presentation` and `delete_presentation`: slides over views, which Studio frames to fit the whole view or the slide's `focus` elements (several slides can zoom onto parts of one view), showing the current model or a `milestone`;
52
53
  - `list_milestones`, `create_milestone`, `update_milestone`, `delete_milestone` and `compare_milestones`: named copies of the model at phases of the system ("As-is", "Target 2027"). `create_milestone` saves the current model as the latest one and `compare_milestones` lists what changed; no tool loads a milestone over the current model, which stays in Studio's timeline;
53
- - `upsert_node_type`, `delete_node_type`, `upsert_relation_type` and `delete_relation_type`. A built-in metamodel is copied to a `…-custom` id on the first edit, because Studio replaces built-in metamodels with their preset on load. After a metamodel change (from these tools or from Studio) the server re-advertises the node and relation tool schemas;
54
+ - `upsert_viewpoint` and `delete_viewpoint`: viewpoints of the metamodel, a view type and a filter chain under a name (given as `pipeline` or copied from a view with `fromViewId`), in a `group` such as `C4` or `Requirements`. Studio's New view offers them, and the views of a type follow its changes; a deleted type leaves its views their kind and chain. They do not copy a built-in metamodel: a model keeps its own viewpoints when Studio swaps the preset in;
55
+ - `upsert_node_type`, `delete_node_type`, `upsert_relation_type` and `delete_relation_type`. A type takes a `description` (what it is; the wiki view shows it), a relation type also `forwardLabel` and `inverseLabel` (how it reads in a sentence from its source and from its target). A built-in metamodel is copied to a `…-custom` id on the first edit, because Studio replaces built-in metamodels with their preset on load. After a metamodel change (from these tools or from Studio) the server re-advertises the node and relation tool schemas;
54
56
  - `smart_layout`, for All elements or one static or dynamic view (`viewId`), which then gets its own saved positions;
55
57
  - `align_nodes` (a row or a column, with `keepOrder` to keep the listed order), `grid_nodes` (`columns` columns, filled row by row) and `remove_alignment`, for All elements or one view (`viewId`). Studio and `smart_layout` keep these rules in every later layout.
56
58
 
@@ -58,7 +60,7 @@ The server binds to one folder at launch, then reads it afresh for every tool ca
58
60
 
59
61
  Writes preserve unrelated files and the existing `radical.md` text. A tool reports success only after the changed model files are written. If a file changed between the server's read and write, it returns a conflict without writing. Studio's external-change reload no longer queues an autosave of the loaded data. After such a reload Studio highlights what changed for about five seconds (new and changed elements badged, removed ones as ghosts; layout alone shows nothing), so you can follow an agent at work.
60
62
 
61
- For now, keep Studio in **viewer use while the MCP client writes**. Folder writes span several files, and Studio and MCP do not share a cross-process transaction lock. Editing the same folder simultaneously from both can still race; the stamp check only catches changes visible before a write begins. Single `.radical` JSON files, snapshots (milestones), browser commands, and remote HTTP MCP are not supported by this server.
63
+ For now, keep Studio in **viewer use while the MCP client writes**. Folder writes span several files, and Studio and MCP do not share a cross-process transaction lock. Editing the same folder simultaneously from both can still race; the stamp check only catches changes visible before a write begins. Single `.radical` JSON files, loading a milestone over the current model (the milestone tools save, list, rename, delete and compare them), commands that drive Studio's canvas, and remote HTTP MCP are not supported by this server.
62
64
 
63
65
  Run `npm run test -w @radicaltools/mcp` to build and exercise a real stdio connection and temporary disk folder.
64
66
 
@@ -98,7 +100,7 @@ publish the verified first-release archive, completing npm's 2FA challenge:
98
100
  ```sh
99
101
  npm login --auth-type=web
100
102
  npm whoami
101
- npm publish ./release/radicaltools-mcp-0.1.1.tgz --access public
103
+ npm publish ./release/radicaltools-mcp-0.2.0.tgz --access public
102
104
  ```
103
105
 
104
106
  Do this after the pull request is merged, from the reviewed main commit. A name
@@ -118,10 +120,15 @@ and add GitHub Actions with these values:
118
120
  | --- | --- |
119
121
  | Organization or user | `radicaltools` |
120
122
  | Repository | `radical.tools` |
121
- | Workflow filename | `mcp-publish.yml` |
123
+ | Workflow filename | `npm-publish.yml` |
122
124
  | Environment name | Leave empty |
123
125
  | Allowed actions | Enable direct publishing with `npm publish` |
124
126
 
127
+ The shared workflow publishes either CLI or MCP. If the existing trusted
128
+ publisher points at `mcp-publish.yml`, replace it with one using
129
+ `npm-publish.yml` after merging this change. Trusted publishers are configured
130
+ per npm package, even though both packages use the same workflow.
131
+
125
132
  No npm token or GitHub secret is needed. npm requires Node 22.14+ and npm 11.5.1+
126
133
  for Trusted Publishing; the workflow uses Node 24 and npm 11, and gives only the
127
134
  publish job `id-token: write`. A new trusted publisher must complete its first
@@ -133,8 +140,9 @@ before the deadline shown in npm. A dry run or a local `npm publish` does not
133
140
  validate the OIDC connection. The workflow needs direct `npm publish` permission;
134
141
  `npm stage publish` alone is insufficient, and managing dist-tags is not needed.
135
142
 
136
- In GitHub **Actions → Publish MCP to npm → Run workflow**, select `main` and leave
137
- **dry-run** enabled to verify and upload the package without publishing. For a
143
+ In GitHub **Actions → Publish to npm → Run workflow**, select `main`, choose
144
+ **package: mcp**, and leave **dry-run** enabled to verify and upload the package
145
+ without publishing. For a
138
146
  reviewed version bump, run it with **dry-run** disabled. Actual publishing is
139
147
  refused on any branch other than `main`. The workflow type-checks and tests the
140
148
  monorepo, verifies the installable tarball, and publishes that same archive with