File tree Expand file tree Collapse file tree 8 files changed +267
-93
lines changed Expand file tree Collapse file tree 8 files changed +267
-93
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,10 @@ import {
1818 LoggingLevel ,
1919} from "@modelcontextprotocol/sdk/types.js" ;
2020import { OAuthTokensSchema } from "@modelcontextprotocol/sdk/shared/auth.js" ;
21+ import type {
22+ AnySchema ,
23+ SchemaOutput ,
24+ } from "@modelcontextprotocol/sdk/server/zod-compat.js" ;
2125import { SESSION_KEYS , getServerSpecificKey } from "./lib/constants" ;
2226import {
2327 hasValidMetaName ,
@@ -687,11 +691,11 @@ const App = () => {
687691 setErrors ( ( prev ) => ( { ...prev , [ tabKey ] : null } ) ) ;
688692 } ;
689693
690- const sendMCPRequest = async < T extends z . ZodType > (
694+ const sendMCPRequest = async < T extends AnySchema > (
691695 request : ClientRequest ,
692696 schema : T ,
693697 tabKey ?: keyof typeof errors ,
694- ) => {
698+ ) : Promise < SchemaOutput < T > > => {
695699 try {
696700 const response = await makeRequest ( request , schema ) ;
697701 if ( tabKey !== undefined ) {
Original file line number Diff line number Diff line change @@ -80,8 +80,8 @@ const ToolResults = ({
8080 < h4 className = "font-semibold mb-2" > Invalid Tool Result:</ h4 >
8181 < JsonView data = { toolResult } />
8282 < h4 className = "font-semibold mb-2" > Errors:</ h4 >
83- { parsedResult . error . errors . map ( ( error , idx ) => (
84- < JsonView data = { error } key = { idx } />
83+ { parsedResult . error . issues . map ( ( issue , idx ) => (
84+ < JsonView data = { issue } key = { idx } />
8585 ) ) }
8686 </ >
8787 ) ;
Original file line number Diff line number Diff line change @@ -35,7 +35,8 @@ const buttonVariants = cva(
3535) ;
3636
3737export interface ButtonProps
38- extends React . ButtonHTMLAttributes < HTMLButtonElement > ,
38+ extends
39+ React . ButtonHTMLAttributes < HTMLButtonElement > ,
3940 VariantProps < typeof buttonVariants > {
4041 asChild ?: boolean ;
4142}
Original file line number Diff line number Diff line change @@ -31,10 +31,13 @@ import {
3131 LoggingLevel ,
3232 ElicitRequestSchema ,
3333} from "@modelcontextprotocol/sdk/types.js" ;
34+ import type {
35+ AnySchema ,
36+ SchemaOutput ,
37+ } from "@modelcontextprotocol/sdk/server/zod-compat.js" ;
3438import { RequestOptions } from "@modelcontextprotocol/sdk/shared/protocol.js" ;
3539import { useEffect , useState } from "react" ;
3640import { useToast } from "@/lib/hooks/useToast" ;
37- import { z } from "zod" ;
3841import { ConnectionStatus , CLIENT_IDENTITY } from "../constants" ;
3942import { Notification } from "../notificationTypes" ;
4043import {
@@ -166,11 +169,11 @@ export function useConnection({
166169 ] ) ;
167170 } ;
168171
169- const makeRequest = async < T extends z . ZodType > (
172+ const makeRequest = async < T extends AnySchema > (
170173 request : ClientRequest ,
171174 schema : T ,
172175 options ?: RequestOptions & { suppressToast ?: boolean } ,
173- ) : Promise < z . output < T > > => {
176+ ) : Promise < SchemaOutput < T > > => {
174177 if ( ! mcpClient ) {
175178 throw new Error ( "MCP client not connected" ) ;
176179 }
Original file line number Diff line number Diff line change @@ -3,10 +3,10 @@ import {
33 ClientNotificationSchema ,
44 ServerNotificationSchema ,
55} from "@modelcontextprotocol/sdk/types.js" ;
6- import { z } from "zod" ;
6+ import type { SchemaOutput } from "@modelcontextprotocol/sdk/server/ zod-compat.js " ;
77
88export const NotificationSchema = ClientNotificationSchema . or (
99 ServerNotificationSchema ,
1010) . or ( BaseNotificationSchema ) ;
1111
12- export type Notification = z . infer < typeof NotificationSchema > ;
12+ export type Notification = SchemaOutput < typeof NotificationSchema > ;
You can’t perform that action at this time.
0 commit comments