From d973f58bef6584a9070676be88a4ca2925272389 Mon Sep 17 00:00:00 2001 From: Ashwin Bhat Date: Thu, 9 Jan 2025 11:01:28 -0800 Subject: [PATCH 1/5] run prettier check in CI --- .github/workflows/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2665e9d..572e79e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,6 +14,9 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Check formatting + run: npx prettier --check . + - uses: actions/setup-node@v4 with: node-version: 18 From 715936d747ae798f61eb402e4f319b6af23743f6 Mon Sep 17 00:00:00 2001 From: Ashwin Bhat Date: Thu, 9 Jan 2025 11:01:35 -0800 Subject: [PATCH 2/5] run prettier --- .prettierignore | 2 + client/src/App.tsx | 58 +++++++++++++++--------- client/src/components/Sidebar.tsx | 32 +++++++++++-- client/src/components/ToolsTab.tsx | 3 +- client/src/lib/hooks/useConnection.ts | 33 +++++++++----- client/src/lib/hooks/useDraggablePane.ts | 37 +++++++++------ client/src/main.tsx | 4 +- client/vite.config.ts | 8 ++-- 8 files changed, 118 insertions(+), 59 deletions(-) diff --git a/.prettierignore b/.prettierignore index b7c83c0..c8824c9 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,4 @@ packages server/build +CODE_OF_CONDUCT.md +SECURITY.md diff --git a/client/src/App.tsx b/client/src/App.tsx index c225c30..f3791b2 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -16,7 +16,7 @@ import { ResourceTemplate, Root, ServerNotification, - Tool + Tool, } from "@modelcontextprotocol/sdk/types.js"; import { useEffect, useRef, useState } from "react"; @@ -124,10 +124,7 @@ const App = () => { const [nextToolCursor, setNextToolCursor] = useState(); const progressTokenRef = useRef(0); - const { - height: historyPaneHeight, - handleDragStart - } = useDraggablePane(300); + const { height: historyPaneHeight, handleDragStart } = useDraggablePane(300); const { connectionStatus, @@ -136,7 +133,7 @@ const App = () => { requestHistory, makeRequest: makeConnectionRequest, sendNotification, - connect: connectMcpServer + connect: connectMcpServer, } = useConnection({ transportType, command, @@ -145,18 +142,21 @@ const App = () => { env, proxyServerUrl: PROXY_SERVER_URL, onNotification: (notification) => { - setNotifications(prev => [...prev, notification as ServerNotification]); + setNotifications((prev) => [...prev, notification as ServerNotification]); }, onStdErrNotification: (notification) => { - setStdErrNotifications(prev => [...prev, notification as StdErrNotification]); + setStdErrNotifications((prev) => [ + ...prev, + notification as StdErrNotification, + ]); }, onPendingRequest: (request, resolve, reject) => { - setPendingSampleRequests(prev => [ + setPendingSampleRequests((prev) => [ ...prev, - { id: nextRequestId.current++, request, resolve, reject } + { id: nextRequestId.current++, request, resolve, reject }, ]); }, - getRoots: () => rootsRef.current + getRoots: () => rootsRef.current, }); const makeRequest = async ( @@ -345,26 +345,40 @@ const App = () => { {mcpClient ? ( (window.location.hash = value)} > - + Resources - + Prompts - + Tools @@ -388,7 +402,9 @@ const App = () => {
- {!serverCapabilities?.resources && !serverCapabilities?.prompts && !serverCapabilities?.tools ? ( + {!serverCapabilities?.resources && + !serverCapabilities?.prompts && + !serverCapabilities?.tools ? (

The connected server does not support any MCP capabilities diff --git a/client/src/components/Sidebar.tsx b/client/src/components/Sidebar.tsx index c716bd2..17cd59d 100644 --- a/client/src/components/Sidebar.tsx +++ b/client/src/components/Sidebar.tsx @@ -1,5 +1,12 @@ import { useState } from "react"; -import { Play, ChevronDown, ChevronRight, CircleHelp, Bug, Github } from "lucide-react"; +import { + Play, + ChevronDown, + ChevronRight, + CircleHelp, + Bug, + Github, +} from "lucide-react"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { @@ -243,18 +250,33 @@ const Sidebar = ({

- + - + - - diff --git a/client/src/components/ToolsTab.tsx b/client/src/components/ToolsTab.tsx index 77a97e7..6b64c01 100644 --- a/client/src/components/ToolsTab.tsx +++ b/client/src/components/ToolsTab.tsx @@ -174,8 +174,7 @@ const ToolsTab = ({ } className="mt-1" /> - ) : - /* @ts-expect-error value type is currently unknown */ + ) : /* @ts-expect-error value type is currently unknown */ value.type === "object" ? (