Repository avatar
Other Tools
v1.0.0
active

mcp-server

dev.nhiascode/mcp-server

Zero-dep NHI governance: workflow audit, OIDC/App migrations, Ed25519 verify & offboarding.

Documentation

NHI-as-Code (nhiascode.dev)

Zero-dependency, zero-secret Non-Human Identity (NHI) governance, GhostAction blast-radius auditing, auto-OIDC/GitHub App PR remediation, and Ed25519-signed SOC 2 / ISO 27001 compliance evidence.

Built by The Peripety Company on Node.js 22+ native TypeScript and Cloudflare Workers + D1 + R2 — with dependencies: {} and devDependencies: {} across the entire monorepo.


Why NHI-as-Code?

Non-human identities (AWS IAM keys, GitHub PATs, Cloudflare tokens, Stripe keys, OpenAI/Anthropic API keys, Google service accounts, and CI/CD workflow tokens) frequently outnumber human engineers across modern cloud stacks and are a prime target of CI supply-chain attacks — including GhostAction (compromised-PAT workflow injection exfiltrating static CI secrets) and tj-actions/changed-files (CVE-2025-30066) (upstream mutable Action tag hijacking).

NHI-as-Code eliminates static machine keys without ever asking for your production credentials:

  1. Zero-Secret Architecture (HTTP 422 Firewall): All provider discovery and workflow scanning run strictly inside your trust boundary (local CLI or CI runner). Only metadata and salted HMAC-SHA256 fingerprints cross the wire — enforced both client-side and by a mandatory server-side Raw-Secret Rejection Firewall (RAW_SECRET_REJECTED, HTTP 422).
  2. Zero External Dependencies (INV-1): Zero third-party npm packages, zero post-install scripts, zero transitive supply-chain surface. Every line of code runs on Node 22+ built-ins and standard WebCrypto.
  3. Action-First Remediation (INV-4, INV-5): Generates strict zero-wildcard AWS OIDC Terraform trust policies (StringEquals on both aud = "sts.amazonaws.com" and exact sub = "repo:<org>/<repo>:ref:refs/heads/<branch>" or environment:<env>) plus 40-character SHA-pinned GitHub Actions snippets and GitHub App token migrations.
  4. Offline-Verifiable Ed25519 Evidence (INV-3): Produces RFC-8785 canonical JSON, Ed25519-signed SOC 2 Type II (CC6.1–CC6.3) and ISO 27001:2022 (A.5.15–A.5.18) evidence bundles, Vanta/Drata custom evidence exports, and XSS-safe SVG Trust Badges verifiable against /.well-known/nhi-jwks.json.

See docs/THREAT_MODEL.md, docs/SECURITY_ASSURANCE.md, and SECURITY.md for our binding security invariants (INV-1..INV-7) and internal security engineering review log.


Quickstart (Node >= 22)

# 1. Run instant zero-credential CI supply-chain blast-radius demo in your terminal
npx @nhiascode/cli demo
# (or from this repository)
node --experimental-strip-types packages/cli/src/index.ts demo

# 2. Scan the current repository locally (zero network calls, zero secrets sent)
npx @nhiascode/cli scan .
# (or from this repository)
node --experimental-strip-types packages/cli/src/index.ts scan .

# 3. Boot the real Cloudflare Worker locally (Node 22 + node:sqlite + seeded demo org)
npm run dev
# -> http://127.0.0.1:8788/               (Interactive CI Supply-Chain & OIDC Scanner)
# -> http://127.0.0.1:8788/security       (Zero-Secret Architecture & Threat Model)
# -> http://127.0.0.1:8788/trust/acme-saas (Live Browser WebCrypto Ed25519 Verifier)
# -> http://127.0.0.1:8788/api/health     (Health & Security Headers)
# -> http://127.0.0.1:8788/.well-known/nhi-jwks.json (Public Ed25519 JWKS)
# -> http://127.0.0.1:8788/admin          (Hardened Admin Console)

# 4. Build pure .mjs distributions, run tests & synthetic security canary
npm run build
npm test
npm run canary

Monorepo Package Map

Package / PathNamePurposeExternal Deps
packages/core@nhi-as-code/coreReDoS-proof secret firewall (detectRawSecrets, redactSecrets, assertZeroRawSecrets), RFC-8785 JCS, Ed25519 signing, GhostAction workflow/Terraform/Dockerfile scanner, policy scorer, OIDC/App/offboarding generators, SOC 2 & ISO 27001 evidence + SVG badges0
packages/cli@nhiascode/cli (npx @nhiascode/cli)Local-first CLI (demo, scan [--upload-digest], fix-preview, offboard, verify), read-only provider metadata adapters, SARIF/JSON/Markdown output, HTTPS-only metadata digest upload0
packages/workernhi-as-codeCloudflare Worker control plane (D1 + R2 + Cron), 422 raw-secret firewall, streaming body limits (413), SSRF blocklist, multi-tenant API, GitHub App SHA-pinned PRs, Polar billing webhooks, /trust/:org, /badge/:org.svg, /admin0
packages/mcp@nhiascode/mcp-serverStdio JSON-RPC 2.0 MCP server (nhi_scan_workflow, nhi_generate_oidc_migration, nhi_generate_app_token_migration, nhi_verify_evidence, nhi_offboarding_playbook) with zero shell execution and zero filesystem reads0
packages/actiontheperipetycompany/nhi-as-code-actionNative Node 24 GitHub Action (dist/index.mjs) with strict GITHUB_WORKSPACE path/symlink containment, SARIF 2.1.0 output, injection-safe GITHUB_OUTPUT, and optional zero-secret digest upload0
migrationsD1 SQLite SchemaParameterized multi-tenant schema with salted API key hashes, webhook replay deduplication, and append-only hash-chained audit_log—
scriptsOperationsbuild-dist.mjs, build-worker.mjs, local-server.mjs, canary.mjs, deploy.sh, push-secrets.sh0

GitHub Action Usage

Pin the action to a full 40-character commit SHA in .github/workflows/nhi-audit.yml:

name: NHI-as-Code CI Supply-Chain Audit
on:
  pull_request:
  push:
    branches: ["main"]

permissions:
  contents: read
  security-events: write

jobs:
  nhi-audit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

      - name: Run NHI-as-Code Static Key & Supply-Chain Audit
        uses: theperipetycompany/nhi-as-code-action@<40-char-commit-sha>
        with:
          repo-path: "."
          fail-on: "high"
          sarif-output: "nhi-as-code.sarif.json"
          # Optional: uploads strictly metadata-only digest (ZERO raw secrets ever leave runner)
          # upload-digest-url: "https://nhiascode.dev/api/v1/ingests/digest"
          # org-slug: "${{ github.repository_owner }}"
          # api-key: "${{ secrets.NHI_AS_CODE_API_KEY }}"

      - name: Upload SARIF to GitHub Code Scanning
        if: always()
        uses: github/codeql-action/upload-sarif@<40-char-commit-sha>
        with:
          sarif_file: nhi-as-code.sarif.json

MCP Server Usage (Claude Desktop, Cursor, Antigravity)

{
  "mcpServers": {
    "nhi-as-code": {
      "command": "npx",
      "args": ["-y", "@nhiascode/mcp-server"]
    }
  }
}

Tools exposed (zero shell execution, zero filesystem access, raw-secret rejection enabled):

  • nhi_scan_workflow
  • nhi_generate_oidc_migration
  • nhi_generate_app_token_migration
  • nhi_verify_evidence
  • nhi_offboarding_playbook

Pricing

TierMonthlyReposMonitored NHIsProvidersKey Capabilities
Free OSS$01252Local CLI, GitHub Action SARIF, public Trust Badge
Team$249/mo15250625 auto-OIDC/App PRs/mo, Ed25519 SOC 2/ISO evidence, offboarding playbooks, 90d retention
Growth$599/mo751,5008150 PRs/mo, Vanta/Drata custom evidence export, custom policy thresholds, 365d retention
Scale$1,299/moUnlimited10,0008Unlimited PRs, 730d audit retention, dedicated signing key options & priority support

Deployment

See HUMAN_LAUNCH_CHECKLIST.md for the ~60-minute step-by-step production go-live guide and GTM_OPERATIONS.md for automated PLG distribution operations.

# Push Cloudflare Worker secrets safely from .env.local (never echoes values)
./scripts/push-secrets.sh

# Test, validate invariants, run synthetic canary, migrate D1, and deploy
./scripts/deploy.sh
NPM
@nhiascode/mcp-server
Install Command
npm install @nhiascode/mcp-server
Runtime: npx