Skip to content

MCP server for authorized assessments

Every action scoped.Every conclusion traceable.

Pentest MCP gives a researcher or a tool-using assessment agent one scoped interface for discovery, validation, capture, credential checks, local audit, evidence retrieval, and report preparation. Each active tool call is tied to an engagement and a durable record, and the researcher verifies findings before publication.

npm install -g pentest-mcp

The declared-target check is an operational guardrail, not a complete network boundary. Use the server only on systems covered by explicit written authorization.

engagement / client-2026-10illustrative
  1. Scope declared

    createEngagement

    allowedTargets
    app.example.com, 192.0.2.0/28
    excludedTargets
    192.0.2.7
    authorized
  2. Tools execute

    nmapScan

    engagementId
    client-2026-10
    target
    app.example.com
    scope gate: allowed
  3. Evidence sealed

    getEngagementRecord

    recordId
    rec-…
    outcome
    succeeded
    awaiting review
  4. Analyst publishes

    publishAgentReport

    reviewer
    named analyst
    findings
    evidenceRecordIds required
    verified by reviewer
Scope, then tool, then receipt, then analyst review. Values mirror the README examples.

Lineage

From declared scope to analyst-reviewed report

Every conclusion in a report traces back through an evidence record, the tool call that made it, and the correlated scope decision. Four stages, each enforced by the server instead of by a prompt.

  1. 01

    Scope declared

    An engagement records the authorization reference, allowed and excluded targets, the authorization period, and optional testing windows. A saved plan fixes the exact tool names the work may use.

    • Allowed targets accept exact hosts, CIDRs, wildcard subdomains, and HTTP(S) URL prefixes. Exclusions take precedence.
    • All timestamps need an explicit timezone.
    • A plan cannot expand the engagement’s targets or time.

    createEngagementsaveAssessmentPlan

    Register an engagement →
  2. 02

    Tools execute

    A researcher or a tool-using agent calls scoped MCP tools. The server rejects any call omitted from the plan’s allowedToolNames before its handler runs, and active tools also pass the engagement’s target and time gate.

    • An allowlist denial leaves a failed audit receipt; a preflight scope refusal starts no command.
    • Command timeouts and output limits bound execution and captured output.
    • A missing binary or failed command is a tool error, not evidence that a target is clean.

    nmapScanhttpxProbenucleiScan

    Campaign execution →
  3. 03

    Evidence sealed

    A successful tool response includes a recordId for its stored evidence. Records persist across restarts, with private directory and file permissions, and reports carry an evidence index of raw-output SHA-256 hashes.

    • Each call records start and completion receipts with argument digests, correlation IDs, timing, and outcome.
    • Scanner output remains an observation until a researcher verifies it.
    • Raw output stays in private evidence, not in client-facing Markdown.

    listEngagementRecordsgetEngagementRecord

    Evidence and reports →
  4. 04

    Analyst publishes

    A report writer in a separate context drafts from a bounded evidence packet. An analyst verifies candidates against source records and publishes deliberately.

    • publishAgentReport requires a reviewer and explicit verified findings with evidence IDs.
    • It never promotes candidates automatically.
    • Failed, denied, timed-out, cancelled or ambiguous actions describe coverage and cannot support a finding.

    draftAssessmentReportpublishAgentReport

    Context quarantine →

What counts as a finding

  1. ObservationScanner output and agent observations stay observations until a researcher verifies them.
  2. CandidateModel candidates and generated drafts have no publication authority and require analyst review.
  3. Verified findingPublished with reviewer attribution and explicit findings: evidence IDs, impact, severity, remediation, and verification date.

Why a server

Authority belongs in code, not in a prompt

An MCP transport connection is not itself evidence of a test. The durable record and the matching scope decision are the acceptance evidence.

  • Scope is a record, not a prompt

    Active tools pass the engagement’s target and time gate before they run. A plan, repository, listening port, or model cannot expand the registered scope.

    Register an engagement →
  • Allowlists fail before handlers

    The server rejects any call omitted from the plan’s allowedToolNames before its handler runs, leaving a failed audit receipt.

    Client intake and plan →
  • Every call leaves a receipt

    Start and completion receipts record argument digests, correlation IDs, timing, and outcome. Records persist across restarts.

    Recovery and audit behavior →
  • Failures stay visible

    A missing binary or failed command is a tool error, not evidence that a target is clean. Failed or denied actions describe coverage and cannot support a finding.

    Operational limits →
  • Contexts stay quarantined

    The assessment worker and the report writer are separate contexts. The report writer receives a bounded evidence packet and no scanner connection.

    Context quarantine →
  • Candidates are not findings

    Scanner output remains an observation until a researcher verifies it. publishAgentReport never promotes candidates automatically.

    Evidence and reports →

The prompt is guidance

assessment-campaign-v2

  • Take the smallest useful next action, with no guessed targets or credentials.
  • Verify evidence IDs and digests.
  • Record used and skipped tools with reasons.
  • Stop immediately on scope, data, impact, or authorization conditions.

The server is enforcement

src/index.ts

  • Exact tool schemas
  • Plan allowlists
  • Target and time gates
  • Parent-status checks
  • Process bounds
  • Evidence publication gates

Workflow

One engagement, four deliberate steps

The October 2026 workflow keeps the person who writes the scope, the agent that runs tools, the model that drafts, and the analyst who publishes in separate hands.

  1. Create the engagement

    Start from signed authorization and rules of engagement, then save the assessment plan. The operator chooses a stable engagementId.

    createEngagementsaveAssessmentPlan

    Read the guide →
  2. Connect a researcher or agent

    A researcher or a fresh Codex process in the managed assessment container sees the complete catalog, while the plan’s exact allowedToolNames list permits only selected calls.

    getRuntimeStatusrunAgentAssessment

    Read the guide →
  3. Review the records

    Review recordId values and correlated scope decisions. Import external research with recordResearchActivity; the import does not replace MCP tool use.

    listEngagementRecordsgetEngagementRecordrecordResearchActivity

    Read the guide →
  4. Draft, verify, publish

    Draft from the complete evidence ledger, inspect candidate findings against source records, and publish only analyst-verified findings.

    draftAssessmentReportpublishAgentReportgetClientReport

    Read the guide →

Four contexts, each with a boundary

Human role separation still requires separate accounts or operating procedures. Attribution fields are not digital signatures.

  • Scope author

    Receives
    Client authorization and rules of engagement
    Does not receive
    Assessor transcript or application builder context
  • Assessment worker

    Receives
    One engagement, one plan, full MCP catalog, exact allowed tool list
    Does not receive
    Builder repository, unrelated home files, other engagements, report writer history
  • Report writer

    Receives
    Bounded scope, plan, evidence summaries, hashes and record IDs
    Does not receive
    Scanner MCP, assessor transcript, builder repository, raw output by default
  • Analyst reviewer

    Receives
    Draft plus cited source records
    Does not receive
    Automatic authority to promote model candidates

Context quarantine and roles →

Providers

Replaceable models, fixed authority

Codex, Claude, Daybreak Blue/Red, and API models are replaceable reasoning engines. Pentest MCP is the assessment control plane, so the scope, audit trail, and publication gate do not change with the model.

Assessment routes

  • Local Codex or ClaudeDedicated account profile that uses the CLI’s own configured credentials.
  • Container CodexPinned image with a temporary home and a one-connection bridge to the host MCP child.
  • Loopback OpenAI-compatibleA server such as llama.cpp or Ollama behind the guarded tool loop.
  • OpenRouterA dedicated guarded profile with provider routing controls.

Guarded local and OpenRouter models →

Model data policy

no-model
Direct MCP tools and deterministic report inventory.
metadata-only
Report model sees structural counts, tool metadata, IDs and hashes; candidate vulnerabilities are rejected.
local-agent
Local, container, or loopback processing; hosted providers are rejected before context is sent.
approved-provider
A configured provider receives the bounded packet; external-client work also needs the recorded approval reference.

Provider selection and data policy →

Optional and account-specific

Daybreak and Project Glasswing

Each provider checks access independently. A successful CLI sign-in or API key alone does not establish the right program grant, and a missing Daybreak grant cannot block an ordinary ready CLI or API profile.

Target authorization and provider entitlement are separate records, and a model cannot expand the target scope.

Daybreak and Glasswing boundaries →

Optional, off by default

hostileModelProtection: false

Enable it per assessment profile for an untrusted or refusal-resistant model. It adds duplicate-action, token-accounting, and finish-reason circuit breakers. It never disables authorization controls, so these stay enforced for every assessment model:

  • Exact tool allowlists
  • Engagement and target scope
  • Parent status
  • Testing windows
  • Process deadlines
  • Evidence logging
  • Context quarantine
  • Report verification

Routes through the docs

Start from what you are doing

Pages are generated from the repository’s maintained Markdown and TypeScript source, so the guide, the tool catalog, and the code cannot drift apart silently.

Open source

Built to be inspected

Pentest MCP is released under AGPL-3.0-or-later. Its production campaign design is informed by Pliny’s T3MP3ST, which uses the same license, and the integration decisions record where the trust model deliberately differs.

Package
v0.9.1
MCP tools
36
Node.js
>=22.19.0
License
AGPL-3.0-or-later

Released under AGPL-3.0-or-later. Use only within explicit authorization and scope.