updates for sdk update

This commit is contained in:
Ashwin Bhat
2024-10-16 16:14:33 -07:00
parent 23ca80ed66
commit c6a11422f4
3 changed files with 12 additions and 11 deletions

View File

@@ -7,6 +7,7 @@ import {
ReadResourceResultSchema,
CallToolResultSchema,
ListPromptsResultSchema,
Resource,
Tool,
ClientRequest,
} from "mcp-typescript/types.js";
@@ -34,7 +35,7 @@ import {
import ConsoleTab from "./components/ConsoleTab";
import Sidebar from "./components/Sidebar";
import RequestsTab from "./components/RequestsTabs";
import ResourcesTab, { Resource } from "./components/ResourcesTab";
import ResourcesTab from "./components/ResourcesTab";
import NotificationsTab from "./components/NotificationsTab";
import PromptsTab, { Prompt } from "./components/PromptsTab";
import ToolsTab from "./components/ToolsTab";
@@ -108,7 +109,7 @@ const App = () => {
}
};
const readResource = async (uri: string) => {
const readResource = async (uri: URL) => {
const response = await makeRequest(
{
method: "resources/read" as const,
@@ -168,7 +169,6 @@ const App = () => {
version: "0.0.1",
});
const clientTransport = new SSEClientTransport();
const backendUrl = new URL("http://localhost:3000/sse");
backendUrl.searchParams.append("transportType", transportType);
@@ -179,7 +179,7 @@ const App = () => {
backendUrl.searchParams.append("url", url);
}
await clientTransport.connect(backendUrl);
const clientTransport = new SSEClientTransport(backendUrl);
await client.connect(clientTransport);
setMcpClient(client);

View File

@@ -2,6 +2,7 @@ import { FileText, ChevronRight, AlertCircle, RefreshCw } from "lucide-react";
import { Button } from "@/components/ui/button";
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
import { TabsContent } from "@/components/ui/tabs";
import { Resource } from "mcp-typescript/types.js";
import ListPane from "./ListPane";
export type Resource = {
@@ -20,7 +21,7 @@ const ResourcesTab = ({
}: {
resources: Resource[];
listResources: () => void;
readResource: (uri: string) => void;
readResource: (uri: URL) => void;
selectedResource: Resource | null;
setSelectedResource: (resource: Resource) => void;
resourceContent: string;