Migrating to 0.8

0.8 makes RPC schemas validator-neutral and runtime-validated, upgrades the MCP adapter to @modelcontextprotocol/sdk v2, and adds the agent-native MCP surface. See the v0.8.0 release notes.

0.8 makes RPC schemas validator-neutral and runtime-validated, upgrades the MCP adapter to @modelcontextprotocol/sdk v2, and adds the agent-native MCP surface. See the v0.8.0 release notes.

RPC schemas are Standard Schema and validated at runtime

args and returns on defineRpcFunction are now typed against Standard Schema, not valibot's GenericSchema. Any Standard-Schema validator works (valibot, zod, arktype); existing valibot schemas keep compiling.

Devframe no longer bundles a validator. valibot was dropped from runtime dependencies; install one:

npm install valibot # or: zod / arktype

If your app already uses zod, reuse it. For zero-dep code, devframe ships a minimal builder at devframe/utils/simple-schema:

// Bring your own validator …
import { defineRpcFunction } from 'devframe'
import * as v from 'valibot'

export const rename = defineRpcFunction({
  name: 'devframes:plugin:terminals:rename',
  type: 'action',
  args: [v.object({ id: v.string(), title: v.string() })],
  returns: v.void(),
  setup: ctx => ({ handler: ({ id, title }) => { /* … */ } }),
})
// … or use the built-in zero-dep builder
import { defineRpcFunction } from 'devframe'
import { s } from 'devframe/utils/simple-schema'

export const rename = defineRpcFunction({
  name: 'devframes:plugin:terminals:rename',
  type: 'action',
  args: [s.object({ id: s.string(), title: s.string() })],
  returns: s.void(),
  setup: ctx => ({ handler: ({ id, title }) => { /* … */ } }),
})

Declared schemas are now enforced. Each argument is validated before the handler runs, and the resolved return value on the way out; a mismatch is rejected with a coded diagnostic. Audit schemas that were more type hint than contract — inputs that slipped through now throw.

MCP adapter upgraded to @modelcontextprotocol/sdk v2

The MCP adapter targets the v2 SDK (scoped @modelcontextprotocol/server/@modelcontextprotocol/client). Swap the peer:

0.7.x0.8
@modelcontextprotocol/sdk@^1@modelcontextprotocol/server@^2
npm uninstall @modelcontextprotocol/sdk
npm install @modelcontextprotocol/server

@modelcontextprotocol/server remains an optional peer via devframe/adapters/mcp. devframe connect also needs @modelcontextprotocol/client.

SDK types imported directly moved from deep @modelcontextprotocol/sdk/... subpaths to flat entries on the scoped packages (@modelcontextprotocol/sdk/server/stdio.js@modelcontextprotocol/server/stdio).

Agent-native MCP surface

0.8 adds the agent host on ctx.agentregisterTool, registerToolProvider, registerResource — plus an instance registry and the devframe connect MCP connector. Existing agent-flagged RPCs keep working.

One type sharpens: a handler (and its dump) now returns Thenable<returns>returns describes the resolved value and the runtime always awaits, so an async handler whose returns is the unwrapped value type-checks correctly.

See Agent-Native and MCP → devframe connect.