show server stderr in inspector UI
This commit is contained in:
parent
9196c1ddaf
commit
22bf78720b
1 changed files with 85 additions and 4 deletions
19
client/src/lib/notificationTypes.ts
Normal file
19
client/src/lib/notificationTypes.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import {
|
||||
ClientNotificationSchema,
|
||||
NotificationSchema as BaseNotificationSchema,
|
||||
} from "@modelcontextprotocol/sdk/types.js";
|
||||
import { z } from "zod";
|
||||
|
||||
export const StderrNotificationSchema = BaseNotificationSchema.extend({
|
||||
method: z.literal("notifications/stderr"),
|
||||
params: z.object({
|
||||
content: z.string(),
|
||||
}),
|
||||
});
|
||||
|
||||
export const NotificationSchema = ClientNotificationSchema.or(
|
||||
StderrNotificationSchema,
|
||||
);
|
||||
|
||||
export type StdErrNotification = z.infer<typeof StderrNotificationSchema>;
|
||||
export type Notification = z.infer<typeof NotificationSchema>;
|
||||
Loading…
Reference in a new issue