scopeguard-mcp
ScopeGuard MCP is a policy-first defensive security server that enables AI clients to perform secure, bounded assessments, analyze web security headers, and scan authorized local repositories through a controlled interface, ensuring strong security guarantees and auditability.
Health Check: Report server safety settings, capabilities, and audit-chain health (
health).Create Dry-Run Engagement: Create a bounded, non-executing engagement scope with expiry (
create_dry_run_engagement).Revoke Engagement: Immediately revoke an engagement to prevent further operations (
revoke_engagement).Scope Validation: Normalize and verify targets are within allowed scope (
check_scope).Assessment Planning: Generate bounded web or repository assessment plans without executing network actions (
plan_assessment).Header Analysis: Analyze caller-supplied HTTP response headers offline (
analyze_headers).Repository Scanning: Run read-only Python and secret pattern scans on authorized local repos (
scan_repository).Audit Trail: List engagement-specific audit events (
list_audit_events) and verify the tamper-evident audit chain (verify_audit_chain).
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@scopeguard-mcpCheck if https://example.com is in scope for an assessment."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ScopeGuard MCP
ScopeGuard is a policy-first defensive security server for MCP. It lets AI clients plan assessments, evaluate web security headers, and scan explicitly authorized local source trees without exposing a general shell, network scanner, exploit generator, or credential tool.
The project demonstrates senior security-engineering concerns beyond rule detection: authorization boundaries, canonical scope evaluation, dual execution gates, bounded resource use, evidence integrity, secure file access, durable audit history, threat modeling, supply-chain controls, and negative testing.
Security guarantees
MCP clients can create only short-lived
dry-runengagements.Execute engagements are created and revoked only through the local operator CLI.
Every target operation requires an active engagement, an explicit capability, and a canonical target that matches scope.
Repository scans require both an execute engagement and the operator-controlled
SCOPEGUARD_EXECUTION_ENABLEDgate.Production execution can require an HMAC-sealed audit checkpoint. A missing or invalid seal fails closed.
File traversal is bounded by file count, file size, total bytes, and finding count.
Repository files are opened as regular files without following symlink components on supported POSIX platforms, reducing path-race exposure.
Secret matches are never returned. Correlation fingerprints use keyed HMAC rather than a guessable unsalted digest.
Completed scans persist a manifest digest, ruleset digest, timestamps, outcome, and summary so evidence can be correlated with the audit chain.
The server uses local stdio only. It does not expose an unauthenticated network port.
These controls do not prove that a ticket represents legal authorization. The operator is still responsible for validating permission and exporting signed audit heads to a separate trust domain.
Related MCP server: mcp-security-scanner
Architecture
flowchart LR
A["Untrusted MCP client"] --> B["Typed stdio tools"]
O["Operator CLI + environment"] --> C["Policy engine"]
B --> C
C --> D["Canonical scope matcher"]
C --> E["Capability + expiry gate"]
C --> F["Dual execution gate"]
F --> G["Bounded repository analyzer"]
C --> H["Offline header analyzer"]
C --> I[("SQLite engagements")]
G --> J[("Durable scan evidence")]
C --> K[("Hash-chained audit events")]
K --> L["HMAC-sealed checkpoint"]See ARCHITECTURE.md, the threat model, and the operations runbook for the detailed design.
MCP tools
Tool | Purpose | Boundary |
| Report safety posture and audit integrity | No target access |
| Create a bounded non-executing scope | Execute mode is unavailable |
| Revoke an MCP-created dry-run engagement | Cannot revoke operator execute grants |
| Normalize and evaluate a target | Active engagement required |
| Produce a bounded web or repository plan | No network or process execution |
| Inspect caller-supplied response headers | Offline and input-bounded |
| Run read-only Python and secret checks | Requires both execution gates |
| Read engagement-specific evidence | Requires |
| Read durable scan manifests and outcomes | Requires |
| Verify event order and the signed head | Does not reveal signing material |
Quick start
Python 3.11 or newer is required.
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install -e .
scopeguard doctor
scopeguard-mcpExample MCP client configuration:
{
"mcpServers": {
"scopeguard": {
"command": "/absolute/path/to/scopeguard-mcp/.venv/bin/scopeguard-mcp",
"env": {
"SCOPEGUARD_STATE_DIR": "/absolute/path/to/scopeguard-state"
}
}
}
}Authorized execution workflow
Generate and store a random audit key in your secret manager. Do not commit it or place it in shell history. Then configure a dedicated state directory and the smallest possible repository root:
export SCOPEGUARD_STATE_DIR=/absolute/path/to/scopeguard-state
export SCOPEGUARD_ALLOWED_ROOTS=/absolute/path/to/authorized-repositories
export SCOPEGUARD_EXECUTION_ENABLED=true
export SCOPEGUARD_REQUIRE_SEALED_AUDIT=true
export SCOPEGUARD_AUDIT_HMAC_KEY='value-loaded-from-your-secret-manager'
export SCOPEGUARD_AUDIT_KEY_ID='primary-2026'
scopeguard create-engagement \
--title "Repository security baseline" \
--ticket SEC-1234 \
--target file:/absolute/path/to/authorized-repositories/example \
--capability scan:repository \
--capability audit:read \
--mode execute \
--expires-in-minutes 60
scopeguard-mcpExport the signed audit head after an assessment and anchor it in an append-only external system:
scopeguard verify-audit
scopeguard export-audit-checkpoint > scopeguard-audit-head.jsonThe checkpoint contains only the event count, chain head, key identifier, and HMAC signature. It never includes the signing key.
Capabilities
Capability | Allows |
| Bounded web or repository planning for an in-scope target |
| Offline analysis of supplied HTTP headers |
| Built-in read-only scanning under both execution gates |
| Engagement audit events and durable scan-run evidence |
Configuration
Variable | Default | Purpose |
|
| Private SQLite state directory |
| current directory | Path-separated operator allowlist |
|
| Enables operator-created execute engagements |
|
| Fails execution closed without a verified audit seal |
| unset | At least 32 bytes; signs the durable audit checkpoint |
| key fingerprint | Non-secret identifier used for rotation tracking |
|
| Engagement target ceiling |
|
| Offline header count ceiling |
|
| Total header input ceiling |
|
| Repository file ceiling |
|
| Per-file read ceiling |
|
| Total repository read ceiling |
|
| Returned finding ceiling |
Repository analysis
The dependency-free analyzer detects focused high-signal patterns:
Python
evalandexecos.systemandos.popensubprocesscalls withshell=Trueunsafe Pickle deserialization
yaml.loadwithout a safe loaderprivate-key blocks, AWS access keys, GitHub tokens, and likely hard-coded secrets
Results include a deterministic file-manifest SHA-256 and ruleset SHA-256. Secret values are excluded from results, audit events, and scan records. This scanner is a bounded baseline, not a replacement for CodeQL, Semgrep, Gitleaks, dependency auditing, or expert review.
Engineering quality
The repository includes:
Python 3.11–3.13 tests with a 90% coverage floor
Ruff lint and format verification
static type analysis with complete function signatures
Bandit and dependency vulnerability scanning
CodeQL analysis on pushes, pull requests, and a weekly schedule
package build and metadata verification
tagged release artifacts with an SBOM and GitHub build-provenance attestation
Dependabot for Python and GitHub Actions dependencies
architecture, threat-model, ADR, operations, contribution, and security documents
Local verification:
pip install -e ".[dev]"
ruff check .
ruff format --check .
mypy src/scopeguard_mcp
bandit -q -r src
pytest
python -m build
twine check dist/*Responsible use
Use ScopeGuard only on repositories and systems you own or are explicitly authorized to assess. The project intentionally excludes exploit generation, password attacks, credential collection, payload generation, persistence, evasion, denial of service, internet-scale scanning, and autonomous attack chains.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
AlicenseAqualityDmaintenanceEnables security analysis of code and infrastructure files via MCP, using Symbiotic CLI for scanning vulnerabilities.4MIT- AlicenseAqualityAmaintenanceSecurity scanning for MCP servers from the inside out. Provides runtime inspection, AST-based static analysis, config audit, dependency analysis, and OWASP MCP Top 10 compliance in a single MCP server.55625MIT
- AlicenseNot gradedqualityCmaintenanceEnables agents to audit and safeguard repositories by detecting dependency pinning issues, license compliance problems, hardcoded secrets, and dead code through MCP tools.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents and MCP servers to operate under autonomous security enforcement, including pre-deployment scanning, per-call authorization, runtime monitoring, incident containment, and comprehensive auditing.1MIT
Related MCP Connectors
Scan any public GitHub MCP-server repo for security issues. 37 MCP-specific L1 rules, 8 languages.
Zero-config MCP security scanner for AI-generated apps. 25K+ vulnerability patterns.
Remote MCP for A2A caller identity, scope policy, verdict receipts, and audit history.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/mzatylny/scopeguard-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server