@smithery/sdk 4.1.0 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Smithery SDK
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/@smithery/sdk)](https://www.npmjs.com/package/@smithery/sdk)
4
+
3
5
  TypeScript types for building MCP servers on the Smithery hosted runtime.
4
6
 
5
7
  Docs: https://smithery.ai/docs/build
@@ -1,4 +1,5 @@
1
1
  import type { Server } from "@modelcontextprotocol/sdk/server/index.js";
2
+ import type { Notification } from "@modelcontextprotocol/sdk/types.js";
2
3
  import type { z } from "zod";
3
4
  export type Session = {
4
5
  id: string;
@@ -67,7 +68,17 @@ export type StatelessHttpContext = {
67
68
  export type StatefulHttpContext = {
68
69
  env: Record<string, string | undefined>;
69
70
  sessions: {
70
- send(sessionId: string, message: unknown): Promise<void>;
71
+ /**
72
+ * Send a notification directly to the connected client (via `transport.send()`),
73
+ * bypassing the server's notification handler chain.
74
+ * Use this for webhook → client notification routing.
75
+ */
76
+ notify(sessionId: string, notification: Notification): Promise<void>;
77
+ /**
78
+ * Inject a raw JSON-RPC message into the server's handler chain for processing.
79
+ * The server's registered request/notification handlers will be invoked.
80
+ */
81
+ dispatch(sessionId: string, message: unknown): Promise<void>;
71
82
  };
72
83
  };
73
84
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithery/sdk",
3
- "version": "4.1.0",
3
+ "version": "4.2.0",
4
4
  "description": "SDK to develop with Smithery",
5
5
  "type": "module",
6
6
  "repository": {