MCP Server for ComfyUI text to image Workflow
This MCP server has two tools with basic descriptions but significant gaps in parameter documentation, schema clarity, and error handling. Both tools are directly visible in src/comfy_mcp_server/__init__.py with explicit @mcp.tool() registration. Tool names are action-verb-based (generate_prompt, generate_image), which follows the verb_noun convention. However, parameter descriptions are minimal, output schemas are not documented, and error handling provides no recovery guidance. The conditional registration of generate_prompt (only if OLLAMA_API_BASE and PROMPT_LLM are set) means one tool may not always be available, but this is not surfaced in the tool definitions themselves. The generate_image tool performs a stateful polling loop (20 iterations × 1-second waits) that could block the context and lacks timeout documentation or failure recovery guidance.
Generate an image using ComfyUI workflow
Write an image generation prompt for a provided topic
Parameter descriptions are minimal or missing. 'topic' and 'prompt' have only trivial one-word descriptions ('The topic to generate an image generation prompt for', 'The image generation prompt'). These descriptions fail to guide LLM reasoning.
Output schemas are not documented. generate_prompt returns a string (from StrOutputParser), and generate_image returns either Image(data=..., format='png') or a string error. The type signature is inferred from code but not declared in the tool definition. LLMs cannot plan downstream operations or extract return field names without explicit schema documentation.
No input validation or error guidance. generate_image performs a 20-iteration polling loop with hardcoded 1-second delays and no timeout parameter. If the prompt takes >20 seconds, the tool silently returns 'Failed to generate image. Please check server logs.' An LLM receives no actionable recovery hints, no suggestion to retry, no hint about what 'check server logs' means, no indication whether the error is transient.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | F | 46 | <=2025-11-25 | v2 |
| 2026-03-09 | F | 34 | - | v1 |
Inconsistent output types. generate_image returns Image | str, meaning it can return either binary image data or an error message string. The LLM has no way to distinguish success from failure without type inspection.
Missing output mode documentation. generate_image accepts an environment variable OUTPUT_MODE that, if set to 'url', changes the return type to a string URL instead of Image binary data. This behavior is not declared in the tool description or as a documented input parameter. Agents cannot choose the output format, and the switch is invisible to callers.
Conditional tool registration without health check. generate_prompt is only registered if OLLAMA_API_BASE and PROMPT_LLM environment variables are set. If they are not, the tool silently does not exist, but the MCP server still starts. An LLM cannot know whether generate_prompt is available, and calling it will fail with an 'unknown tool' error instead of a helpful message.
No pagination or result limits documented. If ComfyUI generates a very large image, the Image(data=...) response could be multi-megabytes, potentially exhausting the context window. The tool has no size limit, compression option, or pagination.