pixinsight-mcp
Full remote control of PixInsight for AI agents — from raw FITS subs to a finished astrophotography image, with visual feedback and safety guardrails.
Session & job management: start/switch/list sessions, run/cancel/wait on async jobs, tail console logs, restart/stop the PixInsight daemon, run arbitrary PJSR scripts
Image inventory (no PixInsight needed): scan folder trees of FITS files, parse headers, group lights/darks/flats/bias by camera/gain/exposure/temperature, match calibration frames with CMOS-correct rules, list master frames
Stacking pipelines: one-call
pipeline_runusing either WBPP (PixInsight's own, in a separate instance) or a native chain (calibrate → cosmetic → debayer → measure → select → register → local normalization → integrate → drizzle); plus individual tools for every stageBlink culling: contact-sheet review of subs with background/star/gradient metrics, flag suspects, exclude bad frames before stacking
Visual inspection: render JPEG previews (full/crop/side-by-side), image statistics, histograms, star FWHM/eccentricity measurement, annotate plate-solved views
Post-processing: DBE/ABE/GradientCorrection, background neutralization, plate solving (offline Gaia), SPCC/PCC/ColorCalibration, denoise (NXT/MLT/TGV), MaskedStretch/STF/arcsinh/HT/GHS stretch, HDR compression, local contrast, curves, saturation, star reduction/removal, masks (star/range/pixelmath), rotate/crop/resample, sharpen, pixel math, channel ops, apply any installed process generically
Provenance & safety: checkpoints before destructive steps, undo, save XISF project with embedded history + PROCESSING.md manifest, 16-bit TIFF export, cleanup of intermediates, refusal to overwrite or write into raw data folders, stops on mismatched calibration until acknowledged
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@pixinsight-mcp Calibrate and stack my M42 lights with flats"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
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: |
🧹 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, |
📓 Provenance |
|
🧽 Housekeeping | Working files live next to the object ( |
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 intocurrent/totalprogress.job_waitblocks up to five minutes;PI_BUSYprotects 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 buildCreate 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 |
| PixInsight default path | Executable |
| — | Raw data. Never written to. |
|
| Working files at |
|
|
|
|
| Extra WBPP automation parameters |
|
| Refuse to stack on mismatched/missing calibration until acknowledged |
|
| Refuse calibration without a master flat unless forced |
|
| Keep calibrated/registered files after each stage |
| working-files, … | Folders skipped by |
|
| Compile ImageSolver/AnnotateImage into the daemon |
|
| Enable |
|
| Start PixInsight on demand |
| 0.5 % / 2 °C / 5 °C / 14 d / 200 steps | Matching tolerances |
| 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 |
|
Look before stacking: blink contact sheet → drop bad subs |
|
Stop rule: mismatched or missing calibration (dark temperature > 2 °C, dark scaling, no flats) → refuse until the user has been told and agrees |
|
WBPP is the stacking engine unless asked otherwise; exact matched groups; |
|
CMOS calibration: matched darks → dark + flat only, no bias, no dark optimisation |
|
Every destructive step checkpoints; |
|
A |
|
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_files1: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:
gradient_correction { method: "DBE" }— DynamicBackgroundExtraction with automatically placed background samples (stars and object rejected)background_neutralize→plate_solve→color_calibrate { method: "SPCC" }against the local Gaia DR3/SP databasedenoise { strength: 0.3 }(NoiseXTerminator if present, else MLT), verified at 1:1stretch { method: "masked", target_background: 0.15 }— MaskedStretch keeps star cores smallhdr_compress→local_contrastthrough arange_maskof the object onlyscnr→ hue-weightedsaturation(blue/cyan for galaxies, red/magenta for emission nebulae) →curvesreduce_stars(StarMask-protected morphological erosion) →rotate/cropfor framingsave_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 v8is required for modern syntax and to#includePixInsight's ImageSolver library. Under V8: process enums are statics (ImageIntegration.Average), 64-bit counters areBigInt,View.viewByIdreturnsnull,Histogramisnew Histogram(bins)+generate(image),StarDetectoris native (includingpjsr/StarDetector.jshshadows 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.measurementsis read-only and weighting expressions evaluate to 0 from scripts → weights are computed in Node and stamped asSSWEIGHT.DynamicBackgroundExtractionexecutes from itsdatatable (normalised coordinates);samplesis 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=(notoutputDir),platesolve=falseto 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 toolsannotateannotateBRead-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_processADestructive
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_cropADestructive
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_neutralizeBDestructive
BackgroundNeutralization (equalize channel backgrounds) — linear stage. Checkpoints first.
Inputs: id (required), params, checkpoint, reference_id, +1 more.
binarizebinarizeCDestructive
Binarize a (mask) view at a threshold. Checkpoints first.
Inputs: id (required), threshold, checkpoint.
blink_framesblink_framesARead-only
Blink-style review before stacking: renders a contact sheet of auto-stretched thumbnails for a light group (or file list) with per-frame background, star count, gradient and saturation, and flags suspects (clouds, dawn, trails, defocus). LOOK at the sheet, then pass the bad indexes to exclude_frames. Pages of up to 30 frames.
Inputs: page, files, thumb, job_id, +3 more.
blurblurBDestructive
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_filesADestructive
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_windowADestructive
Close an image window (force: discard unsaved changes, default true).
Inputs: id (required), force.
color_calibratecolor_calibrateADestructive
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_starsCDestructive
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_previewsARead-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_grayADestructive
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.
cropcropCDestructive
Crop to rect [x, y, w, h]. Checkpoints first.
Inputs: id (required), rect (required), checkpoint.
crop_previewcrop_previewARead-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.
curvescurvesADestructive
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.
deconvolvedeconvolveADestructive
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.
denoisedenoiseBDestructive
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_headerARead-only
Raw FITS header cards of one file plus the parsed frame record (no PixInsight needed).
Inputs: path (required).
gradient_correctiongradient_correctionADestructive
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_filesBRead-only
File paths of a frame group from the last scan.
Inputs: group_id (required).
hdr_compresshdr_compressBDestructive
HDRMultiscaleTransform to recover bright cores (galaxy cores, nebula centres) on a non-linear image. Checkpoints first.
Inputs: id (required), layers, params, checkpoint, +1 more.
histogramhistogramBRead-only
Per-channel histogram counts (default 256 bins) for a view. Read-only.
Inputs: id (required), bins.
image_keywordsimage_keywordsBRead-only
FITS keywords, XISF properties and astrometric solution summary of an open view.
Inputs: id (required).
image_statisticsimage_statisticsARead-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.
invertinvertADestructive
Invert a view (useful on masks). Checkpoints first.
Inputs: id (required), checkpoint.
job_canceljob_cancelADestructive
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_logBRead-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_statusARead-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_waitARead-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_fitBDestructive
LinearFit the view to a reference view (match channel/sessions). Checkpoints first.
Inputs: id (required), reference_id (required), checkpoint.
list_checkpointslist_checkpointsBRead-only
Checkpoint files in the current session.
Inputs: no named parameters.
list_jobslist_jobsARead-only
List jobs submitted by this server process (id, op, status, progress).
Inputs: active_only.
list_masterslist_mastersBRead-only
Master library contents (content-addressed by camera/gain/offset/binning/exposure/temperature/source frames).
Inputs: gain, kind, camera, exptime.
list_windowslist_windowsBRead-only
Open image windows/views: id, size, colour space, bit depth, file path, linear guess, astrometric solution, mask.
Inputs: no named parameters.
local_contrastlocal_contrastBDestructive
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_infoARead-only
Which mask (if any) is attached to a window and whether it is enabled/inverted.
Inputs: id (required).
match_calibrationmatch_calibrationARead-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_starsARead-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.
morphologymorphologyADestructive
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_capabilitiesARead-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_logARead-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_sessionsARead-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_statusARead-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_restartADestructive
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_statusARead-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_stopADestructive
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_mathBDestructive
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_paramsARead-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_starsADestructive
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_previewARead-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.
resampleresampleBDestructive
Resize by factor (integer downsample uses IntegerResample average) or to width×height. Checkpoints first.
Inputs: id (required), width, factor, height, +2 more.
restore_checkpointrestore_checkpointADestructive
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.
saturationsaturationADestructive
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_framesARead-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.
scnrscnrBDestructive
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.
sharpensharpenADestructive
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.
stretchstretchADestructive
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.
undoundoADestructive
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_statusARead-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
Scored across 92 tools
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.
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.
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.
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
Related MCP Connectors
Build and run visual creative-production workflows from your AI agent.
Image & PDF tools for AI agents: compress, convert, resize, PDF, AI vision, pipeline.
Design, save, and run outcome-aligned AI workflows and verifiers, with reliable image output.
Image and video AI tools and your own pipelines, run from any AI assistant.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceA 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.14MIT
- AlicenseNot gradedqualityDmaintenanceEnables 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
- FlicenseAqualityDmaintenanceEnables AI agents to control N.I.N.A. astronomy software remotely, including mount, camera, sequencer, and other equipment via the ninaAPI plugin.66-
- AlicenseAqualityCmaintenanceEnables 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.92GPL 3.0