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>
31 lines
1.2 KiB
JavaScript
31 lines
1.2 KiB
JavaScript
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
|