show server stderr in inspector UI

This commit is contained in:
Ashwin Bhat
2024-11-20 18:11:37 -08:00
parent 9196c1ddaf
commit 22bf78720b
4 changed files with 85 additions and 4 deletions

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