diff --git a/mcp/src/index.ts b/mcp/src/index.ts index 96b6fca..b98f332 100644 --- a/mcp/src/index.ts +++ b/mcp/src/index.ts @@ -51,6 +51,87 @@ async function startHttp(server: ReturnType, port: number) res.writeHead(405).end(JSON.stringify({ error: "Session management not supported" })); }); + // MCP Server Card (Smithery metadata) + app.get("/.well-known/mcp/server-card.json", (_req, res) => { + res.json({ + serverInfo: { name: "web-inspector-mcp", version: "1.0.0" }, + authentication: { required: false }, + tools: [ + { + name: "inspect_page", + description: + "Inspect a single web page for HTML/CSS quality, accessibility (WCAG/KWCAG), SEO, and performance/security. Returns scores, grades, and top issues.", + inputSchema: { + type: "object", + properties: { + url: { type: "string", description: "URL to inspect" }, + accessibility_standard: { + type: "string", + enum: ["wcag_2.0_a", "wcag_2.0_aa", "wcag_2.1_aa", "wcag_2.2_aa", "kwcag_2.1", "kwcag_2.2"], + }, + language: { type: "string", enum: ["en", "ko"] }, + }, + required: ["url"], + }, + }, + { + name: "inspect_site", + description: + "Start a site-wide crawl and inspection. Returns a site_inspection_id for tracking.", + inputSchema: { + type: "object", + properties: { + url: { type: "string" }, + max_pages: { type: "number" }, + max_depth: { type: "number" }, + language: { type: "string", enum: ["en", "ko"] }, + }, + required: ["url"], + }, + }, + { + name: "get_inspection", + description: "Get detailed inspection results by ID.", + inputSchema: { + type: "object", + properties: { id: { type: "string" }, language: { type: "string", enum: ["en", "ko"] } }, + required: ["id"], + }, + }, + { + name: "get_issues", + description: + "Get filtered issues for single-page or site inspections.", + inputSchema: { + type: "object", + properties: { + id: { type: "string" }, + category: { type: "string" }, + severity: { type: "string" }, + page_url: { type: "string" }, + language: { type: "string", enum: ["en", "ko"] }, + }, + required: ["id"], + }, + }, + { + name: "get_history", + description: "List recent inspection history.", + inputSchema: { + type: "object", + properties: { + url: { type: "string" }, + limit: { type: "number" }, + language: { type: "string", enum: ["en", "ko"] }, + }, + }, + }, + ], + resources: [], + prompts: [], + }); + }); + // Health check app.get("/health", (_req, res) => { res.json({ status: "ok", transport: "http", api_url: API_URL });