Skip to content

Commit 3b4d813

Browse files
authored
Merge pull request modelcontextprotocol#17 from modelcontextprotocol/ashwin/updatesdk
Update SDK
2 parents 50b812b + 0ffedbf commit 3b4d813

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+250
-118
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ node_modules
33
server/build
44
client/dist
55
client/tsconfig.app.tsbuildinfo
6+
client/tsconfig.node.tsbuildinfo

client/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
"react": "^18.3.1",
2323
"react-dom": "^18.3.1",
2424
"tailwind-merge": "^2.5.3",
25-
"tailwindcss-animate": "^1.0.7"
25+
"tailwindcss-animate": "^1.0.7",
26+
"zod": "^3.23.8"
2627
},
2728
"devDependencies": {
2829
"@eslint/js": "^9.11.1",

client/src/App.tsx

Lines changed: 5 additions & 5 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,12 +35,12 @@ 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";
4142
import History from "./components/History";
42-
import { AnyZodObject } from "node_modules/zod/lib";
43+
import { AnyZodObject } from "zod";
4344

4445
const App = () => {
4546
const [connectionStatus, setConnectionStatus] = useState<
@@ -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: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,9 @@ 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

7-
export type Resource = {
8-
uri: string;
9-
name: string;
10-
};
11-
128
const ResourcesTab = ({
139
resources,
1410
listResources,
@@ -20,7 +16,7 @@ const ResourcesTab = ({
2016
}: {
2117
resources: Resource[];
2218
listResources: () => void;
23-
readResource: (uri: string) => void;
19+
readResource: (uri: URL) => void;
2420
selectedResource: Resource | null;
2521
setSelectedResource: (resource: Resource) => void;
2622
resourceContent: string;
@@ -37,7 +33,7 @@ const ResourcesTab = ({
3733
renderItem={(resource) => (
3834
<div className="flex items-center w-full">
3935
<FileText className="w-4 h-4 mr-2 flex-shrink-0 text-gray-500" />
40-
<span className="flex-1 truncate" title={resource.uri}>
36+
<span className="flex-1 truncate" title={resource.uri.toString()}>
4137
{resource.name}
4238
</span>
4339
<ChevronRight className="w-4 h-4 flex-shrink-0 text-gray-400" />

client/src/components/ToolsTab.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const ToolsTab = ({
6161
<p className="text-sm text-gray-600">
6262
{selectedTool.description}
6363
</p>
64-
{Object.entries(selectedTool.inputSchema.properties).map(
64+
{Object.entries(selectedTool.inputSchema.properties ?? []).map(
6565
([key, value]) => (
6666
<div key={key}>
6767
<Label
@@ -71,14 +71,17 @@ const ToolsTab = ({
7171
{key}
7272
</Label>
7373
<Input
74+
// @ts-expect-error value type is currently unknown
7475
type={value.type === "number" ? "number" : "text"}
7576
id={key}
7677
name={key}
78+
// @ts-expect-error value type is currently unknown
7779
placeholder={value.description}
7880
onChange={(e) =>
7981
setParams({
8082
...params,
8183
[key]:
84+
// @ts-expect-error value type is currently unknown
8285
value.type === "number"
8386
? Number(e.target.value)
8487
: e.target.value,

client/tsconfig.node.tsbuildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"root":["./vite.config.ts"],"version":"5.6.2"}
1+
{"root":["./vite.config.ts"],"version":"5.6.3"}

packages/mcp-typescript/dist/cli.js

Lines changed: 4 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/mcp-typescript/dist/cli.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/mcp-typescript/dist/client/sse.d.ts

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/mcp-typescript/dist/client/sse.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)