sub-agent-mcp-setup

sub-agent-mcp-setup is a cursor rule for Cursor from ohah/electron-mcp-server. It costs 32 tokens per session (1,443 once invoked), scanned C, original, MIT.

A troubleshooting guide for installing and connecting an Electron MCP server in a Bun monorepo, a project that stores several related packages together.

In plain words
What is it for?
Use it to diagnose Bun workspace setup, npx commands, generated .bin links, build paths, and Cursor MCP configuration.
Why use it?
It helps explain command failures caused by package links, executable paths, or mismatched build locations.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/ohah/electron-mcp-server/sub-agent-mcp-setup
Clone the repo
git clone --depth 1 https://github.com/ohah/electron-mcp-server

Made for: Cursor.

Per session 32 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,443 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00032 $0.01443
Opus 5 $0.00016 $0.00722
Sonnet 5 $0.00006 $0.00289
Haiku 4.5 $0.00003 $0.00144

Measured 3d ago against content hash fce55414ed2d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

sub-agent-mcp-setup scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

| `Cannot find module '.../dist/mcp-server/index.js'` | 3.1 적용 후에도 난다면 `npx clear-npx-cache` → 그래도 안 되면 `rm -rf node_modules && bun install` |
.cursor/agents/sub-agent-mcp-setup.mdc · 80 lines

How it starts

The opening of the file, as written. The whole thing — 80 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Electron MCP 서버 세팅 전문가 (Setup Expert)

이 룰은 electron-mcp-server를 Bun 모노레포에서 설치·실행·Cursor MCP 연동할 때 발생하는 문제(심링크, npx, .bin, 잘못된 경로)를 진단하고 해결할 때 적용한다.

1. 프로젝트 구조 (Bun 모노레포)

  • 루트: package.json(workspaces: packages/*, examples/*), bun.lock만 사용. package-lock.json은 사용하지 않는다 (Bun 전용).
  • MCP 서버: packages/electron-mcp-server — Node 전용 프로세스, 빌드 결과는 dist/index.js (bunup).
  • Electron 데모: examples/electron-mcp-demo--remote-debugging-port=9222로 실행해 MCP 도구가 타깃으로 쓴다.
  • Cursor MCP 설정: .cursor/mcp.json에서 npx -y electron-mcp-server로 실행.

2. 왜 "electron-mcp-server를 찾을 수 없음" / "Cannot find module ... dist/mcp-server/index.js" 가 나오는가

2.1 워크스페이스 패키지는 루트 .bin에 없음

  • Bun(또는 npm) 워크스페이스에서 루트 package.json에 dependency로 넣지 않은 패키지는 node_modules/.bin/<bin-name>생성되지 않는다.
  • npx -y electron-mcp-server 는 (로컬이면) node_modules/.bin/electron-mcp-server 또는 node_modules/electron-mcp-server 의 bin을 실행한다. .bin에 실행 파일이 없으면 Windows에서는 "인식할 수 없는 명령"이 나올 수 있다.

2.2 잘못된 bin 경로 (dist/mcp-server/index.js)

  • 과거에 packages/electron-mcp-server/package.json 의 bin이 dist/mcp-server/index.js 였다가 dist/index.js 로 바뀐 경우, 이미 만들어진 node_modules/.bin/electron-mcp-server.bunx(또는 .exe) 안에는 예전 경로가 하드코딩되어 있을 수 있다.
  • package-lock.json이 있으면 그 안의 packages/electron-mcp-server bin 경로가 예전 값(dist/mcp-server/index.js)으로 남아 있고, npm/npx가 이를 참조해 잘못된 경로를 쓸 수 있다.
  • npx 캐시에 예전 실행 경로가 남아 있으면, 캐시만으로도 같은 오류가 반복될 수 있다.

3. 해결 방법 (체크리스트)

3.1 루트에서 electron-mcp-server를 dependency로 두기

  • 목적: 루트 node_modules/.binelectron-mcp-server 실행 파일이 생기게 하여 npx -y electron-mcp-server 가 동작하게 한다.
  • 조치: 루트 package.jsondevDependencies 에 추가.
    "devDependencies": {
      "electron-mcp-server": "workspace:*",
      ...
    }
    
  • 그 다음 bun install 실행. 이제 node_modules/.bin/electron-mcp-server.bunx(및 .exe)가 생성되고, 내부 경로는 현재 packages/electron-mcp-server/package.json 의 bin(dist/index.js)을 가리킨다.

3.2 Bun 전용 유지 — package-lock.json 제거

Read the full file on GitHub · 80 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 80 lines · 32 tokens per session scan C fce55414ed2d

Subscribe to this mod's changes

sub-agent-mcp-setup is a cursor rule published in the GitHub repository ohah/electron-mcp-server (4 stars, last pushed 5mo ago), licensed MIT. It adds 32 tokens to every session and 1,443 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.