From 310c6660f14e44cb9bc1cc864766630229d47248 Mon Sep 17 00:00:00 2001 From: Matthew Wang Date: Mon, 13 Oct 2025 15:48:17 -0700 Subject: [PATCH] fix --- client/src/components/AuthTab.tsx | 2 +- client/src/components/ChatTab.tsx | 2 +- client/src/components/PromptsTab.tsx | 2 +- client/src/components/ResourcesTab.tsx | 2 +- client/src/components/ToolsTab.tsx | 2 +- client/src/components/chat/message.tsx | 2 +- client/src/components/chat/tool-call.tsx | 2 +- client/src/components/connection/server-card-utils.ts | 2 +- client/src/hooks/use-app-state.ts | 2 +- client/src/state/app-types.ts | 2 +- client/src/state/mcp-api.ts | 2 +- client/src/state/server-helpers.ts | 2 +- client/tsconfig.json | 4 +++- server/app.ts | 2 +- server/index.ts | 2 +- server/routes/mcp/chat.ts | 2 +- server/routes/mcp/evals.ts | 2 +- server/routes/mcp/servers.ts | 2 +- server/services/mcp-http-bridge.ts | 2 +- server/tsconfig.json | 4 +++- server/types/hono.ts | 2 +- server/utils/eval-transformer.ts | 2 +- 22 files changed, 26 insertions(+), 22 deletions(-) diff --git a/client/src/components/AuthTab.tsx b/client/src/components/AuthTab.tsx index 68d7a4001..5593151dc 100644 --- a/client/src/components/AuthTab.tsx +++ b/client/src/components/AuthTab.tsx @@ -23,7 +23,7 @@ import { } from "../lib/oauth-flow-types"; import { OAuthFlowProgress } from "./OAuthFlowProgress"; import { OAuthStateMachine } from "../lib/oauth-state-machine"; -import { MCPServerConfig } from "@/shared/mcp-client-manager"; +import { MCPServerConfig } from "@/sdk"; interface StatusMessageProps { message: StatusMessage; diff --git a/client/src/components/ChatTab.tsx b/client/src/components/ChatTab.tsx index e7cb38d35..57aecd593 100644 --- a/client/src/components/ChatTab.tsx +++ b/client/src/components/ChatTab.tsx @@ -8,7 +8,7 @@ import { TooltipProvider } from "./ui/tooltip"; import { motion, AnimatePresence } from "framer-motion"; import { toast } from "sonner"; import { getDefaultTemperatureForModel } from "@/lib/chat-utils"; -import { MCPServerConfig } from "@/shared/mcp-client-manager"; +import { MCPServerConfig } from "@/sdk"; import { useConvexAuth } from "convex/react"; import { useAuth } from "@workos-inc/authkit-react"; import type { ServerWithName } from "@/hooks/use-app-state"; diff --git a/client/src/components/PromptsTab.tsx b/client/src/components/PromptsTab.tsx index ee373495b..42859a486 100644 --- a/client/src/components/PromptsTab.tsx +++ b/client/src/components/PromptsTab.tsx @@ -20,7 +20,7 @@ import { MessageSquare, Play, RefreshCw, ChevronRight } from "lucide-react"; import { EmptyState } from "./ui/empty-state"; import JsonView from "react18-json-view"; import "react18-json-view/src/style.css"; -import { MCPServerConfig, type MCPPrompt } from "@/shared/mcp-client-manager"; +import { MCPServerConfig, type MCPPrompt } from "@/sdk"; interface PromptsTabProps { serverConfig?: MCPServerConfig; diff --git a/client/src/components/ResourcesTab.tsx b/client/src/components/ResourcesTab.tsx index f935c78df..5bbb063a8 100644 --- a/client/src/components/ResourcesTab.tsx +++ b/client/src/components/ResourcesTab.tsx @@ -15,7 +15,7 @@ import { MCPServerConfig, type MCPReadResourceResult, type MCPResource, -} from "@/shared/mcp-client-manager"; +} from "@/sdk"; interface ResourcesTabProps { serverConfig?: MCPServerConfig; diff --git a/client/src/components/ToolsTab.tsx b/client/src/components/ToolsTab.tsx index 2a681420f..0c9e27fc7 100644 --- a/client/src/components/ToolsTab.tsx +++ b/client/src/components/ToolsTab.tsx @@ -40,7 +40,7 @@ import { } from "@/lib/mcp-tools-api"; import { validateToolOutput } from "@/lib/schema-utils"; import "react18-json-view/src/style.css"; -import { MCPServerConfig } from "@/shared/mcp-client-manager"; +import { MCPServerConfig } from "@/sdk"; type ToolMap = Record; type FormField = ToolFormField; diff --git a/client/src/components/chat/message.tsx b/client/src/components/chat/message.tsx index 09be987b7..a39c729af 100644 --- a/client/src/components/chat/message.tsx +++ b/client/src/components/chat/message.tsx @@ -11,7 +11,7 @@ import { ToolCallDisplay } from "./tool-call"; import { getProviderLogoFromModel } from "./chat-helpers"; import { usePreferencesStore } from "@/stores/preferences/preferences-provider"; import { ModelDefinition } from "@/shared/types.js"; -import { MCPServerConfig } from "@/shared/mcp-client-manager"; +import { MCPServerConfig } from "@/sdk"; // Reusable Image Attachment Component const ImageAttachment = ({ diff --git a/client/src/components/chat/tool-call.tsx b/client/src/components/chat/tool-call.tsx index ac20de6aa..01030ea4e 100644 --- a/client/src/components/chat/tool-call.tsx +++ b/client/src/components/chat/tool-call.tsx @@ -12,7 +12,7 @@ import { ToolCall, ToolResult } from "@/lib/chat-types"; import { cn } from "@/lib/utils"; import { MCPIcon } from "../ui/mcp-icon"; import { UIResourceRenderer } from "@mcp-ui/client"; -import { MCPServerConfig } from "@/shared/mcp-client-manager"; +import { MCPServerConfig } from "@/sdk"; import { OpenAIComponentRenderer } from "./openai-component-renderer"; interface ToolCallDisplayProps { diff --git a/client/src/components/connection/server-card-utils.ts b/client/src/components/connection/server-card-utils.ts index 756e61a65..dcae91fbd 100644 --- a/client/src/components/connection/server-card-utils.ts +++ b/client/src/components/connection/server-card-utils.ts @@ -1,6 +1,6 @@ import type { ComponentType } from "react"; import { Check, Loader2, Wifi, X } from "lucide-react"; -import type { MCPServerConfig } from "@/shared/mcp-client-manager"; +import type { MCPServerConfig } from "@/sdk"; import type { ConnectionStatus } from "@/state/app-types"; interface ConnectionStatusMeta { diff --git a/client/src/hooks/use-app-state.ts b/client/src/hooks/use-app-state.ts index e272a101e..bc8313ce6 100644 --- a/client/src/hooks/use-app-state.ts +++ b/client/src/hooks/use-app-state.ts @@ -21,7 +21,7 @@ import { getStoredTokens, clearOAuthData, } from "@/lib/mcp-oauth"; -import { MCPServerConfig } from "@/shared/mcp-client-manager"; +import { MCPServerConfig } from "@/sdk"; export type { ServerWithName } from "@/state/app-types"; export function useAppState() { diff --git a/client/src/state/app-types.ts b/client/src/state/app-types.ts index 2d1a3742b..8cd0a9145 100644 --- a/client/src/state/app-types.ts +++ b/client/src/state/app-types.ts @@ -1,4 +1,4 @@ -import { MCPServerConfig } from "@/shared/mcp-client-manager"; +import { MCPServerConfig } from "@/sdk"; import { OauthTokens } from "@/shared/types.js"; export type ConnectionStatus = diff --git a/client/src/state/mcp-api.ts b/client/src/state/mcp-api.ts index 6e49291b5..991e4f297 100644 --- a/client/src/state/mcp-api.ts +++ b/client/src/state/mcp-api.ts @@ -1,4 +1,4 @@ -import { MCPServerConfig } from "@/shared/mcp-client-manager"; +import { MCPServerConfig } from "@/sdk"; export async function testConnection( serverConfig: MCPServerConfig, diff --git a/client/src/state/server-helpers.ts b/client/src/state/server-helpers.ts index 452900872..63a0c7df2 100644 --- a/client/src/state/server-helpers.ts +++ b/client/src/state/server-helpers.ts @@ -1,4 +1,4 @@ -import { MCPServerConfig } from "@/shared/mcp-client-manager"; +import { MCPServerConfig } from "@/sdk"; import { HttpServerDefinition, StdioServerDefinition, diff --git a/client/tsconfig.json b/client/tsconfig.json index 8beb91d38..3ba51113b 100644 --- a/client/tsconfig.json +++ b/client/tsconfig.json @@ -19,7 +19,9 @@ "baseUrl": ".", "paths": { "@/*": ["./src/*"], - "@/shared/*": ["../shared/*"] + "@/shared/*": ["../shared/*"], + "@/sdk": ["../sdk/index.ts"], + "@/sdk/*": ["../sdk/*"] } }, "include": ["src", "../shared/**/*.ts"], diff --git a/server/app.ts b/server/app.ts index 89262ad68..1e9b43b6a 100644 --- a/server/app.ts +++ b/server/app.ts @@ -10,7 +10,7 @@ import { fileURLToPath } from "url"; // Import routes import mcpRoutes from "./routes/mcp/index.js"; -import { MCPClientManager } from "@/shared/mcp-client-manager"; +import { MCPClientManager } from "@/sdk"; import path from "path"; const __filename = fileURLToPath(import.meta.url); diff --git a/server/index.ts b/server/index.ts index e613defbe..c85d4c96b 100644 --- a/server/index.ts +++ b/server/index.ts @@ -12,6 +12,7 @@ import { serveStatic } from "@hono/node-server/serve-static"; import { readFileSync, existsSync } from "fs"; import { join, dirname, resolve } from "path"; import { fileURLToPath } from "url"; +import { MCPClientManager } from "@/sdk"; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); @@ -61,7 +62,6 @@ function logBox(content: string, title?: string) { import mcpRoutes from "./routes/mcp/index"; import { interceptorStore } from "./services/interceptor-store"; import "./types/hono"; // Type extensions -import { MCPClientManager } from "@/shared/mcp-client-manager"; // Utility function to extract MCP server config from environment variables function getMCPConfigFromEnv() { diff --git a/server/routes/mcp/chat.ts b/server/routes/mcp/chat.ts index 69d2db1d0..99e34f9f3 100644 --- a/server/routes/mcp/chat.ts +++ b/server/routes/mcp/chat.ts @@ -18,7 +18,7 @@ import { runBackendConversation, } from "@/shared/backend-conversation"; import zodToJsonSchema from "zod-to-json-schema"; -import { MCPClientManager } from "@/shared/mcp-client-manager"; +import { MCPClientManager } from "@/sdk"; // Types interface ElicitationResponse { diff --git a/server/routes/mcp/evals.ts b/server/routes/mcp/evals.ts index 31e8ee22e..22116ce92 100644 --- a/server/routes/mcp/evals.ts +++ b/server/routes/mcp/evals.ts @@ -10,7 +10,7 @@ import { generateTestCases, type DiscoveredTool, } from "../../services/eval-agent"; -import type { MCPClientManager } from "@/shared/mcp-client-manager"; +import type { MCPClientManager } from "@/sdk"; import "../../types/hono"; function resolveServerIdsOrThrow( diff --git a/server/routes/mcp/servers.ts b/server/routes/mcp/servers.ts index fcb7aaf6d..5789c99de 100644 --- a/server/routes/mcp/servers.ts +++ b/server/routes/mcp/servers.ts @@ -1,5 +1,5 @@ import { Hono } from "hono"; -import type { MCPServerConfig } from "@/shared/mcp-client-manager"; +import type { MCPServerConfig } from "@/sdk"; import "../../types/hono"; // Type extensions const servers = new Hono(); diff --git a/server/services/mcp-http-bridge.ts b/server/services/mcp-http-bridge.ts index 1de3db274..642a61a88 100644 --- a/server/services/mcp-http-bridge.ts +++ b/server/services/mcp-http-bridge.ts @@ -1,4 +1,4 @@ -import { MCPClientManager } from "@/shared/mcp-client-manager"; +import { MCPClientManager } from "@/sdk"; import { z } from "zod"; import { zodToJsonSchema } from "zod-to-json-schema"; diff --git a/server/tsconfig.json b/server/tsconfig.json index e3cca8eb3..e7c8dbfdb 100644 --- a/server/tsconfig.json +++ b/server/tsconfig.json @@ -20,7 +20,9 @@ "baseUrl": ".", "paths": { "@/*": ["./src/*"], - "@/shared/*": ["../shared/*"] + "@/shared/*": ["../shared/*"], + "@/sdk": ["../sdk/index.ts"], + "@/sdk/*": ["../sdk/*"] }, "types": ["node"] }, diff --git a/server/types/hono.ts b/server/types/hono.ts index d25f66d08..3cf09fee8 100644 --- a/server/types/hono.ts +++ b/server/types/hono.ts @@ -1,4 +1,4 @@ -import type { MCPClientManager } from "@/shared/mcp-client-manager"; +import type { MCPClientManager } from "@/sdk"; // Extend Hono's context with our custom variables declare module "hono" { diff --git a/server/utils/eval-transformer.ts b/server/utils/eval-transformer.ts index 0fc4759bc..9757b2ffb 100644 --- a/server/utils/eval-transformer.ts +++ b/server/utils/eval-transformer.ts @@ -1,5 +1,5 @@ import { MCPClientOptions } from "@mastra/mcp"; -import { MCPClientManager, MCPServerConfig } from "@/shared/mcp-client-manager"; +import { MCPClientManager, MCPServerConfig } from "@/sdk"; import { LlmsConfig, LlmsConfigSchema,