Skip to main content
Glama
siril-mcp

siril-mcp

by NickLarsen

Siril MCP

Cursor/LLM control of a live Siril GUI session via an in-app Python bridge (Option B).

Architecture

  1. Bridge (bridge/bridge.py) — started inside Siril with pyscript -async. Talks to Siril through sirilpy and listens on a Unix socket.

  2. MCP server (siril-mcp) — stdio MCP process for Cursor; forwards tools to the bridge.

Cursor → siril-mcp (stdio) → ~/Library/Application Support/siril-mcp/bridge.sock → bridge.py → Siril

Related MCP server: Krita Illustration MCP

Setup

Easiest: ask your LLM

You can typically just ask your favorite LLM (Cursor, Claude, Codex, etc.) to do the whole install for you. Something like:

Clone https://github.com/NickLarsen/siril-mcp, install it, register it as an MCP server in Cursor, install the Siril Scripts launcher, and tell me how to start the bridge.

In practice that covers cloning the repo, creating the venv, pip install -e ., writing the Cursor MCP config, and running ./scripts/install_bridge_to_siril_scripts.sh so Start_MCP_Bridge shows up in Siril. You still need Siril open and the bridge started (Scripts menu or pyscript -async) before the tools work—your LLM can walk you through that too, and can help with optional extras like StarNet.

Manual steps below if you prefer to do it yourself.

1. Install the MCP package

cd ~/code/siril-mcp
python3 -m venv .venv
source .venv/bin/activate
pip install -e .

2. Install the Siril Scripts launcher

./scripts/install_bridge_to_siril_scripts.sh

3. Start the bridge in Siril

Open Siril.app, then either:

  • Command line in Siril: pyscript -async /Users/nick/code/siril-mcp/bridge/bridge.py

  • Or run Start_MCP_Bridge from the Scripts menu after installing the helper (prefer async).

You should see [siril-mcp] listening on .../bridge.sock in the Siril log.

4. Register with Cursor

Add to your Cursor MCP config (e.g. ~/.cursor/mcp.json):

{
  "mcpServers": {
    "siril": {
      "command": "/Users/nick/code/siril-mcp/.venv/bin/siril-mcp",
      "args": []
    }
  }
}

Restart Cursor MCP / reload window after editing.

Optional: StarNet

If you plan to use StarNet for star removal, ask your favorite LLM to install it for you (or install it yourself via Siril’s usual StarNet setup). This MCP stack does not install or configure StarNet; once it is available to Siril, scriptable StarNet commands work like any other command through the bridge.

Tools

Tool

Purpose

siril_ping

Bridge health

siril_get_state

Loaded image, size, selection, cwd, keywords

siril_list_commands

Filterable scriptable command catalog

siril_run_command

Run one Siril command

siril_run_script

Run multi-line .ssf or .py

siril_get_preview

Autostretched PNG (optional ROI, max edge)

siril_set_selection

Set selection rectangle

siril_get_stats

Per-channel stats

siril_undo

Undo last op

If the bridge is down, tools fail with an explicit start hint (they do not fall back to browsing the filesystem).

Bridge limitations (what you don’t get yet)

This stack only reaches what scripts / sirilpy already expose. GUI-only or poorly scripted Siril features are out of scope for the bridge approach, including:

  • Display / STF / visu state matching exactly what the user sees in the viewport

  • Inspector-style diagnostics

  • Curves, remixer, and compositing UI hooks (unless a documented command equivalent exists)

  • Reliable sequence / load_seq context and Python-style metadata that today only exists on GUI-only paths

  • True canvas screenshots (overlays, zoom, annotations) vs an autostretched gfit preview

  • Attaching to Siril without manually starting the bridge (pyscript -async)

  • Headless siril-cli -p as the primary control path (optional later; not what this bridge is)

If this project proves useful day-to-day, we may consider a fully integrated approach (a built-in Siril control socket / Option C), and/or rewriting some of that GUI-only functionality in Siril so it is also available via scripts and thus via MCP.

Canonical test queries

See PLAN.md section Canonical test queries. Quick smoke:

  1. Ping Siril and tell me if an image is loaded, its size, filename, and selection.

  2. Show a preview of the current image (max 1024px) and describe it.

  3. List stretch-related Siril commands.

Troubleshooting

  • Bridge not running: start pyscript -async again; check ~/Library/Application Support/siril-mcp/bridge.status.json.

  • Socket permissions: socket is created mode 0600 under Application Support.

  • First Siril run: wait until Siril finishes Python venv setup before starting the bridge.

  • Nested pyscript: siril_run_script with kind=py runs sync pyscript; prefer siril_run_command for simple ops.

Option C (later)

After this proves useful, promote the same tool contract into a built-in Siril control socket (see PLAN.md Phase 3).

License

GPL-3.0-or-later — same as Siril.

Available Tools

9 tools
siril_get_previewA

Return an 8-bit autostretched preview of the current Siril image (or a ROI).

Args: max_edge: Maximum width or height of the returned PNG. x, y, w, h: Optional ROI in image pixel coordinates (omit all for full image). linked: Use linked autostretch when True. save_debug_copy: Also write a PNG under Application Support for debugging.

Inputs: h, w, x, y, +3 more.

siril_get_stateA

Get live Siril state: loaded image, size, filename, selection, working directory.

Inputs: no named parameters. Returns: result

siril_get_statsA

Get per-channel statistics for the currently loaded image.

Inputs: no named parameters. Returns: result

siril_list_commandsA

List Siril commands available for scripting.

Args: query: Optional substring filter on command name or usage. scriptable_only: If true, only return scriptable commands.

Inputs: query, scriptable_only. Returns: result

siril_pingA

Check that the Siril MCP bridge is running inside Siril.

Inputs: no named parameters. Returns: result

siril_run_commandC

Run a single Siril command in the live GUI session.

Args: command: Command name (e.g. "autostretch", "load", "cd"). args: Optional list of argument strings.

Inputs: command (required), args. Returns: result

siril_run_scriptA

Run a multi-line Siril script (.ssf command script or .py via pyscript).

Args: script_body: Full script contents. kind: "ssf" for command scripts, "py" for Python (executed with pyscript).

Inputs: script_body (required), kind. Returns: result

siril_set_selectionB

Set the Siril image selection rectangle (x, y, width, height).

Inputs: h (required), w (required), x (required), y (required). Returns: result

siril_undoA

Undo the last Siril operation (if undo history is available).

Inputs: no named parameters. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 9 tools

    Disambiguation4/5

    Most tools target distinct concerns: state, previews, stats, selection, undo, and command execution are clearly separated. The only mild overlap is between siril_run_script and siril_run_command, but their descriptions make the multi-line vs single-command distinction clear.

    Naming Consistency4/5

    All tools share the siril_ prefix and mostly follow a verb_noun pattern like get_preview or list_commands. The exceptions are siril_undo and siril_ping, which are bare verbs, but this is a minor deviation from an otherwise consistent scheme.

    Tool Count5/5

    Nine tools is a well-scoped set for controlling a live Siril session. Each tool covers a meaningful interaction surface without unnecessary bloat or redundancy.

    Completeness4/5

    The generic run_command and run_script tools effectively cover the full command surface, so most workflows are reachable. However, there are no dedicated tools for common operations like loading or saving images, which means agents must know Siril command names to fill those gaps.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables LLMs to interact with PixInsight's image processing capabilities through a local HTTP/SSE server, allowing listing processes, invoking them, viewing images, and more.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI models to directly control a local Krita instance by inspecting real canvas previews, managing documents and layers, importing and masking generated images, inpainting, painting with the brush engine, checkpointing, and exporting KRA/PNG files.
      MIT
    • A
      license
      B
      quality
      A
      maintenance
      Enables any MCP-compatible AI agent to directly operate PixInsight through about 80 tools for opening and editing images, running processes, PixelMath, astrometry, and channel operations.
      78
      1
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables LLM clients to control a live Siril GUI session through an in-app Python bridge, exposing tools to inspect image state and selection, run commands or scripts, get previews and statistics, and undo operations.
      9
      GPL 3.0