kobold_sd_models
Discover and list available Stable Diffusion models integrated with KoboldAI's text generation capabilities via the MCP server. Simplify model management for creative and AI-driven projects.
Instructions
List available Stable Diffusion models
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| apiUrl | No | http://localhost:5001 |
Implementation Reference
- src/index.ts:318-324 (handler)Handler logic for executing GET-based tools like kobold_sd_models by proxying the request to the KoboldAI API endpoint.if (getEndpoints[name]) { const result = await makeRequest(`${apiUrl}${getEndpoints[name]}`); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], isError: false, }; }
- src/index.ts:11-13 (schema)BaseConfigSchema defines the optional apiUrl parameter used as input schema for kobold_sd_models (via SDModelsSchema alias).const BaseConfigSchema = z.object({ apiUrl: z.string().default('http://localhost:5001'), });
- src/index.ts:234-238 (registration)Registers the kobold_sd_models tool in the ListTools response with name, description, and input schema reference.{ name: "kobold_sd_models", description: "List available Stable Diffusion models", inputSchema: zodToJsonSchema(SDModelsSchema), },
- src/index.ts:307-316 (helper)Endpoint mapping object that routes kobold_sd_models to '/sdapi/v1/sd-models'.const getEndpoints: Record<string, string> = { kobold_max_context_length: '/api/v1/config/max_context_length', kobold_max_length: '/api/v1/config/max_length', kobold_generate_check: '/api/extra/generate/check', kobold_model_info: '/api/v1/model', kobold_version: '/api/v1/info/version', kobold_perf_info: '/api/extra/perf', kobold_sd_models: '/sdapi/v1/sd-models', kobold_sd_samplers: '/sdapi/v1/samplers', };
- src/index.ts:146-162 (helper)Generic HTTP client function used by all tool handlers to proxy requests to the KoboldAI server.async function makeRequest(url: string, method = 'GET', body: Record<string, unknown> | null = null) { const options: RequestInit = { method, headers: body ? { 'Content-Type': 'application/json' } : undefined, }; if (body && method !== 'GET') { options.body = JSON.stringify(body); } const response = await fetch(url, options); if (!response.ok) { throw new Error(`KoboldAI API error: ${response.statusText}`); } return response.json(); }