You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/2.adapters/7.mcp.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,7 +107,7 @@ Two gateway tools (`devframe:connect:*` ids; see [tool ids and wire names](/guid
107
107
-**`devframe_connect_list-instances`**: list running dev servers and their MCP tools.
108
108
-**`devframe_connect_call-tool`**: invoke one tool on a running devframe (`{ port, tool, args }`) over Streamable-HTTP.
109
109
110
-
Discovery reads the **instance registry**: every `createDevServer` writes `~/.devframe/instances/<pid>-<port>.json`, dialed with a loopback origin. In-process host frameworks register via `registerDevframeInstance` (`devframe/node`). `--port <n>` probes a port;`DEVFRAME_INSTANCES_DIR` relocates the registry, `DEVFRAME_DISABLE_INSTANCE_REGISTRY=1` opts out.
110
+
Discovery reads the **instance registry**: every `createDevServer` writes `~/.devframe/instances/<pid>-<port>.json`, dialed with a loopback origin. In-process host frameworks register via `registerDevframeInstance` (`devframe/node`). `--port <n>` probes a port for `__connection.json` at its root; add `--base <path>` for a devframe mounted below the root (e.g. `devframe connect --port 5173 --base /__devtools/` for Vite DevTools). A probe only counts a JSON object as connection meta, so an SPA fallback page on the wrong path reads as "no instance".`DEVFRAME_INSTANCES_DIR` relocates the registry, `DEVFRAME_DISABLE_INSTANCE_REGISTRY=1` opts out.
111
111
112
112
The connector needs the same optional `@devframes/agentic` peer as the adapter; `devframe connect` without it throws [DF0046](/errors/DF0046).
@@ -189,26 +198,29 @@ async function index(options: ConnectServerOptions): Promise<unknown> {
189
198
return{
190
199
instances,
191
200
...(instances.length===0
192
-
? {hint: 'No running devframe instances found. Start a devframe dev server (with --mcp for tools), or pass --port <n> to devframe connect if the instance predates the registry.'}
201
+
? {hint: 'No running devframe instances found. Start a devframe dev server (with --mcp for tools), or pass --port <n> to devframe connect if the instance predates the registry (plus --base <path> when it is mounted below the root, e.g. --base /__devtools/).'}
193
202
: {}),
194
203
}
195
204
}
196
205
197
206
/**
198
-
* Probe an explicit port for a devframe serving `__connection.json` at `/`,
199
-
* reusing the registry's origin-candidate probe (a `localhost`-bound server
200
-
* may listen on either address family).
207
+
* Probe an explicit port for a devframe serving `__connection.json` under
208
+
* `base` (default `/`), reusing the registry's origin-candidate probe (a
209
+
* `localhost`-bound server may listen on either address family). The
210
+
* advertised MCP path is relative to that base, as in the registry records
211
+
* the instance shell writes. Exported for focused tests.
.command('connect','Run the devframe MCP connector on stdio (discovers running devframe dev servers and proxies their tools)')
48
49
.option('--port <port>','Probe an explicit port besides the instance registry (repeatable)')
50
+
.option('--base <path>','Base path the --port probes look for __connection.json under, for a devframe mounted below the root (e.g. /__devtools/ for Vite DevTools)',{default: '/'})
49
51
.option('--instances-dir <dir>','Override the instance registry directory (default: ~/.devframe/instances, or $DEVFRAME_INSTANCES_DIR)')
50
52
.option('--timeout <ms>','Probe timeout per instance in milliseconds',{default: 1000})
0 commit comments