Remove unused RequestsTab

This commit is contained in:
Justin Spahr-Summers
2024-11-12 13:33:52 +00:00
parent 733d2a6e6e
commit 0716adafc6
2 changed files with 11 additions and 45 deletions

View File

@@ -1,8 +1,10 @@
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
import {
CompatibilityCallToolResultSchema,
ClientNotification,
ClientRequest,
CompatibilityCallToolResult,
CompatibilityCallToolResultSchema,
CreateMessageRequestSchema,
CreateMessageResult,
EmptyResultSchema,
@@ -19,8 +21,6 @@ import {
Root,
ServerNotification,
Tool,
CompatibilityCallToolResult,
ClientNotification,
} from "@modelcontextprotocol/sdk/types.js";
import { useEffect, useRef, useState } from "react";
// Add dark mode class based on system preference
@@ -40,16 +40,16 @@ import {
import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs";
import {
Bell,
ChevronDown,
ChevronRight,
Files,
FolderTree,
Hammer,
Hash,
MessageSquare,
Play,
Send,
Terminal,
FolderTree,
ChevronDown,
ChevronRight,
} from "lucide-react";
import { ZodType } from "zod";
@@ -58,7 +58,6 @@ import ConsoleTab from "./components/ConsoleTab";
import HistoryAndNotifications from "./components/History";
import PingTab from "./components/PingTab";
import PromptsTab, { Prompt } from "./components/PromptsTab";
import RequestsTab from "./components/RequestsTabs";
import ResourcesTab from "./components/ResourcesTab";
import RootsTab from "./components/RootsTab";
import SamplingTab, { PendingRequest } from "./components/SamplingTab";
@@ -184,7 +183,7 @@ const App = () => {
if (!mcpClient) {
throw new Error("MCP client not connected");
}
try {
const response = await mcpClient.request(request, schema);
pushHistory(request, response);
@@ -222,7 +221,7 @@ const App = () => {
setResources(resources.concat(response.resources ?? []));
setNextResourceCursor(response.nextCursor);
};
const listResourceTemplates = async () => {
const response = await makeRequest(
{
@@ -239,7 +238,7 @@ const App = () => {
);
setNextResourceTemplateCursor(response.nextCursor);
};
const readResource = async (uri: string) => {
const response = await makeRequest(
{
@@ -264,7 +263,7 @@ const App = () => {
setPrompts(response.prompts);
setNextPromptCursor(response.nextCursor);
};
const getPrompt = async (name: string, args: Record<string, string> = {}) => {
const response = await makeRequest(
{
@@ -289,7 +288,7 @@ const App = () => {
setTools(response.tools);
setNextToolCursor(response.nextCursor);
};
const callTool = async (name: string, params: Record<string, unknown>) => {
const response = await makeRequest(
{

View File

@@ -1,33 +0,0 @@
import { TabsContent } from "@/components/ui/tabs";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Textarea } from "@/components/ui/textarea";
import { Send } from "lucide-react";
const RequestsTab = () => (
<TabsContent value="requests" className="space-y-4">
<div className="grid grid-cols-2 gap-4">
<div className="space-y-4">
<div className="flex space-x-2">
<Input placeholder="Method name" />
<Button>
<Send className="w-4 h-4 mr-2" />
Send
</Button>
</div>
<Textarea
placeholder="Request parameters (JSON)"
className="h-64 font-mono"
/>
</div>
<div>
<div className="bg-gray-50 p-4 rounded-lg h-96 font-mono text-sm overflow-auto">
<div className="text-gray-500 mb-2">Response:</div>
{/* Response content would go here */}
</div>
</div>
</div>
</TabsContent>
);
export default RequestsTab;