feat: MCP 서버 추가 — AI 에이전트용 웹 검사 도구
Node.js + TypeScript MCP 서버 구현: - 5개 도구: inspect_page, inspect_site, get_inspection, get_issues, get_history - 듀얼 트랜스포트: stdio (Claude Desktop) + Streamable HTTP (Docker/원격) - i18n 지원 (영어/한국어) - Docker 통합 (port 3100) + Nginx /mcp 프록시 - Smithery 레지스트리 배포 설정 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
31
mcp/dist/tools/get-history.js
vendored
Normal file
31
mcp/dist/tools/get-history.js
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
import { t } from "../i18n/index.js";
|
||||
export async function getHistory(client, lang, url, limit) {
|
||||
const result = await client.getInspections(url, limit || 10);
|
||||
const lines = [];
|
||||
lines.push(`# ${t("get_history.title", lang)}`);
|
||||
lines.push(`**${t("get_history.total", lang)}**: ${result.total}`);
|
||||
if (url) {
|
||||
lines.push(`**Filter**: ${url}`);
|
||||
}
|
||||
lines.push("");
|
||||
if (result.items.length === 0) {
|
||||
lines.push("No inspection records found.");
|
||||
return lines.join("\n");
|
||||
}
|
||||
lines.push("| # | URL | Score | Grade | Issues | Date |");
|
||||
lines.push("|---|---|---|---|---|---|");
|
||||
for (let i = 0; i < result.items.length; i++) {
|
||||
const item = result.items[i];
|
||||
const date = item.created_at.split("T")[0];
|
||||
const urlShort = item.url.length > 50 ? item.url.slice(0, 47) + "..." : item.url;
|
||||
lines.push(`| ${i + 1} | ${urlShort} | ${item.overall_score} | ${item.grade} | ${item.total_issues} | ${date} |`);
|
||||
}
|
||||
lines.push("");
|
||||
// Include inspection IDs for follow-up
|
||||
lines.push("## Inspection IDs");
|
||||
for (const item of result.items) {
|
||||
lines.push(`- ${item.url}: \`${item.inspection_id}\``);
|
||||
}
|
||||
return lines.join("\n");
|
||||
}
|
||||
//# sourceMappingURL=get-history.js.map
|
||||
Reference in New Issue
Block a user