@foldkit/devtools-mcp 0.24.0 → 0.24.1-canary.060271955cc2

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
@@ -51,6 +51,14 @@ Restart your dev server, then restart your AI agent. The MCP server will appear
51
51
 
52
52
  The browser bridge runs inside your app, so the MCP server only sees a Runtime while the app is open in a browser tab. Close the tab and the Runtime disappears from `foldkit_list_runtimes`.
53
53
 
54
+ ## Sensitive Runtime Data
55
+
56
+ Treat this server as privileged access to the running application. A connected agent can read the current, initial, and retained historical Models; every retained Message payload; and the arguments passed to recorded Commands and Mounts. Anything returned by one of these tools enters the agent's context.
57
+
58
+ Keep API keys, passwords, access and refresh tokens, authorization headers, session material, and private personal data out of those values. Long-lived secrets belong behind a server boundary, including in local demos. If the browser must temporarily carry a sensitive value, use Effect `Redacted` with a `Schema.Redacted` field configured with `disallowJsonEncode: true`. `Redacted` protects normal string, JSON, and inspection output; it does not encrypt the value or hide a browser-side credential from the person running the browser.
59
+
60
+ `excludeFromHistory` is for noisy Messages, not sensitive ones. The resulting Model remains inspectable. Omitting `DevToolsConfig.Message` disables dispatch only; read and replay tools remain available. Set `devToolsMcpPort: false` in the Foldkit Vite plugin options to keep the in-browser DevTools without starting the MCP relay, or set `devTools: false` in the application config to disable recording and the browser bridge too.
61
+
54
62
  ## Tools
55
63
 
56
64
  Each tool accepts an optional `runtime_id`. When omitted, the most recently connected Runtime is used.
@@ -110,7 +118,7 @@ The MCP server looks for a running dev server in its project directory. If sever
110
118
  | `FOLDKIT_DEVTOOLS_MCP_HOST` | Overrides the hostname of a discovered relay or configured port. |
111
119
  | `FOLDKIT_DEVTOOLS_RELAY_DIRECTORY` | Registry location. Defaults to a directory under `XDG_RUNTIME_DIR` when set, or under the OS temporary directory. Set it in both processes if they use different sandboxes. |
112
120
 
113
- A relay discovered through the registry requires the token in its published address. The plugin will not publish that token into a directory owned by another user or readable by other users. A configured `devToolsMcpPort` opens a separate socket on every interface without a token.
121
+ A relay discovered through the registry requires the token in its published address. The plugin will not publish that token into a directory owned by another user or readable by other users. This token keeps unapproved clients from connecting; it does not hide runtime data from the agent that was given the MCP server. A configured `devToolsMcpPort` opens a separate socket on every interface without a token. Do not use a fixed port on a shared or untrusted network.
114
122
 
115
123
  On Windows, directory ownership cannot be verified, so automatic discovery is unavailable. Use `devToolsMcpPort` in the Vite config and set `FOLDKIT_DEVTOOLS_MCP_PORT` to the same port.
116
124
 
package/dist/server.js CHANGED
@@ -17513,6 +17513,37 @@ function decodeUnknownExit(schema, options) {
17513
17513
  };
17514
17514
  }
17515
17515
  /**
17516
+ * Decodes a typed input (the schema's `Encoded` type) against a schema
17517
+ * synchronously, returning an `Exit` that is either a `Success` with the decoded
17518
+ * value or a `Failure`.
17519
+ *
17520
+ * **When to use**
17521
+ *
17522
+ * Use when you need to decode already typed `Encoded` input into an `Exit` and
17523
+ * capture schema mismatches as `SchemaError`.
17524
+ *
17525
+ * **Details**
17526
+ *
17527
+ * Only usable with schemas that have no `DecodingServices` requirement. For
17528
+ * `unknown` input use {@link decodeUnknownExit}.
17529
+ * Options may be provided either when creating the decoder or when applying it;
17530
+ * application options override creation options.
17531
+ * Schema mismatches are represented by a `Failure` cause containing
17532
+ * `SchemaError`.
17533
+ *
17534
+ * **Gotchas**
17535
+ *
17536
+ * Schema issue fail reasons are wrapped as `SchemaError`. Defects,
17537
+ * interruptions, and other non-schema reasons remain in the returned `Cause`,
17538
+ * including when they are mixed with schema issues.
17539
+ *
17540
+ * @see {@link SchemaParser.decodeExit} for the adapter whose failure contains `SchemaIssue.Issue` directly
17541
+ *
17542
+ * @category decoding
17543
+ * @since 4.0.0
17544
+ */
17545
+ const decodeExit = decodeUnknownExit;
17546
+ /**
17516
17547
  * Decodes an `unknown` input against a schema, returning an `Option` that is
17517
17548
  * `Some` with the decoded value on success or `None` for schema mismatches.
17518
17549
  *
@@ -42476,7 +42507,7 @@ const connectWebSocketClient = (resolveUrl) => gen(function* () {
42476
42507
  };
42477
42508
  });
42478
42509
  const handleIncomingMessage = (raw, pendingResponsesRef) => {
42479
- const decoded = decodeUnknownExit(fromJsonString(ResponseFrame))(raw.toString());
42510
+ const decoded = decodeExit(fromJsonString(ResponseFrame))(raw.toString());
42480
42511
  return match(decoded, {
42481
42512
  onFailure: (error) => sync(() => console.error("[foldkit-devtools-mcp] failed to decode frame", error)),
42482
42513
  onSuccess: (responseFrame) => gen(function* () {
@@ -116,7 +116,7 @@ export const connectWebSocketClient = (resolveUrl) => Effect.gen(function* () {
116
116
  return { sendRequest, close };
117
117
  });
118
118
  const handleIncomingMessage = (raw, pendingResponsesRef) => {
119
- const decoded = Schema.decodeUnknownExit(Schema.fromJsonString(ResponseFrame))(raw.toString());
119
+ const decoded = Schema.decodeExit(Schema.fromJsonString(ResponseFrame))(raw.toString());
120
120
  return Exit.match(decoded, {
121
121
  onFailure: error => Effect.sync(() => console.error('[foldkit-devtools-mcp] failed to decode frame', error)),
122
122
  onSuccess: responseFrame => Effect.gen(function* () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foldkit/devtools-mcp",
3
- "version": "0.24.0",
3
+ "version": "0.24.1-canary.060271955cc2",
4
4
  "description": "MCP server exposing Foldkit DevTools to AI agents (Claude Code, Cursor, etc.)",
5
5
  "type": "module",
6
6
  "main": "./dist/server.js",
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "peerDependencies": {
19
19
  "effect": "4.0.0",
20
- "foldkit": ">=0.165.0"
20
+ "foldkit": "0.168.0-canary.060271955cc2"
21
21
  },
22
22
  "dependencies": {
23
23
  "@modelcontextprotocol/sdk": "1.29.0",
@@ -25,16 +25,16 @@
25
25
  },
26
26
  "devDependencies": {
27
27
  "@effect/platform-node": "4.0.0",
28
+ "@foldkit/vite-plugin": "0.27.1-canary.060271955cc2",
28
29
  "@types/node": "26.4.0",
29
30
  "@types/ws": "^8.18.1",
30
31
  "effect": "4.0.0",
32
+ "foldkit": "0.168.0-canary.060271955cc2",
31
33
  "rimraf": "^6.1.3",
32
34
  "rolldown": "^1.2.11",
33
35
  "typescript": "^7.0.2",
34
36
  "vite": "^8.3.1",
35
- "vitest": "^4.1.11",
36
- "@foldkit/vite-plugin": "0.26.0",
37
- "foldkit": "0.165.0"
37
+ "vitest": "^4.1.11"
38
38
  },
39
39
  "files": [
40
40
  "dist"