HomeDocsAutomationMCP Connector
Local MCP for OCR Automation

MCP Connector Reference

The Windows automation engine can be exposed to LLM agents through a local MCP stdio connector. Agents can scan images with OCR context, find words by anchor rules, preview edits, commit changes, inspect routines, and execute approved flows.

Overview

The connector sits on top of the same runtime used by the visual automation editor. It does not invent a second pipeline. It reuses the existing OCR with context, target finding, and image editing functions.

Current entrypoint:kiky-notes-tray --mcp-automation

Settings

The connector is disabled by default. You must explicitly enable it in the Windows settings window.

  • Enable MCP connector: master switch.
  • Allow filesystem tools for AI: required for reading images and writing outputs.
  • Allow image editing tools for AI: required for erase, highlight, circle, and rectangle operations.
  • Allow routine and script execution for AI: required for saved routines and ad-hoc Rhai.
  • Require preview before commit: keeps destructive edits on a preview-first path.
  • Allowed folders: semicolon-separated allowlist. The connector refuses paths outside this list.

Transport

The connector currently speaks MCP over stdio. It is intended for local desktop agents. Requests and responses use standard JSON-RPC frames with Content-Length.

text
Content-Length: 123

{ "jsonrpc": "2.0", "id": 1, "method": "tools/list" }

Tools

ToolPurpose
automation_list_filesList files inside an allowed folder.
automation_ocr_contextRun OCR with line/word/symbol geometry on an image.
automation_find_targetsFind words, lines or document fields using text, anchors, offsets and stop markers.
automation_count_targetsCount the matched OCR targets.
automation_preview_editRender an image edit preview and return a preview token.
automation_commit_editWrite a previously previewed edit to a destination path.
automation_list_routinesList saved routines visible in the editor.
automation_get_routine_schemaReturn the graph JSON and compiled Rhai for one routine.
automation_run_routineExecute a saved routine.
automation_run_rhaiExecute an ad-hoc Rhai script on a folder.

Preview edit result shape:

json
{
  "preview_token": "91f1b0e4-6a1f-4bd7-9c6d-3a4e7d64d51e",
  "operation": "erase",
  "source_image_path": "C:\\Docs\\invoice.png",
  "preview_image_path": "C:\\Users\\...\\Temp\\kiky_mcp_preview_....png",
  "output_width": 2480,
  "output_height": 3508,
  "target_count": 3
}

Example Flows

1. OCR a document, find the value after an anchor, preview an erase, then commit:

json
// Step 1: automation_ocr_context
{ "imagePath": "C:\\Scans\\doc.png", "language": "por" }

// Step 2: automation_find_targets
{
  "contextJson": "<json from step 1>",
  "mode": "text",
  "anchor": "Nome",
  "offsetDirection": "after",
  "offsetWords": 0,
  "takeWords": 4,
  "stopAt": "CPF",
  "sameLineOnly": true
}

// Step 3: automation_preview_edit
{
  "imagePath": "C:\\Scans\\doc.png",
  "targetsJson": "<json from step 2>",
  "operation": "erase",
  "paddingMultiplier": 0.2,
  "lineOnly": false
}

// Step 4: automation_commit_edit
{
  "previewToken": "<preview token>",
  "outputPath": "C:\\Scans\\doc_redacted.png"
}

2. Run a saved routine:

json
{ "routineId": 12 }

Security Model

  • The connector is local-only and disabled by default.
  • Filesystem access is restricted to the allowlist configured in Settings.
  • Image edits are designed around preview first, commit second.
  • Routine execution is separately gated from OCR/image tools.
  • The visual editor remains the human authoring surface. MCP exposes a stable tool contract on top of it.
MCP Connector Reference - Kiky Notes Automation | Kiky Notes