comfyui-mcp
Version:
Local-first, agent-native control plane for ComfyUI — MCP server + autonomous sidebar agent that drives your live graph in natural language on ANY LLM: Claude/ChatGPT/Gemini on your subscription (no API key), free local models via Ollama (fully offline),
45 lines • 2.34 kB
JavaScript
import { z } from "zod";
import { configureManager, MANAGER_CONFIG_ACTIONS, } from "../services/manager-config.js";
import { errorToToolResult } from "../utils/errors.js";
export function registerManagerConfigTools(server) {
server.tool("configure_manager", "Configure ComfyUI-Manager settings, mirroring `comfy-cli manager` subcommands. " +
"Most actions use the ComfyUI-Manager HTTP API (works against remote ComfyUI); " +
"set_network_mode and set_security_level have no HTTP setter and are written to " +
"Manager's config.ini (requires a known local ComfyUI path; restart ComfyUI to apply).", {
action: z
.enum(MANAGER_CONFIG_ACTIONS)
.describe("Which setting to change. HTTP API: set_preview_method, set_db_mode, " +
"set_component_policy, set_update_policy, set_channel, reset_queue. " +
"config.ini fallback: set_network_mode, set_security_level."),
value: z
.string()
.optional()
.describe("Value for the chosen action (omit only for reset_queue). Allowed values per action — " +
"set_preview_method: auto | latent2rgb | taesd | none; " +
"set_db_mode: local | cache | remote; " +
"set_component_policy: workflow | higher | mine; " +
"set_update_policy: stable-comfyui | nightly-comfyui; " +
"set_channel: a channel name (e.g. default); " +
"set_network_mode: public | private | offline; " +
"set_security_level: strong | normal | normal- | weak. " +
"HTTP-API actions take effect live; the config.ini actions " +
"(set_network_mode, set_security_level) apply only after a ComfyUI restart."),
}, async (args) => {
try {
const result = await configureManager(args.action, args.value);
const stateLine = result.state !== undefined ? `\nResulting state: ${result.state}` : "";
return {
content: [
{
type: "text",
text: `${result.message} (via ${result.via})${stateLine}`,
},
],
};
}
catch (err) {
return errorToToolResult(err);
}
});
}
//# sourceMappingURL=manager-config.js.map