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。伺服器會將新的 .def 檔及執行輸入與結果寫入 SCAPS 資料夾與 SCAPS_RUNS_DIR,批次掃描或擬合可能耗時很久。每個安裝同時只執行一個 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 分