Files
virtfusion-mcp/scripts/extract-endpoints.ts
Andrew 40d5e8161a
All checks were successful
Endpoint Sync Check / check-drift (push) Successful in 20s
CI / build (push) Successful in 26s
feat: initial implementation of VirtFusion MCP server
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>
2026-03-15 23:34:48 -04:00

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));