Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
204 changes: 204 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
name: Release

on:
push:
tags: ['v*']
workflow_dispatch:

concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false

permissions:
contents: read

jobs:
source:
name: Validate release tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
fetch-depth: 0
- name: Require a version tag on main
env:
RELEASE_TAG: ${{ github.ref_name }}
REF_TYPE: ${{ github.ref_type }}
run: |
test "$REF_TYPE" = tag
node --input-type=module -e '
import {readFileSync} from "node:fs";
const {version} = JSON.parse(readFileSync("package.json"));
if (!/^\d+\.\d+\.\d+$/.test(version) || process.env.RELEASE_TAG !== "v" + version) throw new Error("Tag must match package.json version");'
git merge-base --is-ancestor HEAD origin/main

windows:
name: Windows signed installer and portable app
needs: source
runs-on: windows-latest
environment: release
timeout-minutes: 35
permissions:
contents: read
id-token: write
env:
ELECTROSCOPE_ARTIFACT_SIGNING_ENDPOINT: ${{ vars.WINDOWS_ARTIFACT_SIGNING_ENDPOINT }}
ELECTROSCOPE_ARTIFACT_SIGNING_ACCOUNT: ${{ vars.WINDOWS_ARTIFACT_SIGNING_ACCOUNT }}
ELECTROSCOPE_ARTIFACT_SIGNING_PROFILE: ${{ vars.WINDOWS_ARTIFACT_SIGNING_PROFILE }}
WINDOWS_SIGNER_EKU: ${{ vars.WINDOWS_SIGNER_EKU }}
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 24
cache: npm
- run: npm ci
- run: npm run typecheck
- run: npm test
- run: npm run build
- uses: azure/login@935127ca5bb3c4b02c9c2c10060028383878f33f # v3
with:
client-id: ${{ vars.AZURE_CLIENT_ID }}
tenant-id: ${{ vars.AZURE_TENANT_ID }}
subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
- uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4
with:
dotnet-version: '8.0.x'
- name: Prepare pinned signing client
shell: pwsh
run: ./scripts/prepare-windows-signing.ps1 -DestinationDirectory (Join-Path $env:RUNNER_TEMP 'electroscope-signing')
- name: Package and sign
run: npx electron-builder --win --x64 --publish never --config build/release.win.cjs
- name: Verify final packages and install
shell: pwsh
run: |
./scripts/verify-windows-signature.ps1 release/Electroscope-Windows-x64-Setup.exe
./scripts/verify-windows-signature.ps1 release/Electroscope-Windows-x64-Portable.exe
$install = Join-Path $env:RUNNER_TEMP 'ElectroscopeInstalled'
$setup = Start-Process release/Electroscope-Windows-x64-Setup.exe -ArgumentList @('/S', "/D=$install") -Wait -PassThru
if ($setup.ExitCode -ne 0) { throw "Installer exited $($setup.ExitCode)" }
$env:ELECTROSCOPE_EXE = Join-Path $install 'Electroscope.exe'
./scripts/verify-windows-signature.ps1 $env:ELECTROSCOPE_EXE
node scripts/e2e.mjs --fake
if ($LASTEXITCODE -ne 0) { throw 'Installed Windows app failed end-to-end checks.' }
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: release-windows
if-no-files-found: error
path: |
release/Electroscope-Windows-x64-Setup.exe
release/Electroscope-Windows-x64-Portable.exe
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: always()
with:
name: windows-release-tests
path: test-output/fake/

mac:
name: macOS signed and notarized app
needs: source
runs-on: macos-15
environment: release
timeout-minutes: 45
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 24
cache: npm
- run: npm ci
- run: npm run typecheck
- run: npm test
- run: npm run build
- name: Load notarization key
env:
API_KEY: ${{ secrets.APPLE_API_KEY }}
run: |
umask 077
test -n "$API_KEY"
printf '%s' "$API_KEY" > "$RUNNER_TEMP/notary.p8"
- name: Sign, notarize, and package
env:
CSC_LINK: ${{ secrets.MAC_CERTIFICATE_P12 }}
CSC_KEY_PASSWORD: ${{ secrets.MAC_CERTIFICATE_PASSWORD }}
APPLE_API_KEY: ${{ runner.temp }}/notary.p8
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
run: npx electron-builder --mac --arm64 --publish never --config build/release.mac.cjs
- name: Verify and test the distributable ZIP
run: |
ditto -x -k release/Electroscope-macOS-arm64.zip "$RUNNER_TEMP/zip-test"
app="$RUNNER_TEMP/zip-test/Electroscope.app"
codesign --verify --strict --deep "$app"
codesign -dv --verbose=4 "$app" 2>&1 | grep -F 'Authority=Developer ID Application: UnlikeOtherAI s.r.o. (23B7GTLBN7)'
xcrun stapler validate "$app"
spctl --assess --type execute --verbose=4 "$app"
ELECTROSCOPE_EXE="$app/Contents/MacOS/Electroscope" node scripts/e2e.mjs --fake
- name: Verify the DMG
run: |
hdiutil attach -nobrowse -readonly -plist release/Electroscope-macOS-arm64.dmg > "$RUNNER_TEMP/dmg-mount.plist"
volume="$(python3 -c 'import plistlib,sys; p=plistlib.load(open(sys.argv[1], "rb")); print(next(e["mount-point"] for e in p["system-entities"] if e.get("mount-point")))' "$RUNNER_TEMP/dmg-mount.plist")"
trap 'hdiutil detach "$volume"' EXIT
app="$volume/Electroscope.app"
codesign --verify --strict --deep "$app"
xcrun stapler validate "$app"
spctl --assess --type execute --verbose=4 "$app"
- name: Remove temporary notarization key
if: always()
run: rm -f "$RUNNER_TEMP/notary.p8"
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: release-mac
if-no-files-found: error
path: |
release/Electroscope-macOS-arm64.dmg
release/Electroscope-macOS-arm64.zip
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: always()
with:
name: mac-release-tests
path: test-output/fake/

publish:
name: Publish verified downloads
needs: [windows, mac]
runs-on: ubuntu-latest
timeout-minutes: 15
environment: release
permissions:
contents: write
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
pattern: release-*
merge-multiple: true
path: artifacts
- name: Require every platform and create checksums
run: node scripts/release-assets.mjs artifacts
- name: Stage and publish the release
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ github.ref_name }}
run: |
set -euo pipefail
if gh release view "$RELEASE_TAG" --json isDraft > "$RUNNER_TEMP/release.json" 2>/dev/null; then
node -e 'if (!require(process.argv[1]).isDraft) throw new Error("Refusing to overwrite a published release")' "$RUNNER_TEMP/release.json"
else
gh release create "$RELEASE_TAG" --draft --verify-tag --title "Electroscope $RELEASE_TAG" --notes-file docs/release-notes.md
fi
gh release upload "$RELEASE_TAG" artifacts/* --clobber
gh release edit "$RELEASE_TAG" --draft=false --latest
- name: Verify public downloads without authentication
env:
REPOSITORY: ${{ github.repository }}
RELEASE_TAG: ${{ github.ref_name }}
run: |
set -euo pipefail
mkdir downloaded
cd downloaded
base="https://github.com/$REPOSITORY/releases/download/$RELEASE_TAG"
for file in SHA256SUMS.txt Electroscope-Windows-x64-Setup.exe Electroscope-Windows-x64-Portable.exe Electroscope-macOS-arm64.dmg Electroscope-macOS-arm64.zip; do
curl --fail --location --retry 3 --max-time 300 --output "$file" "$base/$file"
done
sha256sum --check --strict SHA256SUMS.txt
102 changes: 48 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,83 +1,77 @@
# Electroscope
<p align="center"><img src="build/icon-256.png" alt="Electroscope" width="112" /></p>

<p align="center"><img src="build/icon-256.png" alt="Electroscope icon" width="128" /></p>
<h1 align="center">Electroscope</h1>
<p align="center"><strong>Give Claude, Codex, and other agents eyes on your electronics.</strong></p>
<p align="center">See the same board. Point to the same pin. Work through the next measurement together.</p>

A microscope camera as an MCP server. You watch the live view in a native window; any AI agent on your network can look through the same camera, zoom, focus, and draw on the picture.
<p align="center">
<a href="https://github.com/UnlikeOtherAI/Electroscope/releases/latest/download/Electroscope-Windows-x64-Setup.exe"><img alt="Download for Windows x64" src="https://img.shields.io/badge/Download_for_Windows-x64-0078D4?style=for-the-badge&amp;logo=windows&amp;logoColor=white" /></a>
<a href="https://github.com/UnlikeOtherAI/Electroscope/releases/latest/download/Electroscope-macOS-arm64.dmg"><img alt="Download for Mac Apple Silicon" src="https://img.shields.io/badge/Download_for_Mac-Apple_Silicon-222222?style=for-the-badge&amp;logo=apple&amp;logoColor=white" /></a>
</p>
<p align="center">
<a href="https://github.com/UnlikeOtherAI/Electroscope/releases/latest/download/Electroscope-Windows-x64-Portable.exe">Windows portable</a> ·
<a href="https://github.com/UnlikeOtherAI/Electroscope/releases/latest/download/Electroscope-macOS-arm64.zip">Mac ZIP</a> ·
<a href="https://github.com/UnlikeOtherAI/Electroscope/releases">All releases</a>
</p>
<p align="center">Windows 11 x64 · macOS on Apple Silicon · Free and open source</p>

A camera can usually be opened by one app at a time, so you cannot watch the microscope and also hand a stream to an agent. Electroscope owns the camera, shows it to you, and gives agents still frames and full control over MCP, without interrupting your view.
Electroscope connects your USB microscope to an agent that supports **MCP**, including Claude Code and Codex. You keep a live view of the board while the agent takes snapshots, inspects close-ups, and draws marks on the picture.

![Electroscope with an agent's marks on a board](docs/screenshot.png)
Instead of “the little component on the left,” your agent can circle the component, put a crosshair on a test point, or draw an arrow to the pin it wants you to probe. You can draw back to show exactly where you measured. You handle the probes and measurements; Electroscope makes the visual conversation precise.

## Use it
![Electroscope on Windows, showing a real circuit board with example circles, arrows, crosshairs, and labels](docs/screenshot.png)

Run the app. The title bar shows the address it serves on, for example `http://192.168.1.165:7821/mcp`. Click **Copy prompt for agent** and paste it into Claude Code, Codex, or any agent. The prompt has the IP, the port, how to connect, and every tool.
*Example marks on a real microscope image. Both you and the agent can add annotations to the same view.*

Or connect directly:
## A second pair of eyes at your bench

```bash
claude mcp add --transport http electroscope http://<ip>:7821/mcp
```

Then ask: "Look at the board and circle anything that looks like a solder bridge."

## What an agent can do
- **Inspect together.** Ask the agent to look at solder joints, read visible markings, or compare a detail before and after rework.
- **Make the next probe location clear.** Circles, arrows, crosshairs, boxes, and text turn “measure here” into a specific place on the board.
- **Keep the detail.** The agent can request a full-resolution crop, follow your zoomed view, or take a sequence of stills.
- **Stay in control.** Zoom, pan, rotate, mirror, freeze, add a grid, draw your own marks, and save photos while the camera stays open.
- **Work across your bench.** Run the microscope on one computer and connect an agent from another computer on the same trusted network.

- **Look**: `capture_snapshot` (full frame or a full-resolution close-up of any region, or exactly what you have zoomed to), `capture_sequence` for things that change, with focus, brightness and exposure metrics and plain-language hints.
- **Point**: `annotate` draws circles, crosshairs, rectangles, arrows and text in any colour on your live view. Marks stay on their feature when you zoom. `clear_annotations` removes them.
- **Control**: `set_camera_controls` (focus, zoom, exposure and so on, only where the camera really obeys), `set_orientation`, `set_view` (zoom, pan, grid and crosshair with colours, freeze), `select_camera`, `list_cameras`, `save_photo`.
![Electroscope on macOS, zoomed into a circuit board with a grid and crosshair](docs/images/microscope-zoom.png)

Full reference: [docs/mcp.md](docs/mcp.md).
*Zoom into the detail you are discussing. The agent can capture that same region without losing the original camera pixels.*

## What you can do in the window
## Get started

Zoom and pan, grid and crosshair overlays, freeze, rotate and mirror, pick a resolution, save a full-resolution photo, and draw your own circles, crosshairs, rectangles, arrows and text in a colour you pick. **Clear all** removes every mark; Ctrl+Z removes the last one. A live sharpness meter helps you find best focus.
1. **Install Electroscope** using a download above. On Mac, open the DMG and drag Electroscope into Applications. On Windows, run the installer or use the portable app.
2. **Plug in your USB microscope** and open Electroscope. Allow camera access and select the microscope in the camera list.
3. **Click “Copy prompt for agent.”** Paste it into Claude Code, Codex, or another MCP-capable agent. It contains your camera server’s address, connection instructions, and available tools.
4. **Start looking at the board together.** Ask for a fresh image, describe the fault, and share your measurements as you go.

Camera sliders appear only for controls the camera actually obeys. Many inexpensive UVC cameras accept brightness, contrast and sharpness settings and ignore them; Electroscope tests each control when the camera opens and hides the ones that do nothing.
Try a prompt like:

## Security
> Look at this board. Circle any solder joints worth inspecting more closely, and explain what you see.

The server has no password. It listens on your network by default so agents on other computers can reach it, which means anyone who can reach the port can look through the camera and control it. Use it on a network you trust, or turn off **Let other computers on the network connect** in Settings to listen on this computer only. Requests that name any host other than an IP address or this computer's own name are refused, which blocks DNS-rebinding attacks from web pages.
> Mark the pin you mean before I put the probe on it.

On Windows, the first run shows a firewall prompt; allow it on private networks for other computers to connect.
> I measured 3.3 V at the point I marked. Take another look and suggest the next measurement.

## Install
Your agent’s own service or subscription still applies; Electroscope needs no account. It shares still images on request while you watch the live camera view.

Windows 11 and macOS. Download a build from the releases page, or run from source:
## Connect your agent

```bash
git clone https://github.com/UnlikeOtherAI/Electroscope.git
cd Electroscope
npm install
npm start
```

Build a package:
**Copy prompt for agent** is the quickest way to get the correct address. For Claude Code, you can also add the server directly:

```bash
npm run dist:win # Windows installer and portable exe, in release/
npm run dist:mac # macOS dmg and zip, in release/ (run on a Mac)
```sh
claude mcp add --transport http electroscope http://<microscope-computer-ip>:7821/mcp
```

For a signed, notarized Mac package and physical-microscope verification, see [the macOS release guide](docs/macos-release.md).
For Codex or another MCP client, add the **Streamable HTTP MCP URL** shown in Electroscope’s title bar. Use the displayed URL: the port can change if the default is busy.

If the app says the camera is busy, another program has it. Close the Camera app, Teams, or a browser tab using the camera; Electroscope keeps retrying and connects as soon as it is free.
Agents can take snapshots and sequences, annotate the image, adjust the on-screen view, choose a camera, save photos, and change hardware controls where the camera supports them. [Read the full tool reference →](docs/mcp.md)

## Develop
## Your camera, your network

```bash
npm run typecheck
npm test # unit tests: tools, transport safety, addresses, prompt, annotations
npm run test:e2e # launches the app and drives it over MCP with your real camera
node scripts/e2e.mjs --fake # same, with Chromium's synthetic camera (what CI runs)
npm run icons # re-render build/icon.* from build/icon.svg
```
Electroscope serves the camera from your computer. Network access is on by default and has no password, so use it on a trusted network. To keep access on the same computer, turn off **Let other computers on the network connect** in Settings.

The end-to-end script drives the real app as an agent would, checks that marks land on the right pixels, and writes screenshots and every captured image to `test-output/`.
If another app has the microscope open, close that app; Electroscope retries automatically. Camera sliders appear only for controls the camera actually responds to. Use the microscope’s physical focus ring when it has no software focus control.

- `src/main`: Electron main process and the MCP server (`mcp/tools.ts` defines the tools, `mcp/http.ts` is the Streamable HTTP transport).
- `src/renderer`: the window. It owns the camera, draws the live view and marks, and answers requests from the main process.
- `src/shared`: types, IPC channel names, and the agent prompt.
## Contribute

## License
Want to build from source, report a problem, or improve a tool? See the [development guide](docs/development.md), [release workflow](docs/releases.md), or [open an issue](https://github.com/UnlikeOtherAI/Electroscope/issues).

[MIT](LICENSE)
Made by [UnlikeOtherAI](https://unlikeotherai.com). [MIT licensed](LICENSE).
12 changes: 12 additions & 0 deletions build/release.mac.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { build } = require('../package.json');

module.exports = {
...build,
forceCodeSigning: true,
artifactName: 'Electroscope-macOS-arm64.${ext}',
mac: {
...build.mac,
identity: 'UnlikeOtherAI s.r.o. (23B7GTLBN7)',
notarize: true,
},
};
16 changes: 16 additions & 0 deletions build/release.win.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const { build } = require('../package.json');

module.exports = {
...build,
forceCodeSigning: true,
win: {
...build.win,
signtoolOptions: {
sign: 'scripts/sign-windows.cjs',
signingHashAlgorithms: ['sha256'],
publisherName: 'UnlikeOtherAI s.r.o.',
},
},
nsis: { ...build.nsis, artifactName: 'Electroscope-Windows-x64-Setup.${ext}' },
portable: { artifactName: 'Electroscope-Windows-x64-Portable.${ext}' },
};
Loading
Loading