@statelyai/mcp 0.8.3 → 0.8.6

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
@@ -3,11 +3,69 @@
3
3
  Validate, execute, explore, compare, convert, and visualize state machines from
4
4
  an MCP-compatible agent.
5
5
 
6
- ## Connect
6
+ ## Two ways to run it
7
+
8
+ **Local (stdio).** `npx @statelyai/mcp` runs the server on your machine. Use it
9
+ when you want the server in-process, or when you need to point the tools at your
10
+ own Stately deployment.
11
+
12
+ **Hosted (HTTP).** `https://mcp.stately.ai/mcp` needs no local install and adds
13
+ the [hosted resource tools](#hosted-resource-tools) that read your Stately
14
+ projects.
15
+
16
+ **Both require a Stately credential.** Only `list_machines` and `get_machine`
17
+ run entirely on your machine; every other tool sends the machine to Stately's
18
+ HTTP API, which rejects unauthenticated calls with `Missing authentication.`
19
+ Running locally changes *where the process lives*, not *whether you need an
20
+ account*.
21
+
22
+ ### Local (stdio)
23
+
24
+ Add this to your MCP client configuration:
25
+
26
+ ```json
27
+ {
28
+ "mcpServers": {
29
+ "stately": {
30
+ "command": "npx",
31
+ "args": ["-y", "@statelyai/mcp"],
32
+ "env": { "STATELY_ACCESS_TOKEN": "..." }
33
+ }
34
+ }
35
+ }
36
+ ```
37
+
38
+ Or install it and run the `stately-mcp` binary directly:
39
+
40
+ ```bash
41
+ npm install -g @statelyai/mcp
42
+ stately-mcp
43
+ ```
44
+
45
+ Credentials are read from `STATELY_ACCESS_TOKEN`, `STATELY_API_KEY`, or the
46
+ config written by `statelyai login`.
47
+
48
+ The API defaults to `https://editor.stately.ai/api`. Point it at a self-hosted
49
+ deployment with `STATELY_API_BASE_URL`:
50
+
51
+ ```json
52
+ {
53
+ "mcpServers": {
54
+ "stately": {
55
+ "command": "npx",
56
+ "args": ["-y", "@statelyai/mcp"],
57
+ "env": { "STATELY_API_BASE_URL": "https://stately.internal/api" }
58
+ }
59
+ }
60
+ }
61
+ ```
62
+
63
+ ## Connect to the hosted endpoint
7
64
 
8
65
  <!-- public Stately MCP URL -->
9
66
 
10
- Choose your client and add Stately MCP using one of these methods.
67
+ Choose your client and add Stately MCP using one of these methods. Each ends in
68
+ a Stately sign-in; to run the server locally instead, see [Local (stdio)](#local-stdio) above.
11
69
 
12
70
  ### Codex
13
71
 
@@ -321,15 +379,17 @@ Pass XState source text (the default for strings), a JSON machine config, SCXML,
321
379
  XGraph, Mermaid, or D2; the server converts it once to canonical XGraph before
322
380
  rendering the app and PNG fallbacks.
323
381
  Other image-capable clients receive one PNG fallback per parent node. Structured
324
- content uses a required `schemaVersion: "1.0"` envelope. Its `interactive` and
325
- `pngFallback` fields independently discriminate `ready` from `unavailable`, so
326
- PNG rendering may succeed when the persisted interactive graph is unavailable.
382
+ content uses a required `schemaVersion: "2.0"` envelope with a canonical XGraph
383
+ JSON string in `interactive.graphJson`. Every V2 field has a concrete JSON
384
+ schema so hosts can persist the result without traversing open XGraph data.
385
+ `interactive` and `pngFallback` independently report `ready` or `unavailable`,
386
+ so PNG rendering may succeed when the persisted interactive graph is unavailable.
327
387
  The graph is capped at 500,000 UTF-8 bytes by default and PNG metadata at 100
328
388
  entries; image bytes remain native MCP content blocks. Use `parentNodeIds` to
329
389
  limit PNG fallback levels; omit it to render every parent with direct children.
330
390
 
331
391
  The App reads only this declared structured output. The stable resource URI is
332
- retained: newer bundles decode V1 and the earlier unversioned `graph` /
392
+ retained: newer bundles decode V2, V1, and the earlier unversioned `graph` /
333
393
  `graphError` shape. Saved results created before graph fields were declared
334
394
  cannot be reconstructed and deliberately ask the user to run the tool again.
335
395