feat: initial implementation of VirtFusion MCP server
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>
This commit is contained in:
2026-03-15 23:37:31 -04:00
commit 3d0eed4f17
35 changed files with 13070 additions and 0 deletions

38
src/tools/hypervisors.ts Normal file
View File

@@ -0,0 +1,38 @@
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
import { z } from 'zod';
import { VirtFusionClient } from '../client.js';
import { formatErrorResponse } from '../errors.js';
export function registerHypervisorTools(server: McpServer, client: VirtFusionClient): void {
server.tool(
'hypervisors_list',
'List all hypervisors',
{
results: z.number().optional().describe('Number of results to return'),
},
async ({ results }) => {
try {
const result = await client.get('/compute/hypervisors', { results });
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
} catch (error) {
return formatErrorResponse(error);
}
}
);
server.tool(
'hypervisors_get',
'Retrieve details of a specific hypervisor',
{
hypervisorId: z.number().describe('The hypervisor ID'),
},
async ({ hypervisorId }) => {
try {
const result = await client.get(`/compute/hypervisors/${hypervisorId}`);
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
} catch (error) {
return formatErrorResponse(error);
}
}
);
}