MCP for OpenFilters

io.github.BBrunoEsteves由 GitHub 帳號 BBrunoEsteves 發布v0.2.2更新於 Nov 7, 2026

Design, simulate and optimize optical thin-film coatings with the OpenFilters engine.

已驗證STDIO僅桌面開發者工具資料與分析

概覽

AI 產生的概覽

封裝 OpenFilters 計算引擎的在地 MCP 伺服器,讓助理設計、模擬並最佳化光學薄膜鍍層。

可以做什麼
  • 列出、檢視並新增材料,包括視需求匯入 refractiveindex.info 條目
  • 計算設計的光譜、角度掃描、顏色、電場與監控曲線
  • 評估目標與評價函數、膜層靈敏度、熱靈敏度與溫度掃描
  • 以 refinement、needle 與 step 方法最佳化設計
  • 執行參數掃描、最佳化活動、蒙地卡羅公差與隨機誤差分析
  • 管理工作狀態,並載入或儲存原生 .ofp 專案檔
適用情境
適合從事光學薄膜設計(抗反射膜、反射鏡、截止濾光片、二向色鏡或窄帶濾光片)時使用,讓助理建立模擬、執行最佳化並依製造良率排序結果。
執行需求
以 stdio 在地程序執行;需要 Python 3.10 以上版本,或 uv/uvx,或打包好的安裝程式。不需安裝 OpenFilters 本體。可選環境變數 MCP_FOR_OPENFILTERS_HOME 與 MCP_FOR_OPENFILTERS_WORKERS 用來設定資料夾與平行處理程序數。僅在要求下載公開的 refractiveindex.info 資料時才需要網路。
安裝前請注意
會將結果、工作資料與專案檔寫入在地資料夾(預設位於使用者家目錄下)。長時間最佳化與活動可能佔用除一個以外的所有 CPU 核心。下載 refractiveindex.info 資料會連線外部網站。僅在 Claude 用戶端開發與測試,其他 MCP 用戶端未經測試。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 MCP for OpenFilters,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

MCP for OpenFilters

An unofficial connector built on OpenFilters: not affiliated with or endorsed by the OpenFilters authors or Polytechnique Montréal.

Design, simulate and optimize optical thin-film coatings by talking to Claude.

This project is an MCP server around the calculation core of OpenFilters (Stéphane Larouche and Ludvik Martinu, Polytechnique Montréal), ported to Python 3 and run without its GUI. Claude plans the work and reads compact summaries; the server does the computing — in parallel on all CPU cores — and writes full results to disk, including .ofp project files that open in the OpenFilters GUI.

Claude orchestrates; the server computes. One tool call can launch a whole campaign.

Quick start

Pick the one that matches how you use Claude (details under Installation):

You useDo this
Claude DesktopDownload mcp-for-openfilters-<version>.mcpb from the latest release and open it: Claude Desktop installs the extension.
Claude Codeclaude mcp add --scope user mcp-for-openfilters -- uvx mcp-for-openfilters (needs uv), or the plugin: /plugin marketplace add BBrunoEsteves/mcp-for-openfilters, then /plugin install mcp-for-openfilters@mcp-for-openfilters
Any MCP client, or no uvRun uvx mcp-for-openfilters, pip install mcp-for-openfilters (PyPI), or the installer from the release page, which also registers it in Claude Desktop and Claude Code.

Then, in a new chat: "Run the MCP for OpenFilters server_info tool", and try "Design an antireflection coating for BK7 from 430 to 670 nm with TiO2 and SiO2." It is also listed in the official MCP Registry as io.github.BBrunoEsteves/mcp-for-openfilters.

Built and tested with Claude. The server follows the open MCP standard, but it has so far been developed and tested only with Claude (Claude Desktop and Claude Code). Other MCP clients may work, but they are untested: tool descriptions, plots and long-running jobs may behave differently there.

What it can do

AreaTools
Materialslist_materials, get_material_index, add_material (constant, Cauchy, Sellmeier, n,k tables from files), search_refractiveindex + import_refractiveindex_material (any of the ~3,500 entries of the refractiveindex.info database, downloaded on demand)
Single designdescribe_design, compute_spectrum (R/T/A, phase, GD, GDD; s/p/unpolarized or any polarization angle; any angle of incidence; reverse side), compute_angle_scan, compute_color, compute_electric_field, compute_monitoring_curves (chosen wavelengths or spectroscopic; reverse side)
Targets & meritevaluate_design, layer_sensitivity
Optimizationoptimize_design — OpenFilters' refinement, needle and step methods
Temperaturethermal_sensitivity (how a peak moves per index and thickness change of each material; dλ/dT, kelvin per FWHM, athermal dn/dT), thermal_sweep (peak versus temperature) — tunable and athermal filters
Campaignsrun_batch (parameter sweeps), run_optimization_campaign (many starts → ranked → optional yield stage), tolerance_analysis (Monte Carlo yield with thickness and index errors), simulate_random_errors (OpenFilters' Preproduction: mean, standard deviation and worst case of the curves)
Jobsjob_status, get_results, list_jobs, cancel_job — results survive a server restart
Filesload_project, save_project (native .ofp)

Example requests to Claude:

  • "Design a dichroic on BK7 with R > 99 % at 532 and 1064 nm and T > 90 % at 633 nm for 0–20°, at most 40 layers of TiO2/SiO2. Run 100 needle optimizations from random starts and rank the best 10 by yield at ±1 % thickness error."
  • "Add my ALD Al2O3 from this ellipsometry file and sweep the AR coating thickness ±10 %."
  • "Find thin-film HfO2 data on refractiveindex.info, import it and redo the mirror with it."
  • "Where is the electric-field peak of this mirror at 1064 nm, and what monitoring signal should I expect at 633 nm at the end of each layer?"

Ready-made workflows (prompts) appear as / commands in Claude Code and in the attachment menu of Claude Desktop: design an antireflection coating, a mirror, an edge filter or dichroic, a narrow band-pass filter, and review a design for manufacturing. The design-format guide, the material list and the OpenFilters example projects are available as resources (openfilters://guide, openfilters://materials, openfilters://examples/<name>). Long optimizations and yield analyses report progress to apps that show it.

Installation

Requires Python ≥ 3.10. OpenFilters itself does not need to be installed: its calculation engine is built in (the OpenFilters GUI is only useful to open the .ofp files).

Claude Desktop extension (one click)

From the latest release, download mcp-for-openfilters-<version>.mcpb and open it (or drag it onto Claude Desktop's Settings → Extensions). Claude Desktop runs it with uv, which fetches the server from PyPI.

Claude Code plugin

In Claude Code:

text
/plugin marketplace add BBrunoEsteves/mcp-for-openfilters/plugin install mcp-for-openfilters@mcp-for-openfilters

The plugin runs the server with uvx (see claude-plugin/README.md for what it runs and downloads).

With uv (one command)

With uv installed, the server runs straight from PyPI, with the right package for your computer chosen automatically:

bash
claude mcp add --scope user mcp-for-openfilters -- uvx mcp-for-openfilters

For Claude Desktop, add to claude_desktop_config.json (Settings → Developer → Edit config), then fully quit and reopen Claude Desktop:

json
{"mcpServers": {"mcp-for-openfilters": {"command": "uvx", "args": ["mcp-for-openfilters"]}}}

uvx keeps its own cached environment; uvx mcp-for-openfilters@latest picks up a new version.

With the installer

From the release page, download install_mcp_for_openfilters.py and the package for your computer (or all .whl files) into one folder, then:

bash
python install_mcp_for_openfilters.py

It creates a private environment in ~/.mcp-for-openfilters, installs the package, registers the server in Claude Desktop (backing up its settings) and Claude Code, and runs a self-test. Then fully quit and reopen Claude Desktop. --uninstall removes it; --from-github downloads the packages with the GitHub CLI.

Packages are built for Windows (64-bit), Linux (x86-64) and macOS (Apple Silicon), Python 3.10–3.14, with the compiled fast core included: no compiler needed.

Manually

bash
pip install mcp_for_openfilters-<version>-<python>-<platform>.whlclaude mcp add --scope user mcp-for-openfilters -- mcp-for-openfilters

For Claude Desktop, add to claude_desktop_config.json (Settings → Developer → Edit config):

json
{"mcpServers": {"mcp-for-openfilters": {"command": "<full path to mcp-for-openfilters>"}}}

Upgrading from openfilters-mcp (before 0.2.0)

The project was called openfilters-mcp until version 0.2.0. Fully quit Claude Desktop and Claude Code, then run the new installer: it removes the old openfilters registration and the old private environment (~/.openfilters-mcp) and registers mcp-for-openfilters. Your data folder ~/OpenFilters-MCP is kept and still used, and the old OPENFILTERS_MCP_* environment variables are still read. After a manual install, pip uninstall openfilters-mcp and replace the openfilters entry in your Claude settings.

From source (development)

bash
git clone https://github.com/BBrunoEsteves/mcp-for-openfilterscd mcp-for-openfilterspython -m venv .venv.venv/Scripts/pip install -e ".[dev]"      # .venv/bin/pip on macOS/Linuxpython dev/fetch_compiled.py               # fast C++ core compiled by GitHub Actions (or build it locally)

Configuration

Environment variableDefaultMeaning
MCP_FOR_OPENFILTERS_HOME~/MCP-for-OpenFiltersdata folder: materials/, jobs/, projects/, outputs/
MCP_FOR_OPENFILTERS_WORKERSCPU count − 1parallel worker processes for jobs

The names used before 0.2.0 (OPENFILTERS_MCP_HOME, OPENFILTERS_MCP_WORKERS) still work, and an existing ~/OpenFilters-MCP folder is used when ~/MCP-for-OpenFilters does not exist.

Conventions

  • wavelengths and thicknesses in nm, angles in degrees, R/T/A as fractions (0–1);
  • complex index N = n − ik (k ≥ 0 absorbs), as in OpenFilters and Macleod;
  • layers are listed from the substrate outward;
  • the merit function is OpenFilters' χ² = Σ ((target − value)/tolerance)², with satisfied inequality targets contributing zero.

A design:

json
{"substrate": "FusedSilica", "incident_medium": "void", "center_wavelength": 550, "layers": [{"material": "TiO2", "thickness": 58.6}, {"material": "SiO2", "qwot": 1}]}

or with a stack formula: {"formula": {"formula": "(HL)^8 H", "materials": {"H": "TiO2", "L": "SiO2"}}}.

Materials given as n,k tables have no data outside their wavelength range. There the design field "table_extrapolation" decides: "hold" (default: n,k stay at the value at the nearest end of the data), "openfilters" (OpenFilters' own extrapolation, identical to its GUI) or "refuse". Every result computed outside the data says so, with the n,k used and what the other choice would give; optimizations, campaigns and yield analyses do not start until the choice is made (Claude asks you).

A target:

json
{"kind": "R", "from": 1000, "to": 1100, "step": 5, "value": 0.99, "tolerance": 0.005, "inequality": ">=", "angle": 0, "polarization": "unpolarized"}

Validation

The test suite (pytest) checks the ported core against analytic results (quarter-wave stacks) and an independent transfer-matrix implementation (dispersive dielectrics, absorbing metals, 0–60°, s/p/unpolarized; agreement < 1e-9) and textbook closed forms (quarter-wave antireflection and absentee layers, V-coat zero, Brewster angle, quarter-wave stack peak reflectance and stop-band width), round-trips every example project through .ofp files, and runs the refinement and needle optimizations of the OpenFilters examples.

How the port was made

src/openfilters_core is generated from the original OpenFilters 1.1.1 sources by tools/port_from_py2.py, an auditable script (mechanical Python 2 → 3 conversions, a short list of targeted fixes, package-relative imports). The _abeles C++ extension uses the Python 3 C-API port by Emil Kleijn; _moremath is ported by the same script. See src/openfilters_core/PROVENANCE.md.

Privacy

Everything runs on your computer: no data is sent anywhere and there is no telemetry. The only network access is downloading public refractiveindex.info data when you ask for it. See PRIVACY.md.

Citing

If you use this in published work, please cite OpenFilters:

S. Larouche and L. Martinu, "OpenFilters: open-source software for the design, optimization, and synthesis of optical filters," Applied Optics 47, C219–C230 (2008).

Contact

  • Bug reports and feature requests: GitHub Issues (please include the output of the server_info tool).
  • Collaboration and other questions: Bruno Esteves, Center for MicroElectroMechanical Systems (CMEMS), University of Minho: [email protected].

License

GPL-2.0-or-later, like OpenFilters. OpenFilters is © Stéphane Larouche; this project is not affiliated with or endorsed by its authors or Polytechnique Montréal.

來源:README.md,提交 df760da

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.2.2最新Nov 7, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分