diff --git a/mcp_settings.json b/mcp_settings.json index 39723b4..f413681 100644 --- a/mcp_settings.json +++ b/mcp_settings.json @@ -1,18 +1,18 @@ { "mcpServers": { - "time-mcp": { - "command": "npx", - "args": [ - "-y", - "time-mcp" - ] - }, "sequential-thinking": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-sequential-thinking" ] + }, + "time-mcp": { + "command": "npx", + "args": [ + "-y", + "time-mcp" + ] } } } \ No newline at end of file diff --git a/src/services/mcpService.ts b/src/services/mcpService.ts index ddb261b..63b640d 100644 --- a/src/services/mcpService.ts +++ b/src/services/mcpService.ts @@ -209,6 +209,8 @@ export const createMcpServer = (name: string, version: string): McpServer => { return new McpServer({ name, version }); }; +// Optimized comments to focus on key details and removed redundant explanations + // Helper function: Convert JSON Schema to Zod Schema function cast(inputSchema: unknown): ZodRawShape { if (typeof inputSchema !== 'object' || inputSchema === null) { @@ -250,7 +252,7 @@ function cast(inputSchema: unknown): ZodRawShape { } if (prop.description) { - zodType = zodType.describe(prop.description); + zodType = zodType.describe(prop.description); // Add description to the schema } processedSchema[key] = zodType.optional(); diff --git a/src/types/index.ts b/src/types/index.ts index c5ec73d..1f138ff 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -2,40 +2,46 @@ import { Client } from '@modelcontextprotocol/sdk/client/index.js'; import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js'; import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js'; +// Represents the settings for MCP servers export interface McpSettings { mcpServers: { - [key: string]: ServerConfig; + [key: string]: ServerConfig; // Key-value pairs of server names and their configurations }; } +// Configuration details for an individual server export interface ServerConfig { - url?: string; - command?: string; - args?: string[]; - env?: Record; + url?: string; // URL for SSE-based servers + command?: string; // Command to execute for stdio-based servers + args?: string[]; // Arguments for the command + env?: Record; // Environment variables } +// Information about a server's status and tools export interface ServerInfo { - name: string; - status: 'connected' | 'connecting' | 'disconnected'; - tools: ToolInfo[]; - client?: Client; - transport?: SSEClientTransport | StdioClientTransport; + name: string; // Unique name of the server + status: 'connected' | 'connecting' | 'disconnected'; // Current connection status + tools: ToolInfo[]; // List of tools available on the server + client?: Client; // Client instance for communication + transport?: SSEClientTransport | StdioClientTransport; // Transport mechanism used } +// Details about a tool available on the server export interface ToolInfo { - name: string; - description: string; - inputSchema: Record; + name: string; // Name of the tool + description: string; // Brief description of the tool + inputSchema: Record; // Input schema for the tool } -export interface ApiResponse { - success: boolean; - message?: string; - data?: T; +// Standardized API response structure +export interface ApiResponse { + success: boolean; // Indicates if the operation was successful + message?: string; // Optional message providing additional details + data?: T; // Optional data payload } +// Request payload for adding a new server export interface AddServerRequest { - name: string; - config: ServerConfig; + name: string; // Name of the server to add + config: ServerConfig; // Configuration details for the server } \ No newline at end of file