cd /news/ai-tools/building-a-zero-dependency-client-co… · home › topics › ai-tools › article
[ARTICLE · art-177929] src=dev.to ↗ pub= topic=ai-tools verified=true sentiment=↑ positive

Building a Zero-Dependency Client Codebase Auditor & 3-Page Native PDF Generator in TypeScript (CLI + Official MCP Server)

A developer built AuditDeck, an MIT-licensed, zero-dependency TypeScript CLI and Model Context Protocol server that audits local Git repositories across five technical pillars and renders a multi-page client handover PDF in under five seconds without Puppeteer or Chromium. The tool masks secrets at match time, uses execFileSync with argument arrays to avoid shell injection, flags single-author bus-factor risk from git shortlog, and generates PDFs via raw PDF 1.4 vector operators, with the project published to the Official MCP Registry using GitHub Actions OIDC.

recommendation

Mask credentials at match time before they enter report objects, and run Git probes with execFileSync argument arrays plus timeouts so repo paths can never inject shell commands.

more in playbook: Securing agents and AI tools
by read5 min views3 publishedNov 29, 2026

If you freelance or run a small engineering studio, you know the pain of milestone handovers and paid codebase audits.

A client pays you to audit a legacy repo before an acquisition, a seed round, or a handoff to an internal team. You spend 45 minutes inspecting the repo — spotting leaked .env files, missing lockfiles, a single-author Git bus factor of 1, a 1,800-line God file, and zero CI checks — and then you burn 3 to 5 hours formatting a Notion doc or Google Slides deck so a non-technical founder or CTO can actually read it.

Cloud SaaS scanners don't solve this well either: many clients under NDA explicitly forbid up proprietary source code to third-party servers.

So I built AuditDeck — a 100% local-first, zero-dependency, MIT open-core CLI & Model Context Protocol (MCP) server that audits any local Git repository across 5 technical pillars and renders a multi-page Client Handover PDF in under 5 seconds, without Puppeteer, Chromium, or a single byte leaving your laptop.

Here are the four most interesting engineering problems I solved while building it (and shipping it to the Official MCP Registry with GitHub Actions OIDC).

A surprising number of lightweight scanners detect an AWS or Stripe key and then echo the entire offending line straight into a JSON or Markdown report. If you email that handover PDF to a client executive or drop it in Slack, your audit report just became a credential leak.

In AuditDeck's security scanner, every pattern match is masked at match time before it ever enters an audit finding object:

function maskSecret(raw: string): string {
  const trimmed = raw.trim();
  if (trimmed.length <= 8) return "****";
  return `${trimmed.slice(0, 4)}...${trimmed.slice(-4)}`;
}

We also:

node_modules, .git, build artifacts, and files over 512 KB so scans finish in milliseconds even on monorepos..env files present in the working tree (a critical handover hazard) from safe .env.example templates.AKIA..., Stripe sk_live_..., GitHub ghp_... / github_pat_..., OpenAI/Anthropic/Google API keys, PEM private key blocks, and embedded DB connection passwords) so false positives stay low. To score maintainability and handover risk, AuditDeck inspects commit history, active author count, recent velocity, and monolithic source hotspots.

One rule I stick to in local dev tools: never pass user paths to execSync with string interpolation. Even a repo folder with spaces or $(...) in its name will break or execute unintended shell commands.

Instead, every Git probe uses execFileSync("git", [...args], { cwd: repoPath }) with a strict timeout and clean fallback when scanning a non-Git archive:

import { execFileSync } from "node:child_process";

function runGit(repoPath: string, args: string[]): string | null {
  try {
    return execFileSync("git", args, {
      cwd: repoPath,
      encoding: "utf8",
      stdio: ["ignore", "pipe", "ignore"],
      timeout: 5000,
    }).trim();
  } catch {
    return null;
  }
}

From git shortlog -sn --all we compute contributor concentration: if one developer authored >= 85% of commits in a non-trivial codebase, AuditDeck flags a Single-Author Bus-Factor Risk and weights it into the 0–100 Executive Health Score (A– F).

Most Node.js PDF tools either bundle a 170 MB headless Chromium binary or require heavy native bindings. For a CLI that people invoke via npx or inside a tiny Docker MCP container, that's a non-starter.

A crisp business report — typography hierarchy, navy executive banner, color-coded pillar progress bars, severity pills (CRITICAL / HIGH / MEDIUM), a structured findings register, and a Page 3 30-Day Remediation Roadmap + Client Sign-Off block — only needs raw PDF 1.4 vector operators (rg, re, f, BT/ET, Tf, Td, Tj) and a clean cross-reference ( xref) table:

0 entries in dependencies in package.json). Buffer.byteLength(..., "latin1") so xref is valid across macOS Preview, Chrome, Firefox, Adobe Acrobat, and pdftotext.\, (, )) and strict line-wrapping so long file paths never overflow the right margin. You can inspect an actual 3-page PDF generated directly by this zero-dep engine here:

👉 View Live 3-Page Sample Pro PDF

Running AuditDeck from the terminal (npx github:danielneuron/auditdeck scan .) is great, but even better is letting Claude Code, Cursor, Cline, or Windsurf audit a repo mid-conversation and generate the client handover PDF directly.

Because MCP over stdio is newline-delimited JSON-RPC 2.0, implementing protocol 2025-11-25 cleanly with server instructions, 4 annotated tools ( readOnlyHint, destructiveHint, idempotentHint, openWorldHint), and 2 guided MCP prompts ( client-handover-audit, pre-release-security-check) took ~280 lines of zero-dep TypeScript.

To publish to the Official MCP Registry (io.github.danielneuron/auditdeck) automatically on every GitHub Release with zero long-lived API secrets:

Dockerfile:

   LABEL io.modelcontextprotocol.server.name="io.github.danielneuron/auditdeck"

ghcr.io in GitHub Actions and authenticate mcp-publisher via GitHub OIDC (id-token: write):

   mcp-publisher login github-oidc
   mcp-publisher publish

Both io.github.danielneuron/auditdeck and its companion AI billing tool io.github.danielneuron/promptbill are now live on the Official MCP Registry and indexed on Glama (83% Discovery Score, A Server Coherence).

npx github:danielneuron/auditdeck scan --demo
npx github:danielneuron/auditdeck pdf --demo --client "Acme FinTech Pty Ltd" --out handover.pdf

claude mcp add auditdeck -- npx -y github:danielneuron/auditdeck mcp

The full 5-pillar scanner, masked secret detector, Markdown/JSON exports, 2-page PDF preview, and full local MCP server are 100% free & MIT open-source. If you deliver paid client audits or handovers and want white-label branding, Page 3 (30-Day Remediation Roadmap + Client Sign-Off block), formula-safe Jira/Linear CSV export, or multi-repo portfolio rollups (auditdeck merge), optional one-time licenses are available via Polar.sh ($29 Pro / $69 Agency — or grab the $39 Dev CLI & MCP Pro Bundle together with ** PromptBill Pro** to save $9).

What checks would be most valuable to add next for client codebase handovers — Docker/container hardening, Terraform/IaC drift, or database migration safety? Drop a comment below!

── more in #ai-tools 4 stories · sorted by recency
── more on @auditdeck 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/building-a-zero-depe…] indexed:0 read:5min 2026-11-29 · —