- Source code lives in
src/. Entry point:src/server/roam-server.ts(bundled tobuild/). - CLI binary builds to
build/index.js(seebininpackage.json). - MCP tools and schemas live under
src/tools/(e.g.,src/tools/operations/*,src/tools/helpers/*). - Configuration helpers:
src/config/environment.tsandsrc/utils/*. - Documentation at repo root:
README.md,Functionality.md,Manifest.md,CHANGELOG.md.
npm install— install dependencies.npm run build— TypeScript compile tobuild/and set executable bit forbuild/index.js.npm run watch— compile on change (use during development).- Run server (after build):
node build/index.jsornpm run inspectorto launch MCP Inspector.
- TypeScript, 2‑space indentation, no trailing semicolons preference left to contributor (stay consistent with nearby code).
- Filenames: kebab-case (e.g.,
hierarchy-search.ts). Types/interfaces: PascalCase. Functions/variables: camelCase. Constants: UPPER_SNAKE_CASE. - Prefer named exports from modules. Keep modules focused; colocate types in
types/when shared. - Add JSDoc for public functions and all MCP tool handlers (inputs/outputs).
- There are no automated tests today. If adding tests, prefer lightweight unit tests (Vitest/Jest) colocated in
src/**/__tests__/with*.test.tsnaming. - Keep tests deterministic; mock network and Roam API calls.
- Use Conventional Commits when possible:
feat:,fix:,chore:,docs:,refactor:, etc. Keep subjects in present tense and under 72 chars. - PRs should include: purpose/summary, notable changes, any breaking behaviors, and basic verification steps. Link related issues. Screenshots or examples are welcome for user‑visible changes.
- Keep PRs small and focused; update
README.mdandFunctionality.mdwhen adding or changing MCP tools.
- Configure credentials via environment variables (loaded with
dotenv). Add a local.env; never commit secrets. Seesrc/config/environment.tsfor expected keys. - Rate limiting is handled in
src/utils/rate-limiter.ts; avoid ad‑hoc sleeps and reuse helpers.
- When introducing new MCP tools, place handlers in
src/tools/operations/<tool-name>/, define schemas insrc/tools/schemas.tsor a dedicated file, export viasrc/tools/tool-handlers.ts, and document the tool inREADME.mdandFunctionality.md.