Skip to content

Commit 567c15a

Browse files
authored
Merge pull request modelcontextprotocol#20 from modelcontextprotocol/ashwin/ping
Add ping tab
2 parents dca7c77 + 9f5366c commit 567c15a

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

client/src/App.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
ClientRequest,
1313
ProgressNotificationSchema,
1414
ServerNotification,
15+
EmptyResultSchema,
1516
} from "mcp-typescript/types.js";
1617
import { useState, useRef } from "react";
1718
import {
@@ -42,6 +43,7 @@ import ToolsTab from "./components/ToolsTab";
4243
import { AnyZodObject } from "zod";
4344
import HistoryAndNotifications from "./components/History";
4445
import "./App.css";
46+
import PingTab from "./components/PingTab";
4547

4648
const App = () => {
4749
const [connectionStatus, setConnectionStatus] = useState<
@@ -293,6 +295,10 @@ const App = () => {
293295
<Terminal className="w-4 h-4 mr-2" />
294296
Console
295297
</TabsTrigger>
298+
<TabsTrigger value="ping">
299+
<Bell className="w-4 h-4 mr-2" />
300+
Ping
301+
</TabsTrigger>
296302
</TabsList>
297303

298304
<div className="w-full">
@@ -331,6 +337,16 @@ const App = () => {
331337
error={error}
332338
/>
333339
<ConsoleTab />
340+
<PingTab
341+
onPingClick={() => {
342+
void makeRequest(
343+
{
344+
method: "ping" as const,
345+
},
346+
EmptyResultSchema,
347+
);
348+
}}
349+
/>
334350
</div>
335351
</Tabs>
336352
) : (

client/src/components/PingTab.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { TabsContent } from "@/components/ui/tabs";
2+
import { Button } from "@/components/ui/button";
3+
4+
const PingTab = ({ onPingClick }: { onPingClick: () => void }) => {
5+
return (
6+
<TabsContent value="ping" className="grid grid-cols-2 gap-4">
7+
<div className="col-span-2 flex justify-center items-center">
8+
<Button
9+
onClick={onPingClick}
10+
className="bg-gradient-to-r from-purple-500 to-pink-500 hover:from-purple-600 hover:to-pink-600 text-white font-bold py-6 px-12 rounded-full shadow-lg transform transition duration-300 hover:scale-110 focus:outline-none focus:ring-4 focus:ring-purple-300 animate-pulse"
11+
>
12+
<span className="text-3xl mr-2">🚀</span>
13+
MEGA PING
14+
<span className="text-3xl ml-2">💥</span>
15+
</Button>
16+
</div>
17+
</TabsContent>
18+
);
19+
};
20+
21+
export default PingTab;

0 commit comments

Comments
 (0)