UNPKG

@skyramp/mcp

Version:

Skyramp MCP (Model Context Protocol) Server - AI-powered test generation and execution

37 lines (34 loc) 1.5 kB
import { baseTestSchema } from "../types/TestTypes.js"; import { TestGenerationService, } from "../services/TestGenerationService.js"; import { z } from "zod"; const fuzzTestSchema = { ...baseTestSchema, responseData: z .string() .describe("Sample response body data, provided either as an inline JSON/YAML string or as an absolute file path prefixed with '@' (e.g., @/absolute/path/to/file)"), }; export class FuzzTestService extends TestGenerationService { getTestType() { return "fuzz"; } buildGenerationOptions(params) { return { ...super.buildBaseGenerationOptions(params), responseData: params.responseData, }; } } export function registerFuzzTestTool(server) { server.registerTool("skyramp_fuzz_test_generation", { description: `Generate a fuzz test using Skyramp's deterministic test generation platform. Fuzz tests improve application security and reliability by sending invalid, malformed, or unexpected data to your API endpoints. They help discover edge cases, input validation issues, error handling problems, and potential security vulnerabilities. For detailed documentation visit: https://www.skyramp.dev/docs/fuzz-test`, inputSchema: fuzzTestSchema, annotations: { keywords: ["negative test", "random test"], }, }, async (params) => { const service = new FuzzTestService(); return await service.generateTest(params); }); }