show server stderr in inspector UI

This commit is contained in:
Ashwin Bhat 2024-11-20 18:11:37 -08:00
commit 22bf78720b
No known key found for this signature in database

View 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>;