README_MCP.md
README_MCP.md
Text-only Documentation
Looking for the illustrated user documentation? https://github.com/ceveyne/draw-things-chat-docs Looking for the LM Studio settings? https://lmstudio.ai/ceveyne/generate-image/files/README.md
Local stdio MCP entrypoint made for Bionic, living inside the generate-image LM Studio plugin repo. Provides agentic image and video generation via a local Draw Things instance.
The server exposes generate_image and upscale tools to Bionic. Both call the exact same handleGenerateImage/handleUpscale logic the LM Studio plugin uses. Generated files are written directly into the Bionic scratchpad and registered as iN records for later editing or processing.
127.0.0.1:7859). HTTP-only setups are not exercised by this adapter — this repo's Draw Things usage is gRPC-first.generate-image and made-for-bionic-core set up side by side (siblings), e.g. both under ~/.lmstudio/extensions/plugins/ceveyne/.The stdio definition requires these values:
7859). See draw-things-chat-docs for details.args at start-mcp.mjs.Connected • 2 tools ready.generate-image setup.* May or may not be gorgeous – depending on your settings.
This MCP entrypoint lives in the same repository as the LM Studio plugin generate-image. For LM Studio, use the plugin directly — no MCP setup needed there.
MIT
Text-only Documentation
Looking for the illustrated user documentation? https://github.com/ceveyne/draw-things-chat-docs Looking for the LM Studio settings? https://lmstudio.ai/ceveyne/generate-image/files/README.md
Local stdio MCP entrypoint made for Bionic, living inside the generate-image LM Studio plugin repo. Provides agentic image and video generation via a local Draw Things instance.
The server exposes generate_image and upscale tools to Bionic. Both call the exact same handleGenerateImage/handleUpscale logic the LM Studio plugin uses. Generated files are written directly into the Bionic scratchpad and registered as iN records for later editing or processing.
127.0.0.1:7859). HTTP-only setups are not exercised by this adapter — this repo's Draw Things usage is gRPC-first.generate-image and made-for-bionic-core set up side by side (siblings), e.g. both under ~/.lmstudio/extensions/plugins/ceveyne/.The stdio definition requires these values:
7859). See draw-things-chat-docs for details.args at start-mcp.mjs.Connected • 2 tools ready.generate-image setup.* May or may not be gorgeous – depending on your settings.
This MCP entrypoint lives in the same repository as the LM Studio plugin generate-image. For LM Studio, use the plugin directly — no MCP setup needed there.
MIT
command: node
args: path to generate-image's start-mcp.mjs. Example: /Users/ceveyne/.lmstudio/extensions/plugins/ceveyne/generate-image/start-mcp.mjs
⚠️ Do not point
argsatdist-mcp/mcp/index.jsdirectly.start-mcp.mjsmust stay the entrypoint soprocess.argv[1]resolves to the project root — otherwise Draw Things' gRPC transport (proto file, TLS root CA, tensor decode helpers) silently fails to resolve and the tool falls back to a nonexistent HTTP server.
start-mcp.mjs also pins process.cwd() to its own directory on startup, so the cwd you configure for this MCP server (if any) does not matter and does not need to point inside this repo. Without this, a cwd outside generate-image (e.g. a scratchpad folder) makes the gRPC tensor decoder's WASM loader fail silently, and generate_image falls back to writing raw .bin tensor files instead of PNGs.
CHAT_WORKING_DIRECTORIES: absolute base directory for all Bionic scratchpads. Example: /Users/ceveyne/.lmstudio/scratchpads
GENERATE_IMAGE_DRAW_THINGS_HOST: Draw Things host. Default 127.0.0.1.
GENERATE_IMAGE_DRAW_THINGS_HTTP_PORT: Draw Things HTTP port. Default 7860.
GENERATE_IMAGE_DRAW_THINGS_GRPC_PORT: Draw Things gRPC port. Default 7859.
GENERATE_IMAGE_PREVIEW_IN_CHAT: whether tool responses include inline base64 image blocks. Default false — Bionic does not consume these; results are delivered as scratchpad files plus an HTML report instead.
GENERATE_IMAGE_EMBED_PNG_METADATA: embed generation parameters (prompt, model, seed, sources) as XMP metadata into saved PNGs. Default true.
GENERATE_IMAGE_CUSTOM_CONFIGS_PATH: path to Draw Things' custom_configs.json. Set to none to disable. Default: the standard Draw Things location.
{
"name": "generate-image",
"enabled": true,
"connection": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/generate-image/start-mcp.mjs"],
"env": {
"CHAT_WORKING_DIRECTORIES": "/absolute/path/to/bionic-scratchpads",
"GENERATE_IMAGE_DRAW_THINGS_HOST": "127.0.0.1",
"GENERATE_IMAGE_DRAW_THINGS_HTTP_PORT": "7860",
"GENERATE_IMAGE_DRAW_THINGS_GRPC_PORT": "7859"
}
}
}
npm run typecheck # plugin + MCP
npm run build # LM Studio plugin (also produces dist/helpers/* used by gRPC)
npm run build:mcp # MCP entrypoint
npm run test:mcp # unit tests + stdio smoke test
command: node
args: path to generate-image's start-mcp.mjs. Example: /Users/ceveyne/.lmstudio/extensions/plugins/ceveyne/generate-image/start-mcp.mjs
⚠️ Do not point
argsatdist-mcp/mcp/index.jsdirectly.start-mcp.mjsmust stay the entrypoint soprocess.argv[1]resolves to the project root — otherwise Draw Things' gRPC transport (proto file, TLS root CA, tensor decode helpers) silently fails to resolve and the tool falls back to a nonexistent HTTP server.
start-mcp.mjs also pins process.cwd() to its own directory on startup, so the cwd you configure for this MCP server (if any) does not matter and does not need to point inside this repo. Without this, a cwd outside generate-image (e.g. a scratchpad folder) makes the gRPC tensor decoder's WASM loader fail silently, and generate_image falls back to writing raw .bin tensor files instead of PNGs.
CHAT_WORKING_DIRECTORIES: absolute base directory for all Bionic scratchpads. Example: /Users/ceveyne/.lmstudio/scratchpads
GENERATE_IMAGE_DRAW_THINGS_HOST: Draw Things host. Default 127.0.0.1.
GENERATE_IMAGE_DRAW_THINGS_HTTP_PORT: Draw Things HTTP port. Default 7860.
GENERATE_IMAGE_DRAW_THINGS_GRPC_PORT: Draw Things gRPC port. Default 7859.
GENERATE_IMAGE_PREVIEW_IN_CHAT: whether tool responses include inline base64 image blocks. Default false — Bionic does not consume these; results are delivered as scratchpad files plus an HTML report instead.
GENERATE_IMAGE_EMBED_PNG_METADATA: embed generation parameters (prompt, model, seed, sources) as XMP metadata into saved PNGs. Default true.
GENERATE_IMAGE_CUSTOM_CONFIGS_PATH: path to Draw Things' custom_configs.json. Set to none to disable. Default: the standard Draw Things location.
{
"name": "generate-image",
"enabled": true,
"connection": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/generate-image/start-mcp.mjs"],
"env": {
"CHAT_WORKING_DIRECTORIES": "/absolute/path/to/bionic-scratchpads",
"GENERATE_IMAGE_DRAW_THINGS_HOST": "127.0.0.1",
"GENERATE_IMAGE_DRAW_THINGS_HTTP_PORT": "7860",
"GENERATE_IMAGE_DRAW_THINGS_GRPC_PORT": "7859"
}
}
}
npm run typecheck # plugin + MCP
npm run build # LM Studio plugin (also produces dist/helpers/* used by gRPC)
npm run build:mcp # MCP entrypoint
npm run test:mcp # unit tests + stdio smoke test