MCP

MCP Server Reference

Strike Gate ships as a Model Context Protocol (MCP) server for use by Replit agents and other local MCP clients. All document processing is local — no content is transmitted or stored.

Transport

Protocol
MCP Streamable HTTP — stateless, fresh session per request
Endpoint
POST http://127.0.0.1:<PORT>/mcp
Health check
GET http://127.0.0.1:<PORT>/health → {"status":"ok","service":"classiscan-mcp","id":"<uuid>"}
Port
Set by the PORT env variable. Default: 8000.
License file
Set MCP_LICENSE_FILE to override the default (~/.classiscan/classiscan.lic).
Access
Loopback only (127.0.0.1). Remote connections rejected with HTTP 403.

Client config example

{
  "mcpServers": {
    "classiscan": {
      "url": "http://127.0.0.1:8000/mcp",
      "headers": {
        "Authorization": "Bearer <MCP_AUTH_TOKEN>"
      }
    }
  }
}

Tools

scan_document

Scan a local PDF, Word (.docx), or plain-text file. Reads from disk; nothing is transmitted.

pathstringAbsolute or relative path to the document on disk.

Returns: Structured ScanResult plus a human-readable text summary.

scan_text

Scan a raw text string. Use form-feed (\f) to indicate page breaks.

textstringThe document text to scan.
fileNamestring?Optional label for the source document.

Returns: Same structured ScanResult.

generate_report

Scan a document and produce a self-contained HTML detection report.

pathstring?Path to a local document. One of path or text is required.
textstring?Raw text to scan. Alternative to path.
fileNamestring?Optional label when scanning raw text.

Returns: { fileName, status, html } — html is a complete standalone HTML report.

ScanResult fields

statusVerdict string — see Status values below.
highestLevelHighest classification level found, or null.
overallConfidence0–99 integer. Certainty of the top finding.
flaggedtrue when status is not clean or explicitly-unclassified.
pageCountNumber of pages processed.
scannedAtISO-8601 timestamp.
advisoryPlain-English advisory string. Always present.
findings[]Per-finding array — see Finding fields below.
summary.totalFindingsTotal finding count.
summary.byLevelFinding count keyed by classification level.
summary.byTypeFinding count keyed by marking type.
remaining_creditsCredits remaining on the license after this scan.

Finding fields

markingTypebanner | portion | authority-block | authority-block-incomplete | cui-designation | legacy-marking
levelClassification level, or null.
matchedTextExact matched string.
page1-indexed page number.
contextSurrounding text excerpt.
confidence0–99 integer.
location.indexCharacter offset of match start within the page text.
location.lengthCharacter length of the match.
cuiCategories[]Parsed CUI category codes and names. Optional.
cuiLdcs[]Parsed LDC codes and names. Optional.
missingAuthorityFields[]Field names absent from an incomplete authority block.
rdFrdIndicator"RD" or "FRD" when a Restricted Data or Formerly Restricted Data marking is detected. Optional.
legacyLabelMatched legacy term (e.g. FOUO, SBU). Present on legacy-marking findings only.

Status values

cleanNo recognizable security markings found.
explicitly-unclassifiedAffirmative UNCLASSIFIED banner detected. flagged = false.
contains-classification-languageAuthority block or legacy marking present but no banner — weak keyword-only evidence.
suspected-controlledBanner plus another structured marking, not clearly CUI/classified.
controlledCUI markings detected.
classifiedClassified banner or markings detected.
classified-high-confidenceBanner plus corroborating markings.

Advisory

Every result includes an advisory field. It states that results are automated screening signals and require review by an authorized human. Do not use scan output as a classification determination.

License errors

All scan tools require a valid license with remaining credits. Two additional JSON-RPC error codes are returned when license conditions are not met:

-32003No license file found. Set MCP_LICENSE_FILE or place classiscan.lic at ~/.classiscan/classiscan.lic.
-32004Scan failed. No credits remaining. Please purchase additional scans to continue.

On success, every scan response includes remaining_credits reflecting the credits left after the scan completes.

LLM Integration Prompt

Copy this block into your agent system prompt, AGENTS.md, or .cursorrules file.

---
You have access to the Strike Gate MCP server, a local document security scanner that detects classified and Controlled Unclassified Information (CUI) markings in PDF and Word files. All processing is local. Nothing is transmitted or stored externally.

## Connecting

Protocol: MCP Streamable HTTP (stateless — fresh session per request)
Endpoint: POST http://127.0.0.1:8000/mcp
  (Replace 8000 with the value of the PORT environment variable if different)

Authentication: Bearer token
  Add an Authorization header: Authorization: Bearer <MCP_AUTH_TOKEN>
  The token value is set in the MCP_AUTH_TOKEN environment variable (Replit Secret).
  If the token is missing or wrong, the server returns HTTP 401 with JSON-RPC error -32002.
  The /health endpoint (GET http://127.0.0.1:8000/health) requires no authentication.

License file: classiscan.lic
  The server reads scan credits from a license file.
  Default path: ~/.classiscan/classiscan.lic
  Override with the MCP_LICENSE_FILE environment variable.

MCP client config example:
{
  "mcpServers": {
    "classiscan": {
      "url": "http://127.0.0.1:8000/mcp",
      "headers": {
        "Authorization": "Bearer <MCP_AUTH_TOKEN>"
      }
    }
  }
}

## Available tools

scan_document
  Scan a local PDF, Word (.docx), or plain-text file for security markings.
  Input:  path (string) — absolute or relative path to the file on disk
  Output: ScanResult (structured) + human-readable text summary

scan_text
  Scan a raw text string for security markings. Use \f (form-feed) for page breaks.
  Input:  text (string), fileName (string, optional)
  Output: ScanResult (structured) + human-readable text summary

generate_report
  Scan a document and return a self-contained HTML detection report.
  Input:  path (string, optional) OR text (string, optional); fileName (string, optional)
          One of path or text is required.
  Output: { fileName, status, html } — html is a complete standalone HTML file

## ScanResult shape

{
  status: string,              // verdict — see Status values below
  highestLevel: string | null, // highest classification level found
  overallConfidence: number,   // 0–99 integer; certainty of top finding
  flagged: boolean,            // true when status is not "clean" or "explicitly-unclassified"
  pageCount: number,
  scannedAt: string,           // ISO-8601
  advisory: string,            // always present; states human review is required
  findings: Finding[],
  summary: {
    totalFindings: number,
    byLevel: Record<string, number>,
    byType: Record<string, number>
  },
  remaining_credits: number    // credits remaining on the license after this scan
}

Finding shape:
{
  markingType: "banner" | "portion" | "authority-block" | "authority-block-incomplete"
               | "cui-designation" | "legacy-marking",
  level: string | null,
  matchedText: string,
  page: number,                   // 1-indexed
  context: string,
  confidence: number,             // 0–99
  location: { index: number, length: number },
  cuiCategories?: { code, name, known, type }[],
  cuiLdcs?: { code, name, known }[],
  missingAuthorityFields?: string[],
  legacyLabel?: string
}

## Status values (ordered by severity)

clean                    — no recognizable security markings found
explicitly-unclassified  — affirmative UNCLASSIFIED banner; flagged = false
contains-classification-language — authority block or legacy marking present, no banner (weak keyword-only evidence)
suspected-controlled     — banner plus another structured marking, not clearly CUI/classified
controlled               — CUI markings detected
classified               — classified banner or markings detected
classified-high-confidence — banner plus corroborating markings

## What to expect

- Markings detected: banner lines (SECRET//NOFORN, TOP SECRET, CUI, UNCLASSIFIED,
  RESTRICTED DATA, FORMERLY RESTRICTED DATA, etc.), portion marks ((S), (TS), (CUI),
  (U)), classification authority blocks, CUI designation blocks, legacy markings (FOUO,
  SBU), and RD/FRD markings.
- Confidence scores reflect pattern certainty, not a legal classification determination.
- The advisory field always instructs that results require human review.
- flagged is false for "clean" and "explicitly-unclassified"; true for all other statuses.
- Incomplete authority blocks produce an authority-block-incomplete finding with
  missingAuthorityFields listing absent field names.
- CUI banners with category/LDC segments (e.g. CUI//SP-PRVCY//NOFORN) are parsed into
  cuiCategories and cuiLdcs on the finding.

## License errors

All scan tools require a valid license with remaining credits.

-32003  No license file found. Set MCP_LICENSE_FILE or place classiscan.lic at
        ~/.classiscan/classiscan.lic.
-32004  Scan failed. No credits remaining. Please purchase additional scans to continue.

On success, every scan response includes remaining_credits (integer) — the credits
remaining after the scan is charged.

## Security constraints

- The server binds to 127.0.0.1 only. Remote connections are rejected with HTTP 403.
- If MCP_SCAN_ROOT is set, scan_document and generate_report only read files within
  that directory. Path traversal and symlink escapes are blocked via realpath resolution.
- Do not log or transmit the MCP_AUTH_TOKEN value.
---