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
{{ message }}
Repository navigation
Commit dec5f0e
Browse filesBrowse the repository at this point in the historyBrowse files
refactor(devframe): keep MCP config off the top-level definition
MCP exposure is a hosting decision, so it stays on the host entry points (initDevframe / initHub / createDevServer / bridges) and the standalone CLI config (cli.mcp), not a top-level DevframeDefinition field. Reverts the top-level DevframeDefinition.mcp addition; cli.mcp remains the definition-side default that createCac reads.
Created with the help of an agent.
The dev server exposes the same MCP API over HTTP, live. Enable with the top-level `mcp`:
21
+
The dev server exposes the same MCP API over HTTP, live. Enable it with `cli.mcp` (or pass `mcp` to `createDevServer` / `initDevframe` / `initHub` when you host it programmatically):
22
22
23
23
```ts
24
24
import { defineDevframe } from'devframe'
25
25
26
26
exportdefaultdefineDevframe({
27
27
// …
28
-
mcp: true,
28
+
cli: {
29
+
mcp: true,
30
+
},
29
31
})
30
32
```
31
33
@@ -41,12 +43,14 @@ The **origin gate** guards every request: `Origin` must be loopback (or allow-li
41
43
42
44
```ts
43
45
exportdefaultdefineDevframe({
44
-
// A bearer token, backed by your own environment variable (never a literal):
45
-
mcp: { authorization: process.env.MY_TOKEN },
46
-
// — or a callback identity check (governs identity only; it cannot relax the origin gate):
Copy file name to clipboardExpand all lines: docs/content/3.frameworks/1.vite.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
@@ -42,7 +42,7 @@ Devframe spawns a separate RPC + WS server and registers Vite middleware at `<ba
42
42
|`host`|`def.cli?.host ?? 'localhost'`| Bind host for a pinned side-car. |
43
43
|`flags`| — | To `def.setup(ctx, { flags })`. |
44
44
|`auth`| gated (interactive OTP) |`false` to opt out, or a `DevframeAuthHandler` for a custom scheme. |
45
-
|`mcp`|`def.mcp`| Expose the MCP route at `<base>__mcp`. `true` is origin-only (trusts same-machine callers); `McpRouteOptions` can add an `authorization` identity check. |
45
+
|`mcp`|`def.cli?.mcp`| Expose the MCP route at `<base>__mcp`. `true` is origin-only (trusts same-machine callers); `McpRouteOptions` can add an `authorization` identity check. |
Copy file name to clipboardExpand all lines: docs/content/3.frameworks/3.next.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
@@ -48,7 +48,7 @@ export const GET = handler.fetch
48
48
|`port`| from `def.cli?.port`| Side-car port. |
49
49
|`flags`| — | Passed to `def.setup(ctx, { flags })`. |
50
50
|`auth`|`false`|`true` for the OTP gate, or a handler. |
51
-
|`mcp`|`def.mcp`| Expose the MCP route. `true` is origin-only (trusts same-machine callers); `McpRouteOptions` can add an `authorization` identity check. |
51
+
|`mcp`|`def.cli?.mcp`| Expose the MCP route. `true` is origin-only (trusts same-machine callers); `McpRouteOptions` can add an `authorization` identity check. |
0 commit comments