This document is the practical reference for running, validating, and troubleshooting Protocol Forge during development.
- Node.js 22+
- pnpm 10+
- macOS, Linux, or Windows development environment
pnpm installpnpm devThis starts Electron main/preload/renderer with hot reload.
pnpm dev: start local development mode.pnpm start: preview built app.pnpm lint: run ESLint.pnpm typecheck: run TypeScript checks for node + web targets.pnpm test --run: run Vitest once.pnpm build: typecheck + production build through electron-vite.pnpm build:unpack: create unpacked distributable output.pnpm build:mac|win|linux: produce platform installers/packages.
Run these after code or config changes:
pnpm lint
pnpm typecheck
pnpm test --runRun build checks when packaging/runtime wiring is impacted:
pnpm build- Unit tests cover stores, transport factory/transports, session lifecycle, and repository/session messaging behavior.
- Prefer adding targeted tests for touched modules, then run full suite.
src/main: Electron main process, IPC handlers, session manager, persistence.src/preload: typed bridge exposed to renderer.src/renderer/src: React app, Zustand stores, UI components.src/shared: shared types/constants/errors and IPC contracts.tests: Vitest unit tests.context: project planning, status, and architecture decisions.
- Storage engine: SQLite (
better-sqlite3) in WAL mode with foreign keys enabled. - Database file:
protocol-forge.dbin ElectronuserDatadirectory. - Primary tables:
server_profiles,sessions,messages.
Configure a profile with transport stdio.
Example command:
command: npx
args: @modelcontextprotocol/server-everything
Configure a profile with transport streamable-http and set url. Legacy
sse profiles in existing databases are automatically migrated to
streamable-http on launch by migration 0002_migrate_legacy_sse_profiles.
- For
stdio, validate command/args/cwd and run the command manually from the same directory. Stdio child processes inherit only the MCP SDK's default env allowlist — if your server needs other host vars (NODE_PATH,PYTHONPATH, etc.), add them to the profile's env field. - For
streamable-http, verify endpoint URL, scheme (http/https), and required headers. - Profile input is now strict: labeled tokens like
command:andargs:are treated as literal input.
- Confirm session is
ready. - Check protocol inspector for inbound/outbound message shape and MCP error payloads.
If native binaries are mismatched:
pnpm rebuild:nativeThen re-run:
pnpm typecheck
pnpm test --run- Native dependency build errors: run
pnpm installagain and ensure your system toolchain is available. - Session connect failures: verify command/url and inspect protocol errors in the inspector.
- Empty discovery lists: ensure session state is
readybefore listing tools/resources/prompts. - If a profile still fails after edits, re-save it once to ensure current validation rules are applied.
- Treat all renderer inputs and server responses as untrusted.
- Main-process handlers should throw actionable errors for renderer display.
- Prefer stable fallback UI over hard crashes (toasts + error boundaries).
Releases are cut by pushing a v*.*.* tag. The release.yml workflow builds
mac, Windows, and Linux artifacts in parallel and uploads them to a draft
GitHub release (via electron-builder --publish always).
Run the same gates CI runs, so a failing build isn't discovered on a tag push:
pnpm lint
pnpm typecheck
pnpm test
pnpm buildManually sanity-check a packaged build on at least one platform:
pnpm build:mac # or :win / :linuxLaunch the packaged app, create a stdio profile, connect, list tools, invoke one, and watch the Protocol Inspector stream.
- Bump
versioninpackage.jsonandAPP_VERSIONinsrc/shared/constants.ts(keep these in sync). - Move the
CHANGELOG.mdentry's date to the intended release day. - Commit:
chore(release): bump to vX.Y.Z. - Tag and push:
git tag vX.Y.Z git push origin main vX.Y.Z
- Wait for the Release workflow to finish. A draft release with five artifacts
(mac dmg + zip, win nsis, linux AppImage + deb) and the
latest*.ymlupdate manifests will appear under Releases. Do not publish the draft until all three matrix jobs have completed — electron-builder refuses to upload to an already-published (non-draft) release, so publishing early will break any job that hasn't finished yet. - Install and smoke-test the draft artifacts on each target OS. Verify the Gatekeeper / SmartScreen first-launch paths documented in the README.
- Edit the draft release notes (summarize from
CHANGELOG.md) and publish.
Use vX.Y.Z-rc.N tags to produce draft releases without touching the
canonical tag — the tag pattern matches. Delete the draft release afterwards.