diff --git a/.serena/memories/code_style_conventions.md b/.serena/memories/code_style_conventions.md index 917e47c..cc9b1c0 100644 --- a/.serena/memories/code_style_conventions.md +++ b/.serena/memories/code_style_conventions.md @@ -12,11 +12,11 @@ - **Declaration Files**: Generated with source maps ## Naming Conventions -- **Classes**: PascalCase (e.g., `HelloWorldTool`, `PenpotMcpServer`) +- **Classes**: PascalCase (e.g., `ExeceuteCodeTool`, `PenpotMcpServer`) - **Interfaces**: PascalCase (e.g., `Tool`) - **Methods**: camelCase (e.g., `execute`, `registerTools`) - **Constants**: camelCase for readonly properties (e.g., `definition`) -- **Files**: PascalCase for classes (e.g., `HelloWorldTool.ts`) +- **Files**: PascalCase for classes (e.g., `ExecuteCodeTool.ts`) ## Documentation Style - **JSDoc**: Use comprehensive JSDoc comments for classes, methods, and interfaces diff --git a/mcp-server/src/PenpotMcpServer.ts b/mcp-server/src/PenpotMcpServer.ts index f941e77..d5dde23 100644 --- a/mcp-server/src/PenpotMcpServer.ts +++ b/mcp-server/src/PenpotMcpServer.ts @@ -1,8 +1,6 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { SSEServerTransport } from "@modelcontextprotocol/sdk/server/sse.js"; import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js"; - -import { HelloWorldTool } from "./tools/HelloWorldTool"; import { PrintTextTool } from "./tools/PrintTextTool"; import { ExecuteCodeTool } from "./tools/ExecuteCodeTool"; import { PluginBridge } from "./PluginBridge"; @@ -63,7 +61,6 @@ export class PenpotMcpServer { private registerTools(): void { const toolInstances: Tool[] = [ - new HelloWorldTool(this), new PrintTextTool(this), new ExecuteCodeTool(this), new HighLevelOverviewTool(this), diff --git a/mcp-server/src/tools/HelloWorldTool.ts b/mcp-server/src/tools/HelloWorldTool.ts deleted file mode 100644 index e3910a8..0000000 --- a/mcp-server/src/tools/HelloWorldTool.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { z } from "zod"; -import { Tool } from "../Tool"; -import "reflect-metadata"; -import type { ToolResponse } from "../ToolResponse"; -import { TextResponse } from "../ToolResponse"; -import { PenpotMcpServer } from "../PenpotMcpServer"; - -/** - * Arguments class for the HelloWorld tool with validation decorators. - */ -export class HelloWorldArgs { - static schema = { - name: z.string(), - }; - - /** - * The name to include in the greeting message. - */ - name!: string; -} - -/** - * Type-safe HelloWorld tool with automatic validation and schema generation. - * - * This tool directly implements the Tool interface while maintaining full - * type safety through the protected executeTypeSafe method. - */ -export class HelloWorldTool extends Tool { - /** - * @param mcpServer - The MCP server instance - */ - constructor(mcpServer: PenpotMcpServer) { - super(mcpServer, HelloWorldArgs.schema); - } - - public getToolName(): string { - return "hello_world"; - } - - public getToolDescription(): string { - return "Returns a personalized greeting message with the provided name"; - } - - /** - * Executes the hello world functionality with type-safe, validated arguments. - * - * This method receives fully validated arguments with complete type safety. - * No casting or manual validation is required. - * - * @param args - The validated HelloWorldArgs instance - */ - protected async executeCore(args: HelloWorldArgs): Promise { - return new TextResponse( - `Hello, ${args.name}! This greeting was generated with full type safety and automatic validation.` - ); - } -}