SCAPS-1D

io.github.asiff00Published by GitHub account asiff00v0.1.0Updated Nov 2, 2026

Design, simulate, fit and sanity-check thin-film solar cells with SCAPS-1D on your own installation.

Overview

AI-generated overview

Drives a local SCAPS-1D installation headless so an assistant can design, simulate, batch, fit and sanity-check thin-film solar cells.

What you can do
  • Inspect the installation, list SCAPS data files and search the installed command list
  • Read, edit and create device definitions, and import or write SCAPS input files
  • Run single simulations (J-V, QE, C-V, C-f, profiles) with analysis and realism checks
  • Sweep parameters in batches, fit measured curves or optimise figures of merit
  • Read result tables, render PNG plots, and list, wait for or cancel background jobs
  • Run validated SCAPS scripts and compute detailed-balance limits for band gaps
When to use it
Useful when you already have SCAPS-1D and want an assistant to set up device definitions, run and compare simulations, sweep parameters, fit measured curves, or flag unphysical results, without clicking through the SCAPS GUI.
Requirements
A local Windows SCAPS-1D 3.3 installation (tested with 3.3.12) that the server can find or that is pointed to by SCAPS_HOME; Python 3.11 or newer, run via uvx. On Linux, SCAPS runs under Wine and Xvfb. Optional matplotlib extra for plots. SCAPS itself must be requested from its authors.
Before you install
SCAPS is not bundled and comes with the authors' conditions of use, including citing SCAPS in publications. The server writes new .def files and run inputs and results into SCAPS folders and SCAPS_RUNS_DIR, and long batches or fits can run for a long time. Only one SCAPS process runs per installation at a time, and on Linux the README advises removing the Wine drive mapping of the host root for isolation.

Installation

In SourceWeft

  1. Open SCAPS-1D in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

scaps-mcp

MCP server for SCAPS-1D, the one-dimensional solar cell simulator of the University of Gent. It drives your own SCAPS installation headless and gives any MCP client device design, simulation, batches, curve fitting, result analysis and realism checks.

SCAPS is not included. Request it from its authors as described on the SCAPS website and follow their conditions of use, which include citing SCAPS in publications.

Capabilities

  • Devices: describe any .def, edit it with every SCAPS set command, load .material files into layers, create devices from scratch (up to 7 layers, 7 defects per layer, 3 defects per interface), and set solver numerics that scripts cannot reach.
  • Simulation: J-V, QE, C-V and C-f with any working point, illumination side, spectrum or generation model, ND filter and cut-off; energy band, generation-recombination and AC profiles.
  • Batches: grid or paired sweeps over any set or action key, including temperature, intensity and bias.
  • Fitting and optimisation: bounded Nelder-Mead against one or several measured curves (light and dark J-V, QE, C-V), or towards maximum, minimum or target efficiency, Voc, Jsc or FF.
  • Input files: import shared .def, .material, absorption, spectrum, generation, filter, grading and measurement files, or write them from data with unit conversion (absorption from alpha or extinction coefficient k).
  • Analysis: Shockley-Queisser limit of the absorber under the spectrum used, QE-integrated Jsc, Mott-Schottky built-in voltage and doping, band offsets at every interface.
  • Realism checks: results above the detailed-balance limit, missing radiative recombination, ideal interfaces, band spikes and cliffs, compensating defects, implausible densities of states, default absorption models and other common causes of unphysical SCAPS studies.
  • Jobs: long runs continue in the background with progress, waiting and cancellation.
  • Validation: every key and value is checked against the command list of the installed SCAPS version before SCAPS starts.

Requirements

  • SCAPS-1D 3.3 (tested with 3.3.12)
  • Python 3.11 or newer

Setup on Windows

Install SCAPS with its installer into a folder you can write to. SCAPS uses its installation folder as its working folder, and its authors advise against Program Files. Copy any SCAPS update files over the installed ones and check that the server finds it:

sh
uvx scaps-mcp doctor

Setup on Linux (optional)

SCAPS is a Windows program; on Linux it runs headless under Wine and Xvfb. Install both (Debian and Ubuntu):

sh
sudo dpkg --add-architecture i386sudo apt updatesudo apt install wine wine32:i386 xvfb

Create a 32-bit prefix and install SCAPS into it, from the folder holding the unpacked SCAPS installer:

sh
export WINEARCH=win32 WINEPREFIX="$HOME/scaps/prefix"xvfb-run -a bash -c 'wineboot -i && wineserver -w'xvfb-run -a bash -c 'wine setup.exe /q /AcceptLicenses yes /r:n && wineserver -w'

Copy any SCAPS update files over the installed ones and check that the server finds it:

sh
uvx scaps-mcp doctor

Finding SCAPS

Without SCAPS_HOME, the server looks for a folder holding scapsXXXX.exe with its def, results and script folders, in folders whose name contains "scaps", one or two levels below:

  • Windows: the system drive, your user folder, Documents, Desktop, Downloads, Program Files and Program Files (x86).
  • Linux: your home folder and the drive_c and Program Files folders of Wine prefixes: ~/.wine, $WINEPREFIX, $SCAPS_WINEPREFIX, winetricks prefixes and prefixes inside home folders named like scaps.

When several installations are found, the newest SCAPS version is used. scaps_status and doctor show the folder in use and any others. Set SCAPS_HOME to choose one yourself.

Configuration

VariableMeaningDefault
SCAPS_HOMESCAPS folder containing scapsXXXX.exefound automatically
SCAPS_EXEexecutable namenewest scaps*.exe
SCAPS_TIMEOUTseconds per SCAPS run300
SCAPS_RUNS_DIRwhere run inputs and results are keptuser cache folder
SCAPS_WINEPREFIXLinux only: Wine prefixthe prefix containing the SCAPS folder
SCAPS_WINE, SCAPS_WINESERVERLinux only: Wine binariesfound on the system
SCAPS_XVFBLinux only: 0 to use the current display instead of Xvfb1

Plots need the optional extra: uvx --with matplotlib scaps-mcp, or install scaps-mcp[plot].

Clients

Claude Code:

sh
claude mcp add --transport stdio scaps -- uvx scaps-mcp

Straight from the repository instead of PyPI:

sh
claude mcp add --transport stdio scaps -- uvx --from git+https://github.com/asiff00/scaps-mcp scaps-mcp

Add --env SCAPS_HOME=<folder> before scaps when SCAPS is somewhere the server does not search.

Project configuration (.mcp.json), with a long tool timeout for batches and fits:

json
{  "mcpServers": {    "scaps": {      "command": "uvx",      "args": ["scaps-mcp"],      "timeout": 3600000    }  }}

Other MCP clients start the same command, with SCAPS_HOME in the server environment only when SCAPS is somewhere the server does not search.

Tools

ToolPurpose
scaps_statusInstallation, version, run folder, plotting support, running jobs
scaps_list_filesDefinitions, materials, spectra, absorption, grading, measurement and other files
scaps_script_referenceSearch the installed SCAPS command list
scaps_describe_deviceLayers, defects, interfaces with band offsets, contacts, realism checks
scaps_edit_deviceSet commands, materials and solver numerics, saved as a new definition
scaps_create_deviceNew device from a layer, defect, interface and contact description
scaps_import_fileAdd a shared SCAPS file and report missing referenced files
scaps_write_dataWrite absorption, spectrum, generation, filter, grading or measurement files from data
scaps_simulateOne simulation with metrics, curves, profiles, analysis and checks
scaps_batchGrid or paired sweeps over set and action keys
scaps_optimizeFit measured curves or optimise a figure of merit
scaps_jobsList, inspect, wait for or cancel runs
scaps_resultsPaginated tables from any result file
scaps_plotPNG plot of result curves and profiles
scaps_run_scriptValidated SCAPS script for recorder, math, loops and tandem workflows
scaps_sq_limitDetailed-balance limits for given band gaps and spectrum

Definitions and run files are also available as scaps://definitions/{name} and scaps://runs/{run_id}/{file} resources.

Conventions

Keys and units follow the SCAPS script language: thickness in um, densities in cm^-3, interface densities in cm^-2, mobility in cm^2/Vs, velocity in cm/s, cross sections in cm^2, energies in eV, temperature in K. Layers, defects and interfaces count from 1, and layer 1 touches the left (back) contact. Contacts are addressed as contactleft and contactright.

Scripts cannot add the first bulk defect to a layer; scaps_create_device inserts one and configures it. Grading laws, per-level parameters of multivalent defects and the GUI curve fitter have no script commands; use grading files, scaps_optimize and definitions made in the GUI.

Safety

One SCAPS process runs per installation at a time, guarded by a file lock (fcntl on Linux, msvcrt on Windows) that all processes honour. Stopping the server, including with SIGTERM, stops the SCAPS process it started; a process left behind by a crash is stopped by the next run. File names must be bare names inside SCAPS folders. Scripts may not run system commands or open blocking dialogs. For isolation, remove the Wine drive mapping of the host root from the prefix.

Companion skill

The scaps-1d skill teaches an agent SCAPS workflows and realism rules. It works on its own and uses these tools when they are available.

Development

sh
uv syncuv run pytestuv run pytest -m scapsuv run ruff check src tests

Citation

Simulations made with SCAPS should cite M. Burgelman, P. Nollet and S. Degrave, Modelling polycrystalline semiconductor solar cells, Thin Solid Films 361-362 (2000) 527-532, doi:10.1016/S0040-6090(99)00825-1.

License

MIT

Source: README.md at commit 24dc467

Tools

16

scaps_status

SCAPS installation status

Report the SCAPS installation in use and how it was found, other installations, run folder and jobs.

Takes no parameters.

scaps_list_files

List SCAPS files

List files in a SCAPS data folder: definitions, spectra, absorption, grading, generation and more.

Parameterskindlimitoffsetcontains

scaps_script_reference

Search SCAPS script commands

Search the command list of the installed SCAPS version. layer, defect, interface and IFdefect stand for numbered forms (layer2, defect1); contact stands for contactleft or contactright; <none> marks commands without a value.

Parameterslimitqueryrequired

scaps_describe_device

Describe a SCAPS device

Read a .def file: layers, bulk defects, interfaces with band offsets, contacts and realism checks. Fields use script names and units, so any value can be passed back as a parameter (layers[0].NA -> 'layer1.NA'). Graded layers report their base value.

Parametersdefinitionrequired

scaps_edit_device

Edit a SCAPS device

Change a device and save it as a .def file: parameters, layers, defects, materials and solver settings.

Parametersbaserequiredsave_asrequirednumericsmaterialsoverwriteoperations

scaps_create_device

Create a SCAPS device

Build a new device from scratch and save it as a .def file. A layer may name a .material file ('material': 'CIGSe.material'); its properties apply first and explicit keys override them.

Parametersnamerequiredlayersrequiredoptionsnumericsoverwriteinterfacesleft_contactright_contact

scaps_simulate

Run a SCAPS simulation

Simulate a device: J-V metrics, QE, C-V, C-f and spatial profiles, with analysis and realism checks. Analysis gives the absorber's Shockley-Queisser limit, QE-integrated Jsc and a Mott-Schottky fit of C-V. Overrides apply to this run only; files stay available through scaps_results and scaps_plot.

Parametersactionsprofilesspectrumvoltage_vdefinitionrequiredparametersfrequency_hzilluminationmeasurementswait_secondstemperature_kresponse_format

scaps_batch

Batch SCAPS simulations

Run one SCAPS session over many parameter values and tabulate the J-V metrics of every point. Covers thickness, doping, defect, band offset, temperature, intensity and bias studies. Every point's files are kept for scaps_results and scaps_plot.

Parametersmodeactionsprofilesspectrumvariablesrequireddefinitionrequiredparametersilluminationmeasurementswait_secondstemperature_k

scaps_jobs

Manage SCAPS jobs

List recent runs, or get, wait for or cancel one. A finished job includes its full result.

Parameterslimitactionjob_idwait_seconds

scaps_results

Read SCAPS results

Return one table of a result file: J-V, QE, C-V, C-f curves or band, generation and AC profiles.

Parametersfilesteptableoffsetrun_idrequiredcolumnsmax_rows

scaps_plot

Plot SCAPS results

Render result curves as a PNG image. Requires the optional 'plot' extra.

Parametersxyfilesrequiredlog_xlog_ytabletitlerun_idrequiredwidth_px

scaps_run_script

Run a SCAPS script

Run a SCAPS script for workflows beyond the other tools: recorder, curve fitting, math, loops, tandem. The server prepends quit and error-log settings and 'clear all'. Commands are checked against the installed SCAPS; file names must be bare; system commands are rejected. Results saved with 'save results.<kind> name' are collected into the run.

Parametersscriptrequiredtimeout_swait_secondsvalidate_only

scaps_sq_limit

Shockley-Queisser limit

Detailed-balance Jsc, Voc, FF and efficiency limits for given band gaps under a SCAPS spectrum.

Parametersspectrumband_gaps_evrequiredtemperature_k

scaps_import_file

Import a SCAPS file

Add a SCAPS file someone shared (device .def, .material, .abs, spectrum, measurement...) to the installation. Definitions and materials are parsed to confirm they are valid, and files they reference but that are missing (absorption, grading, filter) are listed.

Parameterskindrequirednamerequiredcontentrequiredoverwrite

scaps_write_data

Write a SCAPS input file

Write numeric data as a SCAPS input file with the right format and units. Use it for measured absorption (alpha or extinction coefficient k), custom spectra, external optical generation profiles, contact filters, grading profiles and measurement files for comparison.

Parametersxrequiredyrequireddarkkindrequirednamerequirednoteextrabias_vsharedx_unitarea_cm2position+7 more

scaps_optimize

Fit or optimise a SCAPS device

Fit device parameters to measured curves, or optimise efficiency, Voc, Jsc or FF, by bounded Nelder-Mead. Replaces the GUI-only SCAPS curve fitter and supports several measurements at once (light and dark J-V, QE, C-V). Each simplex step is one SCAPS session per measurement condition; long runs continue as a job past wait_seconds, so poll with scaps_jobs.

Parametersgoalrequiredmetrictargetactionsmeasuredspectrumvariablesrequireddefinitionrequiredparameterswait_secondstemperature_kmax_evaluations

Version history

1
  1. v0.1.0LatestOct 26, 2026

Score

90% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts
  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts