SCAPS-1D

io.github.asiff00由 GitHub 账号 asiff00 发布v0.1.0更新于 Nov 2, 2026

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

概览

AI 生成的概览

在本地 SCAPS-1D 安装上以无界面方式运行,让助手设计、模拟、批量扫描、拟合并校验薄膜太阳能电池。

可以做什么
  • 查看安装信息、列出 SCAPS 数据文件并检索已安装版本的命令列表
  • 读取、编辑和新建器件定义,导入或写入 SCAPS 输入文件
  • 运行单次模拟(J-V、QE、C-V、C-f、空间分布),并给出分析与合理性检查
  • 批量扫描参数、拟合实测曲线或优化效率、Voc、Jsc、FF 等指标
  • 读取结果表格、生成 PNG 图,并列出、等待或取消后台任务
  • 运行经校验的 SCAPS 脚本,并按带隙计算细致平衡极限
适用场景
适合已经安装 SCAPS-1D、希望由助手完成器件定义搭建、模拟与对比、参数扫描、实测曲线拟合或识别不合理结果的场景,无需在 SCAPS 图形界面中逐项操作。
运行要求
本地需有 Windows 版 SCAPS-1D 3.3(已在 3.3.12 测试),由服务器自动查找或通过 SCAPS_HOME 指定;需要 Python 3.11 或更高版本,以 uvx 运行。Linux 上 SCAPS 需在 Wine 与 Xvfb 下运行。绘图需可选的 matplotlib 附加组件。SCAPS 本身需向作者申请。
安装前请注意
SCAPS 不随服务器提供,须遵守作者的使用条件,包括在论文中引用 SCAPS。服务器会向 SCAPS 文件夹和 SCAPS_RUNS_DIR 写入新的 .def 文件及运行输入与结果,批量扫描或拟合可能耗时很长。每个安装同时只运行一个 SCAPS 进程;Linux 上 README 建议移除 Wine 前缀中对宿主根目录的盘符映射以增强隔离。

安装

在 SourceWeft 中

  1. 打开 控制台中的 SCAPS-1D,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

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

来源:README.md,提交 24dc467

工具

16

scaps_status

SCAPS installation status

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

无需输入参数。

scaps_list_files

List SCAPS files

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

输入参数kindlimitoffsetcontains

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.

输入参数limitquery必填

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.

输入参数definition必填

scaps_edit_device

Edit a SCAPS device

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

输入参数base必填save_as必填numericsmaterialsoverwriteoperations

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.

输入参数name必填layers必填optionsnumericsoverwriteinterfacesleft_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.

输入参数actionsprofilesspectrumvoltage_vdefinition必填parametersfrequency_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.

输入参数modeactionsprofilesspectrumvariables必填definition必填parametersilluminationmeasurementswait_secondstemperature_k

scaps_jobs

Manage SCAPS jobs

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

输入参数limitactionjob_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.

输入参数filesteptableoffsetrun_id必填columnsmax_rows

scaps_plot

Plot SCAPS results

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

输入参数xyfiles必填log_xlog_ytabletitlerun_id必填width_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.

输入参数script必填timeout_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.

输入参数spectrumband_gaps_ev必填temperature_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.

输入参数kind必填name必填content必填overwrite

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.

输入参数x必填y必填darkkind必填name必填noteextrabias_vsharedx_unitarea_cm2position另有 7 个

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.

输入参数goal必填metrictargetactionsmeasuredspectrumvariables必填definition必填parameterswait_secondstemperature_kmax_evaluations

版本历史

1
  1. v0.1.0最新Oct 26, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分