Skip to main content
Glama
iftahs
by iftahs

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
PIMCP_CONFIGNoPath to a PixInsight MCP configuration JSON file. Defaults to 'pixinsight-mcp.config.json' in the package directory or '~/.pixinsight-mcp.json'.
PIMCP_PI_EXENoPath to the PixInsight executable. Overrides the 'piExe' config key.
PIMCP_WORKDIRNoOverride where sessions, masters, previews and the bridge live. Overrides the 'workdir' config key.
PIMCP_DATA_ROOTNoRoot directory containing raw data. Never written to. Overrides the 'dataRoot' config key.
PIMCP_AUTO_LAUNCHNoStart PixInsight automatically when a tool needs it. Overrides the 'autoLaunch' config key. Accepts 'true' or 'false'.
PIMCP_REQUIRE_FLATSNoRefuse calibrate_lights / pipeline_run without a master flat unless force:true. Overrides the 'requireFlats' config key. Accepts 'true' or 'false'.
PIMCP_ALLOW_RAW_SCRIPTSNoEnable pi_run_pjsr (arbitrary script execution in PixInsight). Overrides the 'allowRawScripts' config key. Accepts 'true' or 'false'.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}
prompts
{
  "listChanged": true
}
resources
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
pi_statusA

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.

pi_capabilitiesA

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

pi_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.

pi_list_sessionsA

List sessions in the workdir and which is current.

pi_use_sessionB

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

pi_end_sessionB

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

pi_console_logA

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

pi_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.

cleanup_working_filesA

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.

pi_restartA

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

pi_stopA

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).

job_statusA

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

job_waitA

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.

job_logB

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

job_cancelA

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').

list_jobsA

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

scan_framesA

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.

group_filesB

File paths of a frame group from the last scan.

fits_headerA

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

match_calibrationA

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.

list_mastersB

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

list_windowsB

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

open_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.

close_windowA

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

duplicate_windowA

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

image_statisticsA

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.

histogramB

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

image_keywordsB

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

render_previewA

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).

crop_previewA

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.

compare_previewsA

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

measure_starsA

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.

set_screen_stretchA

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

save_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).

checkpointA

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

restore_checkpointA

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

undoA

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

list_checkpointsB

Checkpoint files in the current session.

build_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.

build_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.

build_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.

calibrate_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.

cosmetic_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.

debayerA

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

measure_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.

select_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.

registerB

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.

local_normalizationB

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

integrateA

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.

drizzle_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.

fast_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.

apply_processA

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.

process_paramsA

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

gradient_correctionA

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.

plate_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).

annotateB

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

color_calibrateA

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.

background_neutralizeB

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

scnrB

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

deconvolveA

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).

denoiseB

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

remove_starsA

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

stretchA

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.

curvesA

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.

saturationA

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

resampleB

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

cropC

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

auto_cropA

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

pixel_mathB

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.

linear_fitB

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

sharpenA

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

hdr_compressB

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

local_contrastB

LocalHistogramEqualization (non-linear). Checkpoints first.

combine_starsC

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

extract_channelsC

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

convert_to_grayA

Convert a view to grayscale in place. Checkpoints first.

invertA

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

star_maskB

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

range_maskA

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

pixelmath_maskC

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

apply_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.

mask_infoA

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

binarizeC

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

morphologyA

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

blurB

Gaussian convolution (soften masks). Checkpoints first.

pipeline_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.

pipeline_statusA

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

wbpp_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).

wbpp_statusA

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

blink_framesA

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.

exclude_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.

save_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.

Prompts

Interactive templates invoked by user choice

NameDescription
process-sessionInventory → calibration plan (confirm with user) → stacking → post-processing with previews between steps.
inspect-frameOpen a raw frame, preview it, measure stars, and report whether it is usable.

Resources

Contextual data attached and managed by the client

NameDescription
session-stateCurrent session state, last scan summary, selection, registration and integration results
mastersCached master bias/dark/flat frames with provenance
skillAgent-facing workflow guide for this server

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

ActivityMaintained
ResponsivenessNo issues