Skip to main content
Glama
pixinsight-mcp
by iftahs

pixinsight-mcp

Give an AI agent full control of PixInsight — from raw subs to a finished image, with eyes.

Developed by Iftah Saar · iftah.dev

License: MIT Node ≥ 20 PixInsight 1.9.4 MCP Tests

M31 — 29 × 180 s (87 min), ZWO ASI2600MC Pro · ZWO FF70 · AM5N · ASIAIR. Blink-culled, WBPP-stacked, DBE → SPCC → denoise → MaskedStretch → HDR → star reduction, all driven through this server by Claude; final touch-up in Photoshop.


Contents


Related MCP server: PixInsight MCP Bridge

What it does

PixInsight has no API. This project gives it one — an MCP server that an AI agent (Claude Code, Claude Desktop, any MCP client) drives with 97 tools:

🔎 Inventory

Parses FITS headers in Node (no PixInsight needed), groups lights/darks/flats/bias by camera, gain, offset, exposure, temperature and target, and explains its calibration matching — CMOS-correct (no bias when darks match).

👁 Eyes

Every step can be looked at: render_preview, crop_preview, compare_previews, blink_frames return JPEGs as MCP images. Statistics, histograms, star FWHM/eccentricity give the numbers.

🧹 Blink culling

A contact sheet of every sub with background, star count and gradient metrics; suspects flagged. The agent looks and drops clouds, dew, trails.

🧱 Stacking

PixInsight's own WBPP (default) in a second instance with exactly the matched calibration groups — or a native chain: calibration → CFA cosmetic correction → debayer → SubframeSelector → StarAlignment → LocalNormalization → ImageIntegration → DrizzleIntegration. Async jobs with live per-frame progress.

🎨 Post-processing

DBE with automatic samples, BN, plate solving (offline Gaia), SPCC, denoise, MaskedStretch, HDR, masked local contrast, curves, hue-weighted saturation, star reduction, masks, rotate/crop, apply_process for anything else. Every destructive step checkpoints first.

📓 Provenance

save_project writes the XISF with embedded history, a manifest and a human-readable PROCESSING.md of every step and parameter.

🧽 Housekeeping

Working files live next to the object (<target>/working-files); intermediates are deleted as soon as the next stage succeeds. No 50 GB surprises.


How it works

flowchart LR
    A[AI agent<br/>Claude Code] -- MCP / stdio --> B[Node MCP server<br/>97 tools]
    B -- jobs/*.json --> C[(bridge dir)]
    C -- claim / results / logs --> D[PJSR daemon<br/>inside warm PixInsight 1.9.4]
    D -- heartbeat 2 s --> C
    B -- WBPP automation --> E[second PixInsight<br/>instance]
    B -- FITS headers,<br/>matching, masters cache --> F[(working-files)]
  • One long-lived PixInsight runs pjsr/daemon.js (#engine v8) and polls a job directory. The filesystem is the transport: boring, debuggable, survives crashes.

  • Image windows stay open between calls; tools address them by view id.

  • Long operations return a job_id; the console log is streamed to disk and parsed into current/total progress. job_wait blocks up to five minutes; PI_BUSY protects the single-threaded daemon, also across server processes.

  • Modal dialogs are suppressed (noGUIMessages) and a silent console is reported as a hint, so the agent never hangs on a hidden message box.


Quick start

Requirements: Windows (tested on 11), PixInsight 1.9.4, Node ≥ 20. Optional: BlurXTerminator / NoiseXTerminator / StarXTerminator (detected, with native fallbacks).

git clone https://github.com/iftahs/pixinsight-mcp
cd pixinsight-mcp
npm install
npm run build

Create pixinsight-mcp.config.json (or ~/.pixinsight-mcp.json, or PIMCP_CONFIG=<path>):

{
  "piExe": "C:/Program Files/PixInsight/bin/PixInsight.exe",
  "dataRoot": "C:/Users/me/Astro/Astronomy",
  "requireFlats": true,
  "rig": { "pixelSizeUm": 3.76, "focalLengthMm": 490, "cameraGainEPerAdu": 0.25, "bayerPattern": "RGGB" }
}

Register with Claude Code (.mcp.json):

{
  "mcpServers": {
    "pixinsight": {
      "command": "node",
      "args": ["<repo>/dist/index.js"],
      "env": { "PIMCP_CONFIG": "<repo>/pixinsight-mcp.config.json" }
    }
  }
}

Install skill/SKILL.md as a Claude skill — it is the agent-facing workflow guide (also served as the MCP resource pi://skill). Then just ask: "process the M31 folder".

Key

Default

Meaning

piExe

PixInsight default path

Executable

dataRoot

—

Raw data. Never written to.

workLayout

"target"

Working files at <object>/working-files (parent of a Lights/ folder); "workdir" for a central dir

stackingEngine

"wbpp"

"native" for the tool chain

wbppParams

{}

Extra WBPP automation parameters

confirmOnWarnings

true

Refuse to stack on mismatched/missing calibration until acknowledged

requireFlats

true

Refuse calibration without a master flat unless forced

keepIntermediates

false

Keep calibrated/registered files after each stage

excludeDirNames

working-files, …

Folders skipped by scan_frames

includeAdpScripts

true

Compile ImageSolver/AnnotateImage into the daemon

allowRawScripts

true

Enable pi_run_pjsr

autoLaunch

true

Start PixInsight on demand

tolerances

0.5 % / 2 °C / 5 °C / 14 d / 200 steps

Matching tolerances

rig

ASI2600MC + FF70

Pixel size, focal length, e⁻/ADU

Environment overrides: PIMCP_PI_EXE, PIMCP_DATA_ROOT, PIMCP_WORKDIR, PIMCP_REQUIRE_FLATS, PIMCP_ALLOW_RAW_SCRIPTS, PIMCP_AUTO_LAUNCH.


House rules baked in

These came out of real sessions and are enforced in code, not just documented:

Rule

Where

Working files next to the object, never in the raw folders, intermediates deleted as stages complete

workLayout, keepIntermediates, cleanup_working_files

Look before stacking: blink contact sheet → drop bad subs

blink_frames, exclude_frames

Stop rule: mismatched or missing calibration (dark temperature > 2 °C, dark scaling, no flats) → refuse until the user has been told and agrees

match_calibration.needs_confirmation, pipeline_run → NEEDS_CONFIRMATION

WBPP is the stacking engine unless asked otherwise; exact matched groups; platesolve=false

stackingEngine

CMOS calibration: matched darks → dark + flat only, no bias, no dark optimisation

matching/match.ts

Every destructive step checkpoints; restore_checkpoint/undo roll back

pjsr/ops/postprocess.js

A PROCESSING.md and a 16-bit TIFF finish every image

save_project, write_processing_log


A session, end to end

pi_status                              daemon up, modules, Gaia
scan_frames                            light_01 M 31 30×180 s g100 · dark_05 180 s g100 0 °C · …
match_calibration light_01             dark_05 (Δ 0.0 °C, ok) · no flats → needs_confirmation → ask user
blink_frames light_01                  contact sheet: #1 hazy (bg +21 %, stars −50 %)
exclude_frames [1]
pipeline_run light_01 (acknowledge)    WBPP in M 31/working-files/wbpp → master_light view
gradient_correction DBE → background_neutralize → plate_solve → color_calibrate SPCC → denoise
stretch masked → hdr_compress → range_mask + local_contrast → scnr → saturation → curves
reduce_stars → rotate 180
save_project → save_image tif 16-bit → cleanup_working_files

1:1 detail: dust lanes and the HDR-compressed core.


The default processing recipe

The recipe that produced the image above lives in skill/SKILL.md and is what the agent follows unless told otherwise:

  1. gradient_correction { method: "DBE" } — DynamicBackgroundExtraction with automatically placed background samples (stars and object rejected)

  2. background_neutralize → plate_solve → color_calibrate { method: "SPCC" } against the local Gaia DR3/SP database

  3. denoise { strength: 0.3 } (NoiseXTerminator if present, else MLT), verified at 1:1

  4. stretch { method: "masked", target_background: 0.15 } — MaskedStretch keeps star cores small

  5. hdr_compress → local_contrast through a range_mask of the object only

  6. scnr → hue-weighted saturation (blue/cyan for galaxies, red/magenta for emission nebulae) → curves

  7. reduce_stars (StarMask-protected morphological erosion) → rotate / crop for framing

  8. save_project (+ PROCESSING.md) → save_image { format: "tif", bit_depth: 16 } → cleanup


Tool catalogue

pi_status pi_capabilities pi_start_session pi_list_sessions pi_use_session pi_end_session pi_console_log pi_run_pjsr pi_restart pi_stop · job_status job_wait job_log job_cancel list_jobs

scan_frames group_files fits_header match_calibration list_masters · blink_frames exclude_frames

build_master_bias build_master_dark build_master_flat calibrate_lights cosmetic_correction debayer · measure_subframes select_subframes register local_normalization integrate drizzle_integrate fast_integrate · pipeline_run pipeline_status wbpp_run wbpp_status

list_windows open_image close_window duplicate_window image_statistics histogram image_keywords render_preview crop_preview compare_previews measure_stars set_screen_stretch save_image checkpoint restore_checkpoint undo list_checkpoints

apply_process process_params gradient_correction plate_solve annotate color_calibrate background_neutralize scnr deconvolve denoise remove_stars stretch curves saturation reduce_stars rotate resample crop auto_crop pixel_math linear_fit sharpen hdr_compress local_contrast combine_stars extract_channels convert_to_gray invert

star_mask range_mask pixelmath_mask apply_mask mask_info binarize morphology blur · configure_gaia gaia_info · save_project write_processing_log cleanup_working_files

Resources: pi://session/current, pi://previews/{name}, pi://jobs/{id}/log, pi://masters, pi://skill. Prompts: process-session, inspect-frame.


Calibration matching (CMOS)

Pair

Exact

Tolerance

light ↔ dark

INSTRUME, GAIN, OFFSET, binning

EXPTIME ± 0.5 %; CCD-TEMP graded ok ≤ 2 °C · acceptable ≤ 5 °C · poor beyond (nearest set chosen, flagged for confirmation)

light ↔ flat

INSTRUME, binning, FILTER

warn if DATE-OBS > 14 d or FOCUSPOS > 200 steps apart

flat ↔ flat-dark

INSTRUME, GAIN, OFFSET, binning

EXPTIME ± 0.5 %

any ↔ bias

INSTRUME, GAIN, OFFSET, binning

—

Decision tree: matched darks → dark + flat only (bias is inside the dark; masterBias=off, optimizeDarks=off). Exposure mismatch + allow_dark_scaling → bias + optimisation, flagged second-best. Flats always calibrated with a flat-dark (preferred) or bias, never the light dark. No darks → bias + flat with mandatory cosmetic auto-detect. Light groups never split on temperature; drift is reported instead. Masters are content-addressed and reused.


Gaia catalog for offline plate solving and SPCC

Download the Gaia DR3/SP small set (4 .xpsd files, ~11 GB) from pixinsight.com/dist and run configure_gaia { dir }. plate_solve then uses GaiaDR3SP_XPSD locally — ImageSolver's automatic mode only probes DR3/EDR3/DR2 and otherwise falls back to VizieR, which fails on machines with a broken TLS chain. gaia_info tells you what is configured.


Development

npm test                                      # 46 unit tests, no PixInsight
npm run fixtures                              # synthetic RGGB fixtures under tests/fixtures/data
PI_INTEGRATION=1 npm run test:integration     # 5 end-to-end tests incl. chaos kill (~2 min)
npx tsx scripts/smoke.ts pi_status '{"launch":true}'
npx tsx scripts/pipeline-smoke.ts '{"light_group_id":"light_01","max_frames":4,"force":true}'

pjsr/reference/*.txt holds the default toSource() of every wrapped process as dumped from PixInsight 1.9.4 — the source of truth for parameter names (pjsr/reference/dump-process-params.js regenerates it). After editing anything under pjsr/, call pi_restart.


PJSR lessons learned

  • #engine v8 is required for modern syntax and to #include PixInsight's ImageSolver library. Under V8: process enums are statics (ImageIntegration.Average), 64-bit counters are BigInt, View.viewById returns null, Histogram is new Histogram(bins) + generate(image), StarDetector is native (including pjsr/StarDetector.jsh shadows it and breaks ImageSolver).

  • The preprocessor treats /* inside a // comment as a block-comment start, and substitutes macro names even after a dot (PIMCP.const.ColorSpace_Gray → PIMCP.const.0).

  • SubframeSelector.measurements is read-only and weighting expressions evaluate to 0 from scripts → weights are computed in Node and stamped as SSWEIGHT.

  • DynamicBackgroundExtraction executes from its data table (normalised coordinates); samples is the GUI table (symmetries 0, axialCount 3..24, isFixed numeric).

  • Two daemons on one bridge make jobs alternate between instances; the daemon now exits when another heartbeat is fresh.

  • Modal dialogs block the daemon silently; every process runs with noGUIMessages = true.

  • WBPP automation: outputDirectory= (not outputDir), platesolve=false to avoid its interactive solver.

  • Image.resample(w, h) takes scale factors, not sizes.


Safety

Outputs are refused under dataRoot or any scanned root except the object's working-files; nothing is overwritten (save_image needs overwrite:true, masters are content-addressed); inspection works on clones; fewer than 3 frames are refused without force; destructive tools checkpoint first; one PixInsight job at a time; mismatched calibration stops the pipeline until acknowledged.

License

MIT © 2026 Iftah Saar

Available Tools

92 tools
annotateannotateB
Read-only

Render an annotated JPEG (Messier/NGC/named stars/constellations/grid) of a plate-solved view to confirm the target. Non-destructive.

Inputs: id (required), layers, max_edge.

apply_maskapply_maskA

Attach (or remove with remove:true) a mask view to an image window; subsequent processes on that view are masked. inverted:true protects where the mask is bright.

Inputs: id (required), remove, mask_id, visible, +1 more.

apply_processapply_processA
Destructive

Generic fallback: apply ANY installed PixInsight process by name to a view (or globally when id omitted) with a flat params object using exact PJSR parameter names (see process_params). Enum values may be given as strings (e.g. 'WinsorizedSigmaClip'). Checkpoints first.

Inputs: process (required), id, params, checkpoint, +1 more.

auto_cropauto_cropA
Destructive

Trim registration edges: finds rows/columns with > max_zero_fraction zero pixels and crops them (+pad). dry_run reports the rect only. Checkpoints first.

Inputs: id (required), pad, dry_run, threshold, +2 more.

background_neutralizebackground_neutralizeB
Destructive

BackgroundNeutralization (equalize channel backgrounds) — linear stage. Checkpoints first.

Inputs: id (required), params, checkpoint, reference_id, +1 more.

binarizebinarizeC
Destructive

Binarize a (mask) view at a threshold. Checkpoints first.

Inputs: id (required), threshold, checkpoint.

blurblurB
Destructive

Gaussian convolution (soften masks). Checkpoints first.

Inputs: id (required), sigma, checkpoint.

build_master_biasbuild_master_biasA

Integrate bias frames into a master bias (average, Winsorized/percentile rejection by count, no normalization). Cached by fingerprint; returns instantly on a hit. Async unless wait:true.

Inputs: wait, files, force, group_id, +1 more.

build_master_darkbuild_master_darkA

Integrate darks into a master dark. Do NOT pass master_bias unless you will use dark optimisation (CMOS rule: bias lives inside the dark). Cached by fingerprint. Async: returns job_id.

Inputs: wait, files, force, group_id, +2 more.

build_master_flatbuild_master_flatA

Calibrate flats with a master flat-dark (preferred) or master bias, then integrate multiplicatively (EqualizeFluxes rejection normalization). Never calibrate flats with the light master dark. Cached. Async.

Inputs: wait, files, force, group_id, +3 more.

calibrate_lightscalibrate_lightsA

ImageCalibration of light frames (CFA-aware) with master dark/flat (+bias only for dark scaling). Refuses without a master flat unless config requireFlats=false or force:true. Outputs /work/calibrated/*_c.xisf. Async with per-frame progress.

Inputs: files, force, out_dir, group_id, +6 more.

checkpointcheckpointA

Write an .xisf checkpoint of a view into the session's checkpoints/ dir; returns the path for restore_checkpoint.

Inputs: id (required), label.

cleanup_working_filescleanup_working_filesA
Destructive

Delete intermediate directories in the current working dir (calibrated, cosmetic, debayered, weighted, registered, lnorm, wbpp, quicklook) keeping master/, checkpoints/, previews/, project/, pipeline/. dry_run lists what would go.

Inputs: dry_run, also_previews, also_checkpoints.

close_windowclose_windowA
Destructive

Close an image window (force: discard unsaved changes, default true).

Inputs: id (required), force.

color_calibratecolor_calibrateA
Destructive

SPCC (default; needs plate solution + internet, defaults tuned for a Sony OSC sensor with UV/IR cut) → PCC fallback → ColorCalibration (no astrometry). Optionally neutralizes background. Linear data only. Checkpoints first.

Inputs: id (required), method, params, checkpoint, +5 more.

combine_starscombine_starsC
Destructive

Screen-blend a stars image back onto a starless image (PixelMath), optionally into a new view.

Inputs: stars_id (required), starless_id (required), new_id, star_boost.

compare_previewscompare_previewsA
Read-only

Side-by-side JPEG of two views (or a view and a checkpoint file) with the same stretch — before/after checks.

Inputs: id_a (required), id_b, rect, linked, +5 more.

convert_to_grayconvert_to_grayA
Destructive

Convert a view to grayscale in place. Checkpoints first.

Inputs: id (required), checkpoint.

cosmetic_correctioncosmetic_correctionA

CosmeticCorrection on calibrated (still mosaiced, cfa:true) frames: hot pixels from the master dark and/or auto-detect (sigma). Run BEFORE debayer. Async with per-frame progress; ~120 s for 30 frames.

Inputs: files (required), cfa, wait, out_dir, +5 more.

cropcropC
Destructive

Crop to rect [x, y, w, h]. Checkpoints first.

Inputs: id (required), rect (required), checkpoint.

crop_previewcrop_previewA
Read-only

1:1 (or zoomed) JPEG of a region — for star shapes, halos, ringing, noise texture. Defaults to a 512 px box at the image centre. Pass center [x,y] or rect. zoom >1 magnifies.

Inputs: id (required), rect, size, zoom, +3 more.

curvescurvesA
Destructive

CurvesTransformation: explicit curves per channel ({K:[[0,0],[0.3,0.35],[1,1]], S:…}) or convenience contrast (-1..1) / brightness (-1..1). Non-linear stage. Checkpoints first.

Inputs: id (required), curves, contrast, brightness, +1 more.

debayerdebayerA

Debayer CFA frames (pattern Auto reads BAYERPAT; ASI2600MC = RGGB) with VNG (default) / SuperPixel / Bilinear. Run AFTER cosmetic correction. Async with per-frame progress.

Inputs: files (required), wait, method, out_dir, +1 more.

deconvolvedeconvolveA
Destructive

BlurXTerminator if installed (correct_only mode for the linear stage), else native Richardson-Lucy Deconvolution with a PSF sized from measured FWHM (conservative, deringing on). Check crop_preview for dark rings afterwards. Checkpoints first. Async-ish (can take minutes).

Inputs: id (required), method, params, fwhm_px, +7 more.

denoisedenoiseB
Destructive

NoiseXTerminator if installed, else MultiscaleLinearTransform (linear data) / TGVDenoise (non-linear) with a strength 0..1. Checkpoints first.

Inputs: id (required), detail, method, params, +3 more.

drizzle_integratedrizzle_integrateA

DrizzleIntegration from .xdrz files (written by register and updated by integrate). Needs dithered subs; scale 1 (CFA-free super-sampling of rejection) or 2. Async.

Inputs: out, scale, kernel, keep_open, +3 more.

duplicate_windowduplicate_windowA

Deep-copy a view into a new window (no history). Use before experimenting.

Inputs: id (required), new_id.

exclude_framesexclude_framesA

Drop frames (by blink index) from the light group before stacking. The exclusion list is applied by pipeline_run / stack. Pass an empty list to clear.

Inputs: indexes (required), reason.

extract_channelsextract_channelsC

ChannelExtraction (RGB / CIE L / …) into new views.

Inputs: id (required), prefix, channels, color_space.

fast_integratefast_integrateA

Quick-look stack with FastIntegration (registration + integration in one pass, no drizzle, no LN). Good for a 2-minute sanity check of a night's data. Async.

Inputs: files (required), out, keep_open, reference.

fits_headerfits_headerA
Read-only

Raw FITS header cards of one file plus the parsed frame record (no PixInsight needed).

Inputs: path (required).

gradient_correctiongradient_correctionA
Destructive

Remove light-pollution gradients on a LINEAR image. method 'DBE' (DynamicBackgroundExtraction with automatically placed background samples, stars/object rejected; the user's preferred method), 'GradientCorrection' (default when DBE not requested), or 'ABE'. Checkpoints first. Look at the preview afterwards; dry_run reports the DBE sample layout.

Inputs: id (required), scale, degree, method, +8 more.

group_filesgroup_filesB
Read-only

File paths of a frame group from the last scan.

Inputs: group_id (required).

hdr_compresshdr_compressB
Destructive

HDRMultiscaleTransform to recover bright cores (galaxy cores, nebula centres) on a non-linear image. Checkpoints first.

Inputs: id (required), layers, params, checkpoint, +1 more.

histogramhistogramB
Read-only

Per-channel histogram counts (default 256 bins) for a view. Read-only.

Inputs: id (required), bins.

image_keywordsimage_keywordsB
Read-only

FITS keywords, XISF properties and astrometric solution summary of an open view.

Inputs: id (required).

image_statisticsimage_statisticsA
Read-only

Per-channel median, MAD, mean, σ, min/max, clipped-black and saturated counts/percent, MRS noise estimate, SNR proxy, background neutrality ratios, linear guess. Read-only. Use after every stretch/sharpen step.

Inputs: id (required), rect, clip_low, clip_high.

integrateintegrateA

ImageIntegration of registered frames → master light .xisf. Rejection auto by count (<8 Percentile, 8–20 Winsorized, >20 LinearFit), normalization additive+scaling (or LocalNormalization when .xnml given/available), weights from SSWEIGHT keyword or PSF signal weight. Reports rejected-pixel % (high = clouds/satellites/bad frame). Refuses < 3 frames without force. ALWAYS async.

Inputs: out, files, force, weights, +10 more.

invertinvertA
Destructive

Invert a view (useful on masks). Checkpoints first.

Inputs: id (required), checkpoint.

job_canceljob_cancelA
Destructive

Request cancellation. Per-frame operations (calibrate, register, cosmetic, debayer, normalize) stop at the next frame; a running ImageIntegration cannot be interrupted (use pi_stop mode:'kill').

Inputs: job_id (required).

job_logjob_logB
Read-only

Tail of the PixInsight console log for a job (streams live while running). Also extracts ImageIntegration rejection lines when present.

Inputs: job_id (required), tail.

job_statusjob_statusA
Read-only

Status, progress (current/total, percent, ETA) and result of an async job. Poll every 10–30 s for long jobs, or use job_wait.

Inputs: job_id (required).

job_waitjob_waitA
Read-only

Block up to max_seconds (≤ 300) for a job to finish; returns the final result or the latest progress. Prefer this over tight job_status polling.

Inputs: job_id (required), max_seconds.

linear_fitlinear_fitB
Destructive

LinearFit the view to a reference view (match channel/sessions). Checkpoints first.

Inputs: id (required), reference_id (required), checkpoint.

list_checkpointslist_checkpointsB
Read-only

Checkpoint files in the current session.

Inputs: no named parameters.

list_jobslist_jobsA
Read-only

List jobs submitted by this server process (id, op, status, progress).

Inputs: active_only.

list_masterslist_mastersB
Read-only

Master library contents (content-addressed by camera/gain/offset/binning/exposure/temperature/source frames).

Inputs: gain, kind, camera, exptime.

list_windowslist_windowsB
Read-only

Open image windows/views: id, size, colour space, bit depth, file path, linear guess, astrometric solution, mask.

Inputs: no named parameters.

local_contrastlocal_contrastB
Destructive

LocalHistogramEqualization (non-linear). Checkpoints first.

Inputs: id (required), amount, radius, checkpoint, +1 more.

local_normalizationlocal_normalizationB

LocalNormalization (.xnml) of registered frames against the reference; feeds integrate/drizzle for gradient-aware normalization. Async, per-frame.

Inputs: files, scale, out_dir, reference.

mask_infomask_infoA
Read-only

Which mask (if any) is attached to a window and whether it is enabled/inverted.

Inputs: id (required).

match_calibrationmatch_calibrationA
Read-only

For a light group from the last scan: choose darks/flats/flat-darks/bias with the matching rules (exact INSTRUME/GAIN/OFFSET/binning, EXPTIME ±0.5 %, temperature graded ok/acceptable/poor), and output the CMOS calibration policy (dark+flat without bias when darks match; bias+optimizeDarks only for dark scaling; flats with flat-dark or bias). Returns reasoning, warnings and blocking issues. Show the plan to the user before stacking.

Inputs: light_group_id (required), force, allow_dark_scaling.

measure_starsmeasure_starsA
Read-only

Objective star quality of a view: count, median FWHM (px and arcsec if pixel_scale given), eccentricity, centre vs edge FWHM, brightest stars. Uses StarDetector + DynamicPSF (Moffat). Read-only.

Inputs: id (required), fit_psf, pixel_scale, sensitivity, +1 more.

measure_subframesmeasure_subframesA

SubframeSelector measurement of (debayered) frames: FWHM, eccentricity, SNR weight, PSF signal weight, star count, median, noise per frame, plus spread statistics. Stored in the session for select_subframes. Async.

Inputs: files (required), wait, camera_gain, pixel_scale.

morphologymorphologyA
Destructive

MorphologicalTransformation (Dilation/Erosion/Opening/Closing/Median) — grow/shrink masks. Checkpoints first.

Inputs: id (required), size, amount, operator, +2 more.

open_imageopen_imageA

Open an image file (FITS/XISF/TIFF/…) in PixInsight as a view. Returns the view id, dimensions, FITS keywords. The window stays open for later tools.

Inputs: path (required), id.

pi_capabilitiespi_capabilitiesA
Read-only

Which optional processes/scripts exist in this PixInsight (BlurXTerminator, NoiseXTerminator, StarXTerminator, StarNet, GraXpert, WBPP, ImageSolver, SPCC…). Tools fall back automatically when something is missing.

Inputs: no named parameters.

pi_console_logpi_console_logA
Read-only

Tail of the PixInsight console output captured for the most recent (or given) job.

Inputs: lines, job_id.

pi_end_sessionpi_end_sessionB

End the current session; optionally close all image windows in PixInsight.

Inputs: close_windows.

pi_list_sessionspi_list_sessionsA
Read-only

List sessions in the workdir and which is current.

Inputs: no named parameters.

pipeline_runpipeline_runA

One call from raw lights to a master light. engine 'wbpp' (default): PixInsight's WeightedBatchPreprocessing in a separate instance with exactly the matched calibration groups, then the master is opened in the daemon and WBPP intermediates are deleted. engine 'native': plan → masters (cached) → calibrate → cosmetic (CFA) → debayer → measure → select (SSWEIGHT) → register (+drizzle data) → local normalization → integrate [→ drizzle]. Frames dropped with exclude_frames (after blink_frames) are honoured. Working files go to /working-files. Runs in the background; poll pipeline_status. Resumable with resume_id.

Inputs: force, engine, drizzle, min_stars, +18 more.

pipeline_statuspipeline_statusA
Read-only

Progress of a pipeline_run: current stage, per-stage status, live job progress, warnings, master light path/view id, integration rejection stats.

Inputs: pipeline_id.

pi_restartpi_restartA
Destructive

Kill PixInsight and relaunch the daemon (picks up daemon code changes; open windows are lost).

Inputs: no named parameters.

pi_run_pjsrpi_run_pjsrA

Escape hatch: run arbitrary PJSR (PixInsight JavaScript) inside the warm PixInsight instance. Assign result = ... to return JSON. Helpers: PIMCP.win.view(id), PIMCP.stf, PIMCP.preview.render(view,{out_path}), PIMCP.K.{GRAY,RGB,REAL,INTEGER,NOSWAP} (macros are not visible to eval). Gated by config allowRawScripts.

Inputs: script (required), timeout_ms, script_args.

pi_start_sessionpi_start_sessionA

Create a new processing session (an output namespace under the workdir: work/, previews/, checkpoints/). Sessions persist across server restarts; the latest is current.

Inputs: name, target_dir.

pi_statuspi_statusA
Read-only

Daemon/PixInsight liveness, version, installed optional modules (BXT/NXT/SXT…), open windows, current session, active job. Call first. Does not launch PixInsight unless launch:true.

Inputs: launch.

pi_stoppi_stopA
Destructive

Stop the daemon loop (PixInsight stays open) or kill the PixInsight process (mode:'kill' — loses unsaved windows; the only way to abort a running ImageIntegration).

Inputs: mode.

pi_use_sessionpi_use_sessionB

Switch the current session to an existing one (resume work).

Inputs: id (required).

pixel_mathpixel_mathB
Destructive

PixelMath expression on a view ($T = target; other view ids usable). new_id creates a new image instead of replacing. Checkpoints first when in place.

Inputs: id (required), expression (required), new_id, rescale, +4 more.

pixelmath_maskpixelmath_maskC

Mask from a PixelMath expression evaluated on the view ($T), e.g. 'iif($T>0.2,1,0)'. Returns mask_id.

Inputs: id (required), expression (required), mask_id, rescale.

plate_solveplate_solveA

ImageSolver astrometric solution (needed by SPCC/PCC and annotate). Seeds RA/DEC/focal/pixel size from FITS keywords; pass them if headers lack them. Needs internet for the Gaia/VizieR catalog. Non-destructive (adds metadata).

Inputs: id (required), ra, dec, force, +4 more.

process_paramsprocess_paramsA
Read-only

Default parameter listing (toSource) of a PixInsight process — discover exact parameter names for apply_process.

Inputs: process (required).

range_maskrange_maskA

Luminance range mask (RangeSelection on a stretched gray copy): low/high 0..1, fuzziness, smoothness, invert. Returns mask_id (new view).

Inputs: id (required), low, high, invert, +4 more.

registerregisterB

StarAlignment of frames to a reference (default: highest-weight approved frame from select_subframes). Writes *_r.xisf and .xdrz drizzle data. Async, per-frame progress, cancellable.

Inputs: files, out_dir, reference, interpolation, +2 more.

remove_starsremove_starsA
Destructive

StarXTerminator / StarNet2 → starless view (in place) + stars view. Returns NOT_INSTALLED if neither exists (this rig: none installed). Checkpoints first.

Inputs: id (required), linear, params, unscreen, +2 more.

render_previewrender_previewA
Read-only

LOOK AT THE IMAGE. Renders a JPEG preview of a view (auto-stretched by default for linear data) and returns it inline as an image plus its file path. Never modifies the view. stretch: 'stf' (AutoSTF), 'hard' (aggressive), 'none' (as-is, for already stretched images).

Inputs: id (required), rect, linked, stretch, +1 more.

resampleresampleB
Destructive

Resize by factor (integer downsample uses IntegerResample average) or to width×height. Checkpoints first.

Inputs: id (required), width, factor, height, +2 more.

restore_checkpointrestore_checkpointA
Destructive

Roll back: load a checkpoint .xisf into the view in place (same id) or as a new window if the id is not open.

Inputs: path (required), id.

saturationsaturationA
Destructive

ColorSaturation boost (amount -1..1, default 0.3) or explicit hue curve. Non-linear stage. Checkpoints first.

Inputs: id (required), curve, amount, checkpoint.

save_imagesave_imageA

Save a view to disk. Format by extension: .xisf (lossless, recommended), .fit, .tif, .png, .jpg. bit_depth 8/16 for tif/png. Output must be under the workdir (never in source folders).

Inputs: id (required), path, format, bit_depth, +1 more.

save_projectsave_projectA

Save the processing 'project': the view as XISF (PixInsight embeds the processing history), companion views (masks/stars), every checkpoint reference and the tool history as manifest.json under /project/. PixInsight .xosm projects cannot be written by scripts.

Inputs: id (required), name, also_views.

scan_framesscan_framesA
Read-only

Inventory a folder tree of FITS files WITHOUT PixInsight: parses headers, classifies light/dark/flat/bias (IMAGETYP → ASIAIR path → filename), groups by camera/gain/offset/exposure/temperature/target, reports counts and total integration. Result is cached in the session for match_calibration. The scanned root becomes write-protected.

Inputs: root, recursive, include_frames.

scnrscnrB
Destructive

SCNR green (or other colour) cast removal, non-linear stage typically. Checkpoints first.

Inputs: id (required), color, amount, checkpoint, +2 more.

select_subframesselect_subframesA

Approve/reject measured frames with explicit limits (max_fwhm, max_eccentricity, min_stars, min_snr_weight) or relative rules (fwhm_factor × median). Returns approved/rejected with reasons and the spread, then writes SSWEIGHT into approved frames (output to /work/weighted). Be reluctant to reject with < 20 frames.

Inputs: dry_run, out_dir, max_fwhm, min_stars, +4 more.

set_screen_stretchset_screen_stretchA

Apply an AutoSTF to the on-screen display of a view (non-destructive; for a human watching the PixInsight window).

Inputs: id (required), mode, linked.

sharpensharpenA
Destructive

UnsharpMask (luminance, deringing) for the non-linear stage; gentle defaults sigma 2 amount 0.6. Checkpoints first.

Inputs: id (required), sigma, amount, checkpoint, +1 more.

star_maskstar_maskB

StarMask process → new mask view (mask_id). Use with apply_mask to protect stars during stretches/sharpening.

Inputs: id (required), layers, params, mask_id, +6 more.

stretchstretchA
Destructive

Linear → non-linear. method: 'sts' (AutoSTF made permanent; target_background 0.25 default, shadows_clip -2.8), 'arcsinh' (colour-preserving, stretch factor), 'masked' (MaskedStretch, star-friendly), 'mas' (MultiscaleAdaptiveStretch), 'ht' (manual shadows/midtones/highlights), 'ghs' if installed. Checkpoints first. Check clipped-black % afterwards.

Inputs: id (required), hard, linked, method, +11 more.

undoundoA
Destructive

Undo the last N history steps of a view (PixInsight undo stack).

Inputs: id (required), steps.

wbpp_runwbpp_runA

Cross-check: run PixInsight's own WeightedBatchPreprocessing (WBPP) in a separate PixInsight instance on a light group + calibration groups, fully automated. Slow (whole pipeline) but independent — compare its master light to ours with image_statistics/measure_stars. Extra WBPP parameters can be passed as params using WBPP automation names (e.g. generateRejectionMaps, darkExposureTolerance, smartNamingOverride).

Inputs: dirs, files, params, output_dir, +2 more.

wbpp_statuswbpp_statusA
Read-only

Status of a wbpp_run (running/ok/error, log tail, master light paths).

Inputs: wbpp_id (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 92 tools

    Disambiguation5/5

    Every tool targets a distinct PixInsight operation or query, with detailed descriptions that eliminate overlap between similar functions (e.g., the various integration methods). Even closely related tools like pi_console_log and job_log are clearly delineated by their scope. No two tools appear to do the same thing.

    Naming Consistency5/5

    Tool names follow a consistent verb_noun snake_case pattern throughout (pi_start_session, build_master_dark, render_preview, apply_process). Prefixes like pi_, job_, and list_ are used predictably to group related operations. There are no mixed conventions or cryptic abbreviations.

    Tool Count1/5

    At 92 tools, this is far beyond the 50+ threshold for an extreme mismatch, making it overwhelming for agents to navigate and select from. While each tool has a specific role, the sheer number is not 'well-scoped' and would likely strain context windows and decision-making. A more modular server could group these into smaller purpose-built servers.

    Completeness5/5

    The tool surface covers the entire astrophotography processing workflow: session/file management, calibration, stacking, integration, visual previews, masks, stretching, color calibration, and even fallback escape hatches. No obvious gaps exist for the stated purpose of controlling PixInsight. It even includes cross-check and cleanup tools, making it unusually complete.

    Maintenance

    ActivityStale
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      A protocol server enabling AI agents to control astrophotography equipment through the N.I.N.A. (Nighttime Imaging 'N' Astronomy) software, allowing for natural language command processing of cameras, mounts, focusers, and other astronomy equipment.
      14
      MIT
    • 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
    • F
      license
      A
      quality
      D
      maintenance
      Enables AI agents to control N.I.N.A. astronomy software remotely, including mount, camera, sequencer, and other equipment via the ninaAPI plugin.
      66
      -
    • A
      license
      A
      quality
      C
      maintenance
      Enables LLMs to control a live Siril GUI session through a bridge, allowing them to run Siril commands and scripts, inspect image state, get previews and statistics, and perform edits such as selections and undo.
      9
      2
      GPL 3.0