Skip to content

Commit c6a1142

Browse files
committed
updates for sdk update
1 parent 23ca80e commit c6a1142

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

client/src/App.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
ReadResourceResultSchema,
88
CallToolResultSchema,
99
ListPromptsResultSchema,
10+
Resource,
1011
Tool,
1112
ClientRequest,
1213
} from "mcp-typescript/types.js";
@@ -34,7 +35,7 @@ import {
3435
import ConsoleTab from "./components/ConsoleTab";
3536
import Sidebar from "./components/Sidebar";
3637
import RequestsTab from "./components/RequestsTabs";
37-
import ResourcesTab, { Resource } from "./components/ResourcesTab";
38+
import ResourcesTab from "./components/ResourcesTab";
3839
import NotificationsTab from "./components/NotificationsTab";
3940
import PromptsTab, { Prompt } from "./components/PromptsTab";
4041
import ToolsTab from "./components/ToolsTab";
@@ -108,7 +109,7 @@ const App = () => {
108109
}
109110
};
110111

111-
const readResource = async (uri: string) => {
112+
const readResource = async (uri: URL) => {
112113
const response = await makeRequest(
113114
{
114115
method: "resources/read" as const,
@@ -168,7 +169,6 @@ const App = () => {
168169
version: "0.0.1",
169170
});
170171

171-
const clientTransport = new SSEClientTransport();
172172
const backendUrl = new URL("http://localhost:3000/sse");
173173

174174
backendUrl.searchParams.append("transportType", transportType);
@@ -179,7 +179,7 @@ const App = () => {
179179
backendUrl.searchParams.append("url", url);
180180
}
181181

182-
await clientTransport.connect(backendUrl);
182+
const clientTransport = new SSEClientTransport(backendUrl);
183183
await client.connect(clientTransport);
184184

185185
setMcpClient(client);

client/src/components/ResourcesTab.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { FileText, ChevronRight, AlertCircle, RefreshCw } from "lucide-react";
22
import { Button } from "@/components/ui/button";
33
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
44
import { TabsContent } from "@/components/ui/tabs";
5+
import { Resource } from "mcp-typescript/types.js";
56
import ListPane from "./ListPane";
67

78
export type Resource = {
@@ -20,7 +21,7 @@ const ResourcesTab = ({
2021
}: {
2122
resources: Resource[];
2223
listResources: () => void;
23-
readResource: (uri: string) => void;
24+
readResource: (uri: URL) => void;
2425
selectedResource: Resource | null;
2526
setSelectedResource: (resource: Resource) => void;
2627
resourceContent: string;

server/src/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ const createTransport = async (query: express.Request["query"]) => {
2525
const command = query.command as string;
2626
const args = (query.args as string).split(",");
2727
console.log(`Stdio transport: command=${command}, args=${args}`);
28-
const transport = new StdioClientTransport();
29-
await transport.spawn({ command, args });
28+
const transport = new StdioClientTransport({ command, args });
29+
await transport.start();
3030
console.log("Spawned stdio transport");
3131
return transport;
3232
} else if (transportType === "sse") {
3333
const url = query.url as string;
3434
console.log(`SSE transport: url=${url}`);
35-
const transport = new SSEClientTransport();
36-
await transport.connect(new URL(url));
35+
const transport = new SSEClientTransport(new URL(url));
36+
await transport.start();
3737
console.log("Connected to SSE transport");
3838
return transport;
3939
} else {
@@ -49,13 +49,13 @@ app.get("/sse", async (req, res) => {
4949

5050
console.log("Connected MCP client to backing server transport");
5151

52-
const webAppTransport = new SSEServerTransport("/message");
52+
const webAppTransport = new SSEServerTransport("/message", res);
5353
console.log("Created web app transport");
5454

5555
webAppTransports.push(webAppTransport);
5656
console.log("Created web app transport");
5757

58-
await webAppTransport.connectSSE(req, res);
58+
await webAppTransport.start();
5959

6060
mcpProxy({
6161
transportToClient: webAppTransport,

0 commit comments

Comments
 (0)