apps/brave-search-mcp/hosts the MCP server package. Server entry points live insrc/, with tool implementations insrc/tools/. UI assets and build inputs live underui/, and build output goes todist/.packages/brave-search/is the shared Brave Search SDK (typed API wrapper) withsrc/sources anddist/output.docs/andscripts/contain repo documentation and utility scripts.- Monorepo wiring lives in
pnpm-workspace.yamlandturbo.json.
Run commands from the repo root unless noted.
pnpm installinstalls workspace dependencies.pnpm run devruns package dev tasks via Turbo.pnpm run buildbuilds all packages via Turbo.pnpm run lintruns ESLint with auto-fix.pnpm run checkruns lint (no fix) and TypeScript checks.pnpm run testruns the app workspace's default Vitest suite from the repo root.pnpm run cleanremoves build outputs.pnpm -C apps/brave-search-mcp buildbuilds only the MCP server package.BRAVE_API_KEY=... npx -y brave-search-mcp --httpruns the server locally in HTTP mode.
- TypeScript + ESM across packages.
- ESLint uses
@antfu/eslint-configwith 2-space indentation, semicolons, and single quotes. - Match existing naming patterns in each folder (e.g., PascalCase tool classes under
src/tools/).
- The repo's canonical automated test command is
pnpm run test. - Use
pnpm run checkandpnpm run testbefore opening a PR; add tests alongside new features if you introduce a framework.
- Recent commits use short, imperative, sentence-case summaries (e.g., “Fix query spacing”).
- Keep commits focused; prefer one logical change per commit.
- PRs should include: a clear description, rationale, and any manual test notes (commands or steps).
- If user-facing behavior changes, add a Changeset before release (
pnpm changeset).
- The server requires
BRAVE_API_KEYat runtime; avoid committing real keys. - Default HTTP mode runs on port 3001; override with
PORTwhen needed.