README_MCP.md
README_MCP.md
Looking for the LM Studio settings? https://lmstudio.ai/ceveyne/process-image/files/README.md
Local stdio MCP entrypoint living inside the process-image LM Studio plugin repo. Provides agentic image editing — cropping, masking, AI-powered zoom-in, inpainting, and outpainting — via a local Draw Things instance — usable by LM Studio Bionic, Unsloth Studio, or any generic MCP client. See the preset chapters below for client-specific configuration.
The server exposes crop, mask, zoom-in, inpaint and outpaint tools to Bionic. All of them call the exact same handleCrop/handleMask/handleZoomIn/handleInpaint/handleOutpaint logic the LM Studio plugin uses. Generated files are registered as iN records for later editing or processing.
Each tool result includes, per generated file: an inline base64 JPEG preview (only when MCP_MADE_FOR_BIONIC=false), an http:// link (only if a local HTTP server is reachable) and a file:// link to the original, plus the generation's own metadata JSON forwarded verbatim and a one-line usage hint naming the iN identifier to reuse in follow-up calls.
127.0.0.1:7859) — required for , , and . and are pure pixel operations and work without a running Draw Things instance. HTTP-only setups are not exercised by this adapter — this repo's Draw Things usage is gRPC-first.The stdio definition requires these values:
💡 Tip: You don't need to set any of the following ENVs if you're happy with the defaults:
| Env var | Default | Required |
|---|---|---|
MCP_MADE_FOR_BIONIC | true | No |
CHAT_WORKING_DIRECTORIES | ~/.lmstudio/scratchpads | No |
DRAW_THINGS_HOST | 127.0.0.1 | No |
DRAW_THINGS_HTTP_PORT | 7860 | No |
DRAW_THINGS_GRPC_PORT | 7859 | No |
EMBED_PNG_METADATA | true | No |
DRAW_THINGS_CUSTOM_CONFIGS_PATH | ~/Library/Containers/com.liuliu.draw-things/Data/Documents/Models/custom_configs.json | No |
7859) — required for zoom-in, inpaint, and outpaint; crop and mask work without it. See draw-things-chat-docs for details.args at start-mcp.mjs.Connected • 5 tools ready.process-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 process-image. For LM Studio, use the plugin directly — no MCP setup needed there.
To not only process images, but to analyze them, generate and edit them, and find them at the end, you can use these plugins from our tool ecosystem:
For Unsloth Studio. The stdio definition requires these values:
command: nodeargs: path to process-image's start-mcp.mjs. Example: /Users/ceveyne/.lmstudio/extensions/plugins/ceveyne/process-image/start-mcp.mjsMCP_MADE_FOR: unsloth.💡 Tip: You don't need to set any of the following ENVs if you're happy with the defaults:
| Env var | Default | Required |
|---|---|---|
MCP_MADE_FOR | – | Yes |
CHAT_WORKING_DIRECTORIES | ~/.unsloth/studio/sandbox | No |
CLIENT_DB_LOCATION | ~/.unsloth/studio/studio.db | No |
DRAW_THINGS_HOST | 127.0.0.1 | No |
DRAW_THINGS_HTTP_PORT | 7860 | No |
DRAW_THINGS_GRPC_PORT | 7859 | No |
EMBED_PNG_METADATA | true | No |
DRAW_THINGS_CUSTOM_CONFIGS_PATH | ~/Library/Containers/com.liuliu.draw-things/Data/Documents/Models/custom_configs.json | No |
For any generic MCP client that isn't LM Studio Bionic or Unsloth Studio. The stdio definition requires these values:
command: nodeargs: path to process-image's start-mcp.mjs. Example: 💡 Tip: You don't need to set any of the following ENVs if you're happy with the defaults:
| Env var | Default | Required |
|---|---|---|
MCP_MADE_FOR | – | Yes |
CHAT_WORKING_DIRECTORIES | ~/Pictures | No |
DRAW_THINGS_HOST | 127.0.0.1 | No |
DRAW_THINGS_HTTP_PORT | 7860 | No |
DRAW_THINGS_GRPC_PORT | 7859 | No |
EMBED_PNG_METADATA | true | No |
DRAW_THINGS_CUSTOM_CONFIGS_PATH | ~/Library/Containers/com.liuliu.draw-things/Data/Documents/Models/custom_configs.json | No |
MIT
Looking for the LM Studio settings? https://lmstudio.ai/ceveyne/process-image/files/README.md
Local stdio MCP entrypoint living inside the process-image LM Studio plugin repo. Provides agentic image editing — cropping, masking, AI-powered zoom-in, inpainting, and outpainting — via a local Draw Things instance — usable by LM Studio Bionic, Unsloth Studio, or any generic MCP client. See the preset chapters below for client-specific configuration.
The server exposes crop, mask, zoom-in, inpaint and outpaint tools to Bionic. All of them call the exact same handleCrop/handleMask/handleZoomIn/handleInpaint/handleOutpaint logic the LM Studio plugin uses. Generated files are registered as iN records for later editing or processing.
Each tool result includes, per generated file: an inline base64 JPEG preview (only when MCP_MADE_FOR_BIONIC=false), an http:// link (only if a local HTTP server is reachable) and a file:// link to the original, plus the generation's own metadata JSON forwarded verbatim and a one-line usage hint naming the iN identifier to reuse in follow-up calls.
127.0.0.1:7859) — required for , , and . and are pure pixel operations and work without a running Draw Things instance. HTTP-only setups are not exercised by this adapter — this repo's Draw Things usage is gRPC-first.The stdio definition requires these values:
💡 Tip: You don't need to set any of the following ENVs if you're happy with the defaults:
| Env var | Default | Required |
|---|---|---|
MCP_MADE_FOR_BIONIC | true | No |
CHAT_WORKING_DIRECTORIES | ~/.lmstudio/scratchpads | No |
DRAW_THINGS_HOST | 127.0.0.1 | No |
DRAW_THINGS_HTTP_PORT | 7860 | No |
DRAW_THINGS_GRPC_PORT | 7859 | No |
EMBED_PNG_METADATA | true | No |
DRAW_THINGS_CUSTOM_CONFIGS_PATH | ~/Library/Containers/com.liuliu.draw-things/Data/Documents/Models/custom_configs.json | No |
7859) — required for zoom-in, inpaint, and outpaint; crop and mask work without it. See draw-things-chat-docs for details.args at start-mcp.mjs.Connected • 5 tools ready.process-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 process-image. For LM Studio, use the plugin directly — no MCP setup needed there.
To not only process images, but to analyze them, generate and edit them, and find them at the end, you can use these plugins from our tool ecosystem:
For Unsloth Studio. The stdio definition requires these values:
command: nodeargs: path to process-image's start-mcp.mjs. Example: /Users/ceveyne/.lmstudio/extensions/plugins/ceveyne/process-image/start-mcp.mjsMCP_MADE_FOR: unsloth.💡 Tip: You don't need to set any of the following ENVs if you're happy with the defaults:
| Env var | Default | Required |
|---|---|---|
MCP_MADE_FOR | – | Yes |
CHAT_WORKING_DIRECTORIES | ~/.unsloth/studio/sandbox | No |
CLIENT_DB_LOCATION | ~/.unsloth/studio/studio.db | No |
DRAW_THINGS_HOST | 127.0.0.1 | No |
DRAW_THINGS_HTTP_PORT | 7860 | No |
DRAW_THINGS_GRPC_PORT | 7859 | No |
EMBED_PNG_METADATA | true | No |
DRAW_THINGS_CUSTOM_CONFIGS_PATH | ~/Library/Containers/com.liuliu.draw-things/Data/Documents/Models/custom_configs.json | No |
For any generic MCP client that isn't LM Studio Bionic or Unsloth Studio. The stdio definition requires these values:
command: nodeargs: path to process-image's start-mcp.mjs. Example: 💡 Tip: You don't need to set any of the following ENVs if you're happy with the defaults:
| Env var | Default | Required |
|---|---|---|
MCP_MADE_FOR | – | Yes |
CHAT_WORKING_DIRECTORIES | ~/Pictures | No |
DRAW_THINGS_HOST | 127.0.0.1 | No |
DRAW_THINGS_HTTP_PORT | 7860 | No |
DRAW_THINGS_GRPC_PORT | 7859 | No |
EMBED_PNG_METADATA | true | No |
DRAW_THINGS_CUSTOM_CONFIGS_PATH | ~/Library/Containers/com.liuliu.draw-things/Data/Documents/Models/custom_configs.json | No |
MIT
zoom-ininpaintoutpaintcropmaskprocess-image and made-for-bionic-core set up side by side (siblings), e.g. both under ~/.lmstudio/extensions/plugins/ceveyne/.command: node
args: path to process-image's start-mcp.mjs. Example: /Users/ceveyne/.lmstudio/extensions/plugins/ceveyne/process-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.
MCP_MADE_FOR_BIONIC: default true.
true — made for Bionic: a context-aware tool-chain is generated as the tool result.false — produces a generic tool result for other MCP clients: the response includes an inline base64 JPEG preview per generated file.CHAT_WORKING_DIRECTORIES), and each tool result always includes the original file's http:// link (if a local server is reachable), its file:// link, and the generation metadata JSON.CHAT_WORKING_DIRECTORIES: absolute base directory for all Bionic scratchpads. Default ~/.lmstudio/scratchpads; default ~/Pictures when MCP_MADE_FOR_BIONIC=false (generic).
DRAW_THINGS_HOST: Draw Things host. Default 127.0.0.1.
DRAW_THINGS_HTTP_PORT: Draw Things HTTP port. Default 7860.
DRAW_THINGS_GRPC_PORT: Draw Things gRPC port. Default 7859.
EMBED_PNG_METADATA: embed generation parameters (prompt, model, seed, sources) as XMP metadata into saved PNGs. Default true.
DRAW_THINGS_CUSTOM_CONFIGS_PATH: path to Draw Things' custom_configs.json. Set to none to disable. Default: ~/Library/Containers/com.liuliu.draw-things/Data/Documents/Models/custom_configs.json.
💡 Tip: Should you notice that your Custom Configs presets aren't being used (generations look like plain default settings instead of your own presets), make sure
Draw Thingsis enabled underSystem Settings > Privacy & Security > Files & Folders > Bionic. Then everything works —custom_configs.jsonlives inside Draw Things' own private app folder, and macOS needs this permission for Bionic to read it.
💡 Tip: If you notice a timeout error such as:
try increasing the
Request timeout (seconds)value in the Bionic MCP configuration until the error goes away. Bionic apparently doesn't supportnotifications/progressyet and pins theresetTimeoutOnProgressparameter tofalse.
CHAT_WORKING_DIRECTORIES: absolute base directory for all sandbox folders. Default ~/.unsloth/studio/sandbox.CLIENT_DB_LOCATION: absolute path to Unsloth Studio's local chat database. Default ~/.unsloth/studio/studio.db.DRAW_THINGS_HOST: Draw Things host. Default 127.0.0.1.DRAW_THINGS_HTTP_PORT: Draw Things HTTP port. Default 7860.DRAW_THINGS_GRPC_PORT: Draw Things gRPC port. Default 7859.EMBED_PNG_METADATA: embed generation parameters (prompt, model, seed, sources) as XMP metadata into saved PNGs. Default true.DRAW_THINGS_CUSTOM_CONFIGS_PATH: path to Draw Things' custom_configs.json. Set to none to disable. Default: ~/Library/Containers/com.liuliu.draw-things/Data/Documents/Models/custom_configs.json./Users/ceveyne/.lmstudio/extensions/plugins/ceveyne/process-image/start-mcp.mjsMCP_MADE_FOR: generic. Produces a generic tool result: the response includes an inline base64 JPEG preview per generated file. Generated files are always written to disk and each tool result always includes the original file's http:// link (if a local server is reachable), its file:// link, and the generation metadata JSON.CHAT_WORKING_DIRECTORIES: absolute base directory for all working folders. Default ~/Pictures.DRAW_THINGS_HOST: Draw Things host. Default 127.0.0.1.DRAW_THINGS_HTTP_PORT: Draw Things HTTP port. Default 7860.DRAW_THINGS_GRPC_PORT: Draw Things gRPC port. Default 7859.EMBED_PNG_METADATA: embed generation parameters (prompt, model, seed, sources) as XMP metadata into saved PNGs. Default true.DRAW_THINGS_CUSTOM_CONFIGS_PATH: path to Draw Things' custom_configs.json. Set to none to disable. Default: ~/Library/Containers/com.liuliu.draw-things/Data/Documents/Models/custom_configs.json.{
"name": "process-image",
"enabled": true,
"connection": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/process-image/start-mcp.mjs"],
"env": {
"MCP_MADE_FOR_BIONIC": "true",
"CHAT_WORKING_DIRECTORIES": "/absolute/path/to/bionic-scratchpads",
"DRAW_THINGS_HOST": "127.0.0.1",
"DRAW_THINGS_HTTP_PORT": "7860",
"DRAW_THINGS_GRPC_PORT": "7859",
"EMBED_PNG_METADATA": "true",
"DRAW_THINGS_CUSTOM_CONFIGS_PATH": "/absolute/path/to/custom_configs.json"
}
}
}
{
"name": "process-image",
"enabled": true,
"connection": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/process-image/start-mcp.mjs"],
"env": {
"MCP_MADE_FOR": "unsloth",
"CHAT_WORKING_DIRECTORIES": "/absolute/path/to/.unsloth/studio/sandbox",
"CLIENT_DB_LOCATION": "/absolute/path/to/.unsloth/studio/studio.db",
"DRAW_THINGS_HOST": "127.0.0.1",
"DRAW_THINGS_HTTP_PORT": "7860",
"DRAW_THINGS_GRPC_PORT": "7859",
"EMBED_PNG_METADATA": "true",
"DRAW_THINGS_CUSTOM_CONFIGS_PATH": "/absolute/path/to/custom_configs.json"
}
}
}
{
"name": "process-image",
"enabled": true,
"connection": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/process-image/start-mcp.mjs"],
"env": {
"MCP_MADE_FOR": "generic",
"CHAT_WORKING_DIRECTORIES": "/absolute/path/to/pictures",
"DRAW_THINGS_HOST": "127.0.0.1",
"DRAW_THINGS_HTTP_PORT": "7860",
"DRAW_THINGS_GRPC_PORT": "7859",
"EMBED_PNG_METADATA": "true",
"DRAW_THINGS_CUSTOM_CONFIGS_PATH": "/absolute/path/to/custom_configs.json"
}
}
}
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
zoom-ininpaintoutpaintcropmaskprocess-image and made-for-bionic-core set up side by side (siblings), e.g. both under ~/.lmstudio/extensions/plugins/ceveyne/.command: node
args: path to process-image's start-mcp.mjs. Example: /Users/ceveyne/.lmstudio/extensions/plugins/ceveyne/process-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.
MCP_MADE_FOR_BIONIC: default true.
true — made for Bionic: a context-aware tool-chain is generated as the tool result.false — produces a generic tool result for other MCP clients: the response includes an inline base64 JPEG preview per generated file.CHAT_WORKING_DIRECTORIES), and each tool result always includes the original file's http:// link (if a local server is reachable), its file:// link, and the generation metadata JSON.CHAT_WORKING_DIRECTORIES: absolute base directory for all Bionic scratchpads. Default ~/.lmstudio/scratchpads; default ~/Pictures when MCP_MADE_FOR_BIONIC=false (generic).
DRAW_THINGS_HOST: Draw Things host. Default 127.0.0.1.
DRAW_THINGS_HTTP_PORT: Draw Things HTTP port. Default 7860.
DRAW_THINGS_GRPC_PORT: Draw Things gRPC port. Default 7859.
EMBED_PNG_METADATA: embed generation parameters (prompt, model, seed, sources) as XMP metadata into saved PNGs. Default true.
DRAW_THINGS_CUSTOM_CONFIGS_PATH: path to Draw Things' custom_configs.json. Set to none to disable. Default: ~/Library/Containers/com.liuliu.draw-things/Data/Documents/Models/custom_configs.json.
💡 Tip: Should you notice that your Custom Configs presets aren't being used (generations look like plain default settings instead of your own presets), make sure
Draw Thingsis enabled underSystem Settings > Privacy & Security > Files & Folders > Bionic. Then everything works —custom_configs.jsonlives inside Draw Things' own private app folder, and macOS needs this permission for Bionic to read it.
💡 Tip: If you notice a timeout error such as:
try increasing the
Request timeout (seconds)value in the Bionic MCP configuration until the error goes away. Bionic apparently doesn't supportnotifications/progressyet and pins theresetTimeoutOnProgressparameter tofalse.
CHAT_WORKING_DIRECTORIES: absolute base directory for all sandbox folders. Default ~/.unsloth/studio/sandbox.CLIENT_DB_LOCATION: absolute path to Unsloth Studio's local chat database. Default ~/.unsloth/studio/studio.db.DRAW_THINGS_HOST: Draw Things host. Default 127.0.0.1.DRAW_THINGS_HTTP_PORT: Draw Things HTTP port. Default 7860.DRAW_THINGS_GRPC_PORT: Draw Things gRPC port. Default 7859.EMBED_PNG_METADATA: embed generation parameters (prompt, model, seed, sources) as XMP metadata into saved PNGs. Default true.DRAW_THINGS_CUSTOM_CONFIGS_PATH: path to Draw Things' custom_configs.json. Set to none to disable. Default: ~/Library/Containers/com.liuliu.draw-things/Data/Documents/Models/custom_configs.json./Users/ceveyne/.lmstudio/extensions/plugins/ceveyne/process-image/start-mcp.mjsMCP_MADE_FOR: generic. Produces a generic tool result: the response includes an inline base64 JPEG preview per generated file. Generated files are always written to disk and each tool result always includes the original file's http:// link (if a local server is reachable), its file:// link, and the generation metadata JSON.CHAT_WORKING_DIRECTORIES: absolute base directory for all working folders. Default ~/Pictures.DRAW_THINGS_HOST: Draw Things host. Default 127.0.0.1.DRAW_THINGS_HTTP_PORT: Draw Things HTTP port. Default 7860.DRAW_THINGS_GRPC_PORT: Draw Things gRPC port. Default 7859.EMBED_PNG_METADATA: embed generation parameters (prompt, model, seed, sources) as XMP metadata into saved PNGs. Default true.DRAW_THINGS_CUSTOM_CONFIGS_PATH: path to Draw Things' custom_configs.json. Set to none to disable. Default: ~/Library/Containers/com.liuliu.draw-things/Data/Documents/Models/custom_configs.json.{
"name": "process-image",
"enabled": true,
"connection": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/process-image/start-mcp.mjs"],
"env": {
"MCP_MADE_FOR_BIONIC": "true",
"CHAT_WORKING_DIRECTORIES": "/absolute/path/to/bionic-scratchpads",
"DRAW_THINGS_HOST": "127.0.0.1",
"DRAW_THINGS_HTTP_PORT": "7860",
"DRAW_THINGS_GRPC_PORT": "7859",
"EMBED_PNG_METADATA": "true",
"DRAW_THINGS_CUSTOM_CONFIGS_PATH": "/absolute/path/to/custom_configs.json"
}
}
}
{
"name": "process-image",
"enabled": true,
"connection": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/process-image/start-mcp.mjs"],
"env": {
"MCP_MADE_FOR": "unsloth",
"CHAT_WORKING_DIRECTORIES": "/absolute/path/to/.unsloth/studio/sandbox",
"CLIENT_DB_LOCATION": "/absolute/path/to/.unsloth/studio/studio.db",
"DRAW_THINGS_HOST": "127.0.0.1",
"DRAW_THINGS_HTTP_PORT": "7860",
"DRAW_THINGS_GRPC_PORT": "7859",
"EMBED_PNG_METADATA": "true",
"DRAW_THINGS_CUSTOM_CONFIGS_PATH": "/absolute/path/to/custom_configs.json"
}
}
}
{
"name": "process-image",
"enabled": true,
"connection": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/process-image/start-mcp.mjs"],
"env": {
"MCP_MADE_FOR": "generic",
"CHAT_WORKING_DIRECTORIES": "/absolute/path/to/pictures",
"DRAW_THINGS_HOST": "127.0.0.1",
"DRAW_THINGS_HTTP_PORT": "7860",
"DRAW_THINGS_GRPC_PORT": "7859",
"EMBED_PNG_METADATA": "true",
"DRAW_THINGS_CUSTOM_CONFIGS_PATH": "/absolute/path/to/custom_configs.json"
}
}
}
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
!Tool call failed
Error calling zoom-in: MCP error -32001: Request timed out
!Tool call failed
Error calling zoom-in: MCP error -32001: Request timed out