feat: MCP server-card.json 엔드포인트 추가
Smithery 품질 점수 개선을 위한 메타데이터 엔드포인트 추가 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@ -51,6 +51,87 @@ async function startHttp(server: ReturnType<typeof createServer>, 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 });
|
||||
|
||||
Reference in New Issue
Block a user