1
1
import { Client } from "@modelcontextprotocol/sdk/client/index.js" ;
2
2
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js" ;
3
3
import {
4
- CompatibilityCallToolResultSchema ,
4
+ ClientNotification ,
5
5
ClientRequest ,
6
+ CompatibilityCallToolResult ,
7
+ CompatibilityCallToolResultSchema ,
6
8
CreateMessageRequestSchema ,
7
9
CreateMessageResult ,
8
10
EmptyResultSchema ,
@@ -19,8 +21,6 @@ import {
19
21
Root ,
20
22
ServerNotification ,
21
23
Tool ,
22
- CompatibilityCallToolResult ,
23
- ClientNotification ,
24
24
} from "@modelcontextprotocol/sdk/types.js" ;
25
25
import { useEffect , useRef , useState } from "react" ;
26
26
// Add dark mode class based on system preference
@@ -40,16 +40,16 @@ import {
40
40
import { Tabs , TabsList , TabsTrigger } from "@/components/ui/tabs" ;
41
41
import {
42
42
Bell ,
43
+ ChevronDown ,
44
+ ChevronRight ,
43
45
Files ,
46
+ FolderTree ,
44
47
Hammer ,
45
48
Hash ,
46
49
MessageSquare ,
47
50
Play ,
48
51
Send ,
49
52
Terminal ,
50
- FolderTree ,
51
- ChevronDown ,
52
- ChevronRight ,
53
53
} from "lucide-react" ;
54
54
55
55
import { ZodType } from "zod" ;
@@ -58,7 +58,6 @@ import ConsoleTab from "./components/ConsoleTab";
58
58
import HistoryAndNotifications from "./components/History" ;
59
59
import PingTab from "./components/PingTab" ;
60
60
import PromptsTab , { Prompt } from "./components/PromptsTab" ;
61
- import RequestsTab from "./components/RequestsTabs" ;
62
61
import ResourcesTab from "./components/ResourcesTab" ;
63
62
import RootsTab from "./components/RootsTab" ;
64
63
import SamplingTab , { PendingRequest } from "./components/SamplingTab" ;
@@ -184,7 +183,7 @@ const App = () => {
184
183
if ( ! mcpClient ) {
185
184
throw new Error ( "MCP client not connected" ) ;
186
185
}
187
-
186
+
188
187
try {
189
188
const response = await mcpClient . request ( request , schema ) ;
190
189
pushHistory ( request , response ) ;
@@ -222,7 +221,7 @@ const App = () => {
222
221
setResources ( resources . concat ( response . resources ?? [ ] ) ) ;
223
222
setNextResourceCursor ( response . nextCursor ) ;
224
223
} ;
225
-
224
+
226
225
const listResourceTemplates = async ( ) => {
227
226
const response = await makeRequest (
228
227
{
@@ -239,7 +238,7 @@ const App = () => {
239
238
) ;
240
239
setNextResourceTemplateCursor ( response . nextCursor ) ;
241
240
} ;
242
-
241
+
243
242
const readResource = async ( uri : string ) => {
244
243
const response = await makeRequest (
245
244
{
@@ -264,7 +263,7 @@ const App = () => {
264
263
setPrompts ( response . prompts ) ;
265
264
setNextPromptCursor ( response . nextCursor ) ;
266
265
} ;
267
-
266
+
268
267
const getPrompt = async ( name : string , args : Record < string , string > = { } ) => {
269
268
const response = await makeRequest (
270
269
{
@@ -289,7 +288,7 @@ const App = () => {
289
288
setTools ( response . tools ) ;
290
289
setNextToolCursor ( response . nextCursor ) ;
291
290
} ;
292
-
291
+
293
292
const callTool = async ( name : string , params : Record < string , unknown > ) => {
294
293
const response = await makeRequest (
295
294
{
0 commit comments