All checks were successful
CI / build (push) Successful in 32s
Complete MCP server wrapping all 84 VirtFusion Admin API endpoints: - Core HTTP client with Bearer auth and error handling - 17 tool modules organized by API category - Endpoint drift detection scripts and Gitea Actions CI/CD - Comprehensive README with configuration examples - CLAUDE.md for AI assistant onboarding Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
33 lines
940 B
TypeScript
33 lines
940 B
TypeScript
import { readFileSync } from 'node:fs';
|
|
import { parse } from 'yaml';
|
|
|
|
interface Endpoint {
|
|
method: string;
|
|
path: string;
|
|
summary: string;
|
|
tag: string;
|
|
}
|
|
|
|
const specPath = new URL('../openapi.yaml', import.meta.url).pathname;
|
|
const spec = parse(readFileSync(specPath, 'utf-8'));
|
|
|
|
const endpoints: Endpoint[] = [];
|
|
|
|
for (const [path, methods] of Object.entries(spec.paths as Record<string, Record<string, unknown>>)) {
|
|
for (const [method, details] of Object.entries(methods)) {
|
|
if (['get', 'post', 'put', 'delete', 'patch'].includes(method)) {
|
|
const op = details as { summary?: string; tags?: string[] };
|
|
endpoints.push({
|
|
method: method.toUpperCase(),
|
|
path,
|
|
summary: op.summary ?? '',
|
|
tag: op.tags?.[0] ?? 'Untagged',
|
|
});
|
|
}
|
|
}
|
|
}
|
|
|
|
endpoints.sort((a, b) => a.path.localeCompare(b.path) || a.method.localeCompare(b.method));
|
|
|
|
console.log(JSON.stringify(endpoints, null, 2));
|