Skip to content

Commit 296e179

Browse files
fix(examples,docs): spawn server via tsx; reword §9 intro to reflect both forms supported
1 parent 568a3bf commit 296e179

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

docs/migration-SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ The server package now exports framework-agnostic alternatives: `validateHostHea
340340

341341
## 9. `setRequestHandler` / `setNotificationHandler` API
342342

343-
The low-level handler registration methods now take a method string instead of a Zod schema.
343+
The low-level handler registration methods now accept a method string in addition to the v1 Zod-schema form (both are supported).
344344

345345
```typescript
346346
// v1: schema-based

docs/migration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ Note: the v2 signature takes a plain `string[]` instead of an options object.
324324

325325
### `setRequestHandler` and `setNotificationHandler` use method strings
326326

327-
The low-level `setRequestHandler` and `setNotificationHandler` methods on `Client`, `Server`, and `Protocol` now take a method string instead of a Zod schema.
327+
The low-level `setRequestHandler` and `setNotificationHandler` methods on `Client`, `Server`, and `Protocol` now accept a method string in addition to the v1 Zod-schema form (both are supported).
328328

329329
**Before (v1):**
330330

examples/client/src/customMethodExample.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ client.setNotificationHandler(ProgressNotification, n => {
2525
console.log(`[client] progress: ${n.params.stage} ${n.params.pct}%`);
2626
});
2727

28-
await client.connect(new StdioClientTransport({ command: 'node', args: ['../server/dist/customMethodExample.js'] }));
28+
await client.connect(new StdioClientTransport({ command: 'npx', args: ['tsx', '../server/src/customMethodExample.ts'] }));
2929

3030
const r = await client.request({ method: 'acme/search', params: { query: 'widgets' } }, SearchResult);
3131
console.log('[client] hits=' + JSON.stringify(r.hits));

0 commit comments

Comments
 (0)