# blender-optics-simulator

Connects a Blender optical bench simulation to coding agents over MCP. Useful for automated beam tracing, mirror alignment, and hardware layout.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 24
- Author: emircbngl
- License: GPL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/emircbngl/blender-optics-simulator
- Updated: 2026-09-24
- HTML: https://affpapa.org/en/nevibecode/mcp/blender-optics-simulator

## What it does

The server links Blender 4.2 LTS or 5.x to your AI assistant through a local JSON bridge. The simulation calculates ray paths, Gaussian propagation, polarization states, dispersion, and Fresnel losses. Users can place 35 component categories in 3D space, including lasers, waveplates, prisms, and sensors mounted on kinematic posts.

Instead of hallucinating coordinates, the agent inspects real scene geometry. Calling `get_state()` returns component poses, mechanical travel boundaries, and optical detector readouts. From there, the assistant adjusts kinematic knobs, steps mounts, and runs alignment routines directly.

A running Blender instance with the companion add-on is mandatory. If you do not activate the bridge under the integration panel inside Blender first, the MCP server fails to connect.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `OPTICS_BRIDGE_PORT`, `OPTICS_BRIDGE_HOST` — keys and tokens: ask the human for the values, never commit them or put them in shared files.
- Works with: Blender

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env OPTICS_BRIDGE_PORT=<OPTICS_BRIDGE_PORT> --env OPTICS_BRIDGE_HOST=<OPTICS_BRIDGE_HOST> --transport stdio blender-optics-simulator -- uvx blender-optics-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from blender-optics-mcp <command>

### Codex

**Platform CLI**
```bash
codex mcp add blender-optics-simulator --env OPTICS_BRIDGE_PORT=<OPTICS_BRIDGE_PORT> --env OPTICS_BRIDGE_HOST=<OPTICS_BRIDGE_HOST> -- uvx blender-optics-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from blender-optics-mcp <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "blender-optics-simulator": {
            "command": "uvx",
            "args": [
                "blender-optics-mcp"
            ],
            "env": {
                "OPTICS_BRIDGE_PORT": "<OPTICS_BRIDGE_PORT>",
                "OPTICS_BRIDGE_HOST": "<OPTICS_BRIDGE_HOST>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from blender-optics-mcp <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "blender-optics-simulator": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "blender-optics-mcp"
            ],
            "env": {
                "OPTICS_BRIDGE_PORT": "<OPTICS_BRIDGE_PORT>",
                "OPTICS_BRIDGE_HOST": "<OPTICS_BRIDGE_HOST>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from blender-optics-mcp <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e OPTICS_BRIDGE_PORT=<OPTICS_BRIDGE_PORT> -e OPTICS_BRIDGE_HOST=<OPTICS_BRIDGE_HOST> blender-optics-simulator uvx blender-optics-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from blender-optics-mcp <command>

## When to use it
- inspect beam paths and detector metrics directly from an agent
- automate kinematic mount adjustments to minimize pointing error
- lay out multi-element optical benches inside Blender
- test polarization, dispersion, and interference effects programmatically

## Example prompts
- Read the optical bench state from Blender and report the beam power at the detector.
- Adjust the kinematic mount on the first mirror to center the beam.
- Inspect the interferometer setup and check alignment residuals.

## Similar
- [Zotero MCP](https://affpapa.org/en/nevibecode/mcp/zotero-mcp.md) — MCP server · ★ 5548
- [arxiv-mcp-server](https://affpapa.org/en/nevibecode/mcp/arxiv-mcp-server.md) — MCP server · ★ 3231
- [PaperBanana](https://affpapa.org/en/nevibecode/mcp/paperbanana.md) — MCP server · ★ 2417
- [MATLAB MCP Server](https://affpapa.org/en/nevibecode/mcp/matlab-mcp-server.md) — MCP server · ★ 1716
- [Hex Research](https://affpapa.org/en/nevibecode/mcp/hex-research.md) — MCP server · ★ 583
- [DocsAgent — Zotero, Obsidian & Apple Notes MCP Server](https://affpapa.org/en/nevibecode/mcp/docsagent-zotero-obsidian-apple-notes-mcp-server.md) — MCP server · ★ 578

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
