MCP + LLM Code Review (limps)
Purpose
Perform a security-focused, test-minded code review with emphasis on MCP servers, LLM safety, and performance risks in this repository.
Scope
Use $ARGUMENTS as the scope (paths, diff range, PR number, or component name). If no scope is provided, review the current git diff.
Workflow
- Establish context
- Read
CLAUDE.md and relevant package docs.
- Identify the target package (
packages/limps or packages/limps-headless).
- Threat intel + dependency hygiene
- Search authoritative sources for new MCP/LLM or supply-chain issues:
- OWASP LLM Top 10, OWASP API Top 10, npm advisories, GitHub Security Advisories.
- Audit npm dependencies (use repo scripts when available):
npm audit --workspaces --include=prod
npm audit --workspaces --omit=dev (if prod-only is needed)
- Check for outdated or abandoned packages:
npm outdated --workspaces
- Inspect dependency tree for suspicious packages or name lookalikes:
npm ls --all --workspaces
- Verify lockfile integrity expectations:
- Prefer
npm ci for clean installs (verifies package-lock.json integrity).
- Enumerate change surface
- List changed files and inspect diffs before diving into code.
- Security-first review
- Validate input handling, path safety, and external command usage.
- Check for secret exposure (logs, errors, telemetry).
- MCP/LLM safety review
- Review tool schemas, argument validation, and permission boundaries.
- Identify prompt injection vectors and untrusted content handling.
- Correctness and reliability
- Look for logic errors, race conditions, and edge cases.
- Performance and cost
- Identify expensive operations, redundant work, or unbounded processing.
- Tests
- Confirm coverage for new behavior and regression risk areas.
Repo-Specific Risk Areas
Focus extra scrutiny on:
packages/limps/src/server.ts, src/tools/*, src/resources/* (MCP tool/resource behavior)
packages/limps/src/rlm/* and process_doc(s) tools (untrusted code execution)
packages/limps/src/indexer.ts and src/watcher.ts (filesystem and database safety)
packages/limps-headless/src/tools/* (external fetchers, parsing, extraction)
MCP/LLM Security Checklist
- Validate tool inputs and guard file paths against traversal.
- Avoid executing untrusted code or shell commands without sandboxing.
- Ensure user-controlled content never becomes tool arguments without sanitization.
- Check for prompt injection via markdown, frontmatter, or external content.
- Confirm tools/resources do not leak secrets or local paths.
- Verify allowed-tools / permissions are least-privilege.
- Verify dependency integrity to reduce supply-chain risk:
- Prefer
npm ci and check lockfile integrity hashes.
- Flag suspicious name lookalikes or unexpected transitive packages.
Output Format
Follow the repo review style:
- Findings first, ordered by severity.
- Include file references and concrete evidence.
- If no issues, say so explicitly and list residual risks or testing gaps.
Use this structure:
## Findings
- 🔴 Critical: ...
- 🟠 High: ...
- 🟡 Medium: ...
- 🟢 Low: ...
## Questions / Assumptions
- ...
## Tests
- Suggested: ...
Graph & Multi-Operation Tool Patterns
When reviewing MCP tools, check:
- Unified tool pattern: Multi-operation tools (like
graph with subcommands: health, search, trace, check, suggest, reindex) should validate the operation parameter and dispatch correctly.
- Graph DB error handling: Tools that use
better-sqlite3 must handle DB open failures, missing tables, and corrupt data gracefully.
- Input validation: All MCP tool schemas should validate inputs before processing. Check for path traversal, SQL injection in FTS queries, and oversized inputs.
Notes
- Prefer
ReadFile, Grep, Glob over shell tools for code inspection.
- Avoid speculative claims; cite code or call out uncertainty.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: mcp-code-review3description: Review code for correctness, security, and LLM/MCP safety in this repo. Use when a code review, security review, or MCP/LLM audit is requested. Use when this capability is needed.4---5# MCP + LLM Code Review (limps)67## Purpose8Perform a security-focused, test-minded code review with emphasis on MCP servers, LLM safety, and performance risks in this repository.910## Scope11Use `$ARGUMENTS` as the scope (paths, diff range, PR number, or component name). If no scope is provided, review the current git diff.1213## Workflow141. **Establish context**15 - Read `CLAUDE.md` and relevant package docs.16 - Identify the target package (`packages/limps` or `packages/limps-headless`).172. **Threat intel + dependency hygiene**18 - Search authoritative sources for new MCP/LLM or supply-chain issues:19 - OWASP LLM Top 10, OWASP API Top 10, npm advisories, GitHub Security Advisories.20 - Audit npm dependencies (use repo scripts when available):21 - `npm audit --workspaces --include=prod`22 - `npm audit --workspaces --omit=dev` (if prod-only is needed)23 - Check for outdated or abandoned packages:24 - `npm outdated --workspaces`25 - Inspect dependency tree for suspicious packages or name lookalikes:26 - `npm ls --all --workspaces`27 - Verify lockfile integrity expectations:28 - Prefer `npm ci` for clean installs (verifies `package-lock.json` integrity).293. **Enumerate change surface**30 - List changed files and inspect diffs before diving into code.313. **Security-first review**32 - Validate input handling, path safety, and external command usage.33 - Check for secret exposure (logs, errors, telemetry).344. **MCP/LLM safety review**35 - Review tool schemas, argument validation, and permission boundaries.36 - Identify prompt injection vectors and untrusted content handling.375. **Correctness and reliability**38 - Look for logic errors, race conditions, and edge cases.396. **Performance and cost**40 - Identify expensive operations, redundant work, or unbounded processing.417. **Tests**42 - Confirm coverage for new behavior and regression risk areas.4344## Repo-Specific Risk Areas45Focus extra scrutiny on:46- `packages/limps/src/server.ts`, `src/tools/*`, `src/resources/*` (MCP tool/resource behavior)47- `packages/limps/src/rlm/*` and `process_doc(s)` tools (untrusted code execution)48- `packages/limps/src/indexer.ts` and `src/watcher.ts` (filesystem and database safety)49- `packages/limps-headless/src/tools/*` (external fetchers, parsing, extraction)5051## MCP/LLM Security Checklist52- Validate tool inputs and guard file paths against traversal.53- Avoid executing untrusted code or shell commands without sandboxing.54- Ensure user-controlled content never becomes tool arguments without sanitization.55- Check for prompt injection via markdown, frontmatter, or external content.56- Confirm tools/resources do not leak secrets or local paths.57- Verify allowed-tools / permissions are least-privilege.58- Verify dependency integrity to reduce supply-chain risk:59 - Prefer `npm ci` and check lockfile integrity hashes.60 - Flag suspicious name lookalikes or unexpected transitive packages.6162## Output Format63Follow the repo review style:64- Findings first, ordered by severity.65- Include file references and concrete evidence.66- If no issues, say so explicitly and list residual risks or testing gaps.6768Use this structure:69```70## Findings71- 🔴 Critical: ...72- 🟠 High: ...73- 🟡 Medium: ...74- 🟢 Low: ...7576## Questions / Assumptions77- ...7879## Tests80- Suggested: ...81```8283## Graph & Multi-Operation Tool Patterns84When reviewing MCP tools, check:85- **Unified tool pattern**: Multi-operation tools (like `graph` with subcommands: health, search, trace, check, suggest, reindex) should validate the `operation` parameter and dispatch correctly.86- **Graph DB error handling**: Tools that use `better-sqlite3` must handle DB open failures, missing tables, and corrupt data gracefully.87- **Input validation**: All MCP tool schemas should validate inputs before processing. Check for path traversal, SQL injection in FTS queries, and oversized inputs.8889## Notes90- Prefer `ReadFile`, `Grep`, `Glob` over shell tools for code inspection.91- Avoid speculative claims; cite code or call out uncertainty.9293---94> Converted and distributed by [TomeVault](https://tomevault.io/claim/paulbreuler) — claim your Tome and manage your conversions.95<!-- tomevault:4.0:skill_md:2026-04-12 -->