src/: TypeScript source. Entry issrc/mcpli.ts; daemon code insrc/daemon/(runtime, IPC, wrapper); config insrc/config.ts; utilities insrc/utils/.tests/: Vitest specs split byunit/,integration/, ande2e/. Test helpers intests/test-helper.ts.dist/: Build output (mcpli.js,daemon/wrapper.js). Do not edit manually.scripts/: Maintenance scripts (release.sh,test-regression.sh).- Sample MCP servers for local testing:
weather-server.js,test-server.js,complex-test-server.js.
npm run build: Bundle with tsup (targets Node 22). Outputs todist/and sets execute bits.npm run dev: Convenience rebuild (same as build) for iterative work.npm run typecheck: TypeScript checks without emit.npm run lint|npm run lint:fix: Lint (ESLint) and optionally fix.npm test: Run all tests (Vitest). Variants:test:unit,test:integration,test:e2e,coverage.- Local CLI example:
./dist/mcpli.js --help -- node weather-server.js.
- Formatting: Prettier (2‑space indent, single quotes, semicolons, trailing commas, width 100). Check with
npm run format:check; write withnpm run format. - Linting: ESLint + TypeScript ESLint. In
src/, avoidany, prefer explicit return types, and do not import*.jsfrom TS (no-restricted-imports). - File names: use
kebab-casefor files,PascalCasefor types/classes,camelCasefor variables/functions.
- Framework: Vitest with Node environment; coverage via V8 (
text,html,lcov). - Location/patterns:
tests/**/**/*.test.ts. Keep fast unit tests undertests/unitand heavier flows underintegration/e2e. - Isolation: use helpers in
tests/test-helper.ts(temp dirs, daemon polling) for stable daemon tests.
- Use Conventional Commits (
feat:,fix:,docs:,refactor:,test:,chore:). Example:feat: add daemon status subcommand. - PRs: include a clear description, linked issues (
closes #123), test instructions, and updateCHANGELOG.mdwhen user-facing. - Pre‑merge checklist:
npm run build,npm run typecheck,npm run lint, and passing tests.
- Runtime: Node ≥ 22 (see
package.json engines). - Daemon logs: inspect
.mcpli/daemon.log; avoid committing.mcpli/artifacts. - When passing env to servers, prefer simple
KEY=valuepairs; unsafe keys (e.g.,__proto__) are rejected by design.