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
feat!: move the MCP implementation into the optional @devframes/agentic peer
The MCP implementation, the connect gateway, and the MCP SDK behind them
move out of devframe into the new @devframes/agentic package, an optional
peer of devframe and @devframes/hub. devframe stays slim; installing the
peer is what turns the agent surface on. Users never import agentic:
devframe/adapters/mcp stays the user-facing API and loads the peer lazily.
- @devframes/agentic ships /mcp and /connect entries consumed by devframe's
loaders; the bare root throws. Signatures are typed against devframe's own
contract, so no SDK type leaks and the SDK stays swappable.
- The mcp enable matrix: 'auto' mounts iff the agent surface is non-empty
AND the peer resolves (missing peer: one DF0078 warning per process); an
explicit setting - or importing devframe/adapters/mcp - throws DF0079
without the peer; false stays silent.
- devframe/adapters/mcp keeps its exports unchanged, built in its own graph
so its top-level await cannot reshape the server chunking.
- The peer probe routes through resolveServicePackage (an opaque-parameter
createRequire), not a literal createRequire(import.meta.url).resolve,
which turbopack rewrites into a throwing stub inside a bundled Next hub.
- Pure agent projections (to-json-schema, stringify) stay in devframe under
src/agent/, shared by browser WebMCP and agentic via devframe/internal.
- devframe drops @modelcontextprotocol/server (dep) and /client (optional
peer); DF0046 now points at @devframes/agentic. The reference hubs install
the peer, as any consumer wanting MCP now does.
Copy file name to clipboardExpand all lines: docs/content/1.guide/15.agent-native.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
@@ -100,7 +100,7 @@ Every `ctx.rpc.sharedState` key is exposed as a `devframe://state/<key>` resourc
100
100
101
101
## Starting the MCP server
102
102
103
-
The dev server serves the agent surface over HTTP on its own: the `mcp: 'auto'` default mounts the route at `/__mcp` once anything above exists (an `agent`-flagged RPC, a registered tool or resource) - one flagged function is the whole setup. See the [MCP adapter](/adapters/mcp#route-based-server) for forcing it on or off and hardening the route.
103
+
The dev server serves the agent surface over HTTP on its own: the `mcp: 'auto'` default mounts the route at `/__mcp` once anything above exists (an `agent`-flagged RPC, a registered tool or resource) and the optional [`@devframes/agentic`](/adapters/mcp) peer is installed - one flagged function plus one install is the whole setup. See the [MCP adapter](/adapters/mcp#route-based-server) for forcing it on or off and hardening the route.
Copy file name to clipboardExpand all lines: docs/content/2.adapters/7.mcp.md
+11-3Lines changed: 11 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,18 +7,24 @@ description: 'Exposes a devframe''s agent-facing API as a Model Context Protocol
7
7
8
8
Exposes a devframe's agent-facing API as a [Model Context Protocol](https://modelcontextprotocol.io) server: coding agents call flagged RPCs and read resources.
9
9
10
+
The implementation (and the MCP SDK behind it) lives in **`@devframes/agentic`**, an optional peer of `devframe`: install it to enable the agent surface, and keep importing everything from `devframe/adapters/mcp` - the peer is loaded for you, never imported directly. A devframe without an agent surface ships with neither the peer nor the SDK installed:
`createMcpServer` serves `stdio` through the MCP SDK's `serveStdio`, pinning one server instance per connection.
23
+
`createMcpServer` serves `stdio` through the MCP SDK's `serveStdio`, pinning one server instance per connection. Importing `devframe/adapters/mcp` without the peer installed throws [DF0079](/errors/DF0079).
18
24
19
25
## Route-based server
20
26
21
-
The dev server exposes the same MCP API over HTTP, live. The default setting is **`'auto'`**: the route mounts once the devframe exposes an agent surface (an `agent`-flagged RPC, a registered tool or resource) - flag your first functionand the agent view is on. A devframe with nothing flagged mounts no route and loads no MCP code.
27
+
The dev server exposes the same MCP API over HTTP, live. The default setting is **`'auto'`**: the route mounts once the devframe exposes an agent surface (an `agent`-flagged RPC, a registered tool or resource) *and*`@devframes/agentic` is installed - flag your first function, install the peer, and the agent view is on. A devframe with nothing flagged mounts no route and loads no MCP code; an agent surface without the peer warns once ([DF0078](/errors/DF0078)) and mounts nothing, while an explicit `mcp` setting without the peer throws ([DF0079](/errors/DF0079)). `mcp: false` stays silent either way.
22
28
23
29
Pin the behavior where you host the tool - it's a hosting decision, so pass `mcp` to `createCac` when you assemble the CLI (or to `createDevServer` / `initDevframe` / `initHub` when you host it programmatically): `true` always mounts, `false` never mounts, an object customises the route:
24
30
@@ -103,6 +109,8 @@ Two gateway tools (`devframe:connect:*` ids; see [tool ids and wire names](/guid
103
109
104
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.
105
111
106
-
Most instances trust same-machine callers, so the connector reaches them with no credential. For an instance you *hardened* with a bearer, the connector reads `DEVFRAME_MCP_AUTH_TOKEN` and presents it (never a CLI flag, since command-line arguments are visible to other processes). Connect to a fleet with distinct credentials by driving `startConnectServer` with a per-instance `authToken` resolver.
112
+
The connector needs the same optional `@devframes/agentic` peer as the adapter; `devframe connect` without it throws [DF0046](/errors/DF0046).
113
+
114
+
Most instances trust same-machine callers, so the connector reaches them with no credential. For an instance you *hardened* with a bearer, the connector reads `DEVFRAME_MCP_AUTH_TOKEN` and presents it (never a CLI flag, since command-line arguments are visible to other processes).
107
115
108
116
See [Agent-Native](/guide/agent-native) for the API and safety model.
description: 'devframe connect requires the optional peer dependency @devframes/agentic: {reason}'
4
4
---
5
5
6
6
## Message
7
7
8
-
> `devframe connect` requires the optional peer dependency @modelcontextprotocol/client: `{reason}`
8
+
> `devframe connect` requires the optional peer dependency @devframes/agentic: `{reason}`
9
9
10
10
## Cause
11
11
12
-
`devframe connect` was started but `@modelcontextprotocol/client` could not be imported. The client SDK is an optional peer dependency of `devframe`: only the connector dials other instances, so only it needs the package installed.
12
+
`devframe connect` was started but `@devframes/agentic/connect` could not be imported. The connector lives in `@devframes/agentic` (together with the MCP SDK), an optional peer dependency of `devframe`: only agent-facing features need the package installed.
13
13
14
14
## Fix
15
15
16
-
Install the SDK next to devframe and run the connector again:
16
+
Install the package next to devframe and run the connector again:
17
17
18
18
```sh
19
-
npm install @modelcontextprotocol/client
19
+
npm install @devframes/agentic
20
20
devframe connect
21
21
```
22
22
23
23
## Source
24
24
25
-
-[`packages/devframe/src/cli/connect.ts`](https://github.com/devframes/devframe/blob/main/packages/devframe/src/cli/connect.ts): `startConnectServer()`throws this when the dynamic SDK import fails.
25
+
-[`packages/devframe/src/cli/main.ts`](https://github.com/devframes/devframe/blob/main/packages/devframe/src/cli/main.ts): the `connect` subcommand throws this when the dynamic `@devframes/agentic/connect` import fails.
title: 'DF0078: Agent Surface Without @devframes/agentic'
3
+
description: 'This devframe exposes agent tools, but the MCP endpoint stays off: the optional peer "@devframes/agentic" is not installed.'
4
+
---
5
+
6
+
## Message
7
+
8
+
> This devframe exposes agent tools, but the MCP endpoint stays off: the optional peer "@devframes/agentic" is not installed.
9
+
10
+
## Cause
11
+
12
+
The devframe (or hub) left a non-empty agent surface (RPC functions with an `agent` field, registered agent tools, resources, or providers) and the `mcp` setting is the omitted `'auto'` default, which would mount the MCP route. But `@devframes/agentic`, the optional peer carrying the MCP adapter and the MCP SDK, is not installed, so no route can be served.
13
+
14
+
The warning is reported once per process; the instance keeps running without an MCP endpoint.
15
+
16
+
## Fix
17
+
18
+
Install the peer so the agent surface is served over MCP:
19
+
20
+
```sh
21
+
npm install @devframes/agentic
22
+
```
23
+
24
+
Or, if the tools should deliberately stay unexposed, set `mcp: false` to opt out silently.
25
+
26
+
## Source
27
+
28
+
-[`packages/devframe/src/adapters/_shared.ts`](https://github.com/devframes/devframe/blob/main/packages/devframe/src/adapters/_shared.ts): `loadAutoMcpAdapter()` reports this (once) when the agent surface is non-empty but the peer probe fails.
title: 'DF0079: MCP Enabled Without @devframes/agentic'
3
+
description: 'The mcp option is enabled, but the optional peer "@devframes/agentic" could not be loaded: {reason}'
4
+
---
5
+
6
+
## Message
7
+
8
+
> The `mcp` option is enabled, but the optional peer "@devframes/agentic" could not be loaded: `{reason}`
9
+
10
+
## Cause
11
+
12
+
An explicit `mcp` setting (`true`, a route options object, the `--mcp` flag, or the `mcp` CLI subcommand) asked for an MCP surface - or `devframe/adapters/mcp` was imported directly - but the implementation could not be loaded from the optional `@devframes/agentic` peer, typically because it is not installed. Unlike the omitted `'auto'` default (which degrades to a one-time [DF0078](/errors/DF0078) warning), an explicit opt-in fails fast rather than silently running without MCP.
13
+
14
+
## Fix
15
+
16
+
Install the peer next to devframe:
17
+
18
+
```sh
19
+
npm install @devframes/agentic
20
+
```
21
+
22
+
Or remove the explicit `mcp` setting (or pass `mcp: false`) if the endpoint isn't wanted. The underlying import error is attached as `cause`.
23
+
24
+
## Source
25
+
26
+
-[`packages/devframe/src/node/agentic.ts`](https://github.com/devframes/devframe/blob/main/packages/devframe/src/node/agentic.ts): `importAgenticMcp()` maps a failed load of `@devframes/agentic/mcp` to this error.
Copy file name to clipboardExpand all lines: docs/content/7.migrations/1.migration-0.9.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,21 @@ description: '0.9 removes the compatibility shims deprecated across the 0.7 seri
5
5
6
6
0.9 removes the compatibility shims deprecated across the 0.7 series and trims the public API of `devframe` and `@devframes/hub`. Each change has a drop-in replacement. It also moves the [MCP](/adapters/mcp) surface to the stateless [MCP 2026-07-28 protocol](https://modelcontextprotocol.io/specification/2026-07-28). The devframe API is unchanged; see [The MCP endpoints are stateless](#the-mcp-endpoints-are-stateless).
7
7
8
+
Late in the 0.9 series the MCP implementation moved into the new optional peer `@devframes/agentic`; see [MCP requires `@devframes/agentic`](#mcp-requires-devframesagentic).
9
+
10
+
## MCP requires `@devframes/agentic`
11
+
12
+
The MCP implementation and the MCP SDK moved out of `devframe` into `@devframes/agentic`, an **optional peer**: install it to serve agent tools over MCP, skip it for a slimmer install without an MCP surface. Your imports do not change - `devframe/adapters/mcp` stays the user-facing API and loads the peer for you; `@devframes/agentic` is never imported directly.
13
+
14
+
> [!WARNING]
15
+
> This is a behavior change within the 0.9 series: `devframe` no longer depends on the MCP SDK, so MCP now requires `@devframes/agentic` to be installed. Without it, the omitted `'auto'` default warns once ([DF0078](/errors/DF0078)) and mounts nothing; an explicit `mcp` setting - and importing `devframe/adapters/mcp` itself - throws ([DF0079](/errors/DF0079)); `mcp: false` stays silent.
16
+
17
+
```sh
18
+
npm install @devframes/agentic
19
+
```
20
+
21
+
The `devframe/adapters/mcp` exports are unchanged: `createMcpServer`, `createMcpFetchHandler`, `mountMcpHttp`, and their option types (the types are also importable from `devframe/types`). `devframe connect` needs the peer too and throws [DF0046](/errors/DF0046) without it, replacing the former `@modelcontextprotocol/client` optional peer.
22
+
8
23
## `devframe/adapters/cli` is removed
9
24
10
25
The `devframe/adapters/cli` entry is gone; import from `devframe/adapters/cac`:
0 commit comments