Skip to main content

GhostMCP banner

GhostMCP

Release CI CodeQL OpenSSF Scorecard License Security Policy

GhostMCP is a security-focused MCP server for authorized assessment workflows. It combines policy-guarded native tools, curated external scanners, normalized workflows, a local dashboard, scheduling, credential backends, and auditable execution.

GhostMCP is currently a beta release. It defaults to a restricted posture and should be deployed only in environments where the operator controls the target scope, credentials, network path, and installed security tools.

Safety and authorization

Use GhostMCP only against systems you own or are explicitly authorized to assess. The runtime provides scope controls and execution ceilings, but those controls do not replace written authorization, rules of engagement, or operator review.

Secure defaults include:

  • Private-address targeting by default
  • Engagement context required by default
  • Maximum tool level set to active
  • Raw binary wrappers disabled by default
  • External plugins disabled by default
  • Credential storage disabled until a backend is selected
  • Remote transport without authentication blocked by default
  • Dashboard authentication required by default

Capabilities

  • Core MCP tools for DNS, WHOIS, HTTP, TLS, TCP exposure checks, IOC extraction, URL risk scoring, recon generation, metrics, and health checks
  • Normalized assessment workflows for web surface, TLS posture, and host exposure reviews
  • Curated wrappers for common security tools when their binaries are installed
  • Optional raw Kali wrappers with explicit global enablement and per-binary allowlisting
  • CIDR, domain, port, engagement, and tool-level policy controls
  • Versioned tool capability/target manifest and policy-backed approval provenance
  • Fail-closed routed execution and bounded in-memory subprocess output
  • Streamable HTTP transport with bearer-token or mTLS authentication
  • SQLite engagement, scan, schedule, and finding persistence
  • Authenticated web dashboard with a guarded execution registry
  • Five-field UTC cron scheduling with SQLite leases and duplicate-submit protection
  • Disabled-by-default entry-point plugin system with explicit allowlisting
  • Encrypted local credentials or Vault, AWS Secrets Manager, and GCP Secret Manager backends
  • Persistent canonical audit hash chain with optional HMAC signatures

Documentation

Requirements

  • Python 3.11 or newer
  • The mcp package, installed as a project dependency
  • Optional security binaries on PATH for curated or raw wrappers
  • Optional dashboard, credential, or secret-manager extras as needed

Installation

python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e .

Common optional installations:

# Dashboard and encrypted local credentials
python -m pip install -e ".[dashboard,credentials]"

# Development and tests
python -m pip install -e ".[dev,dashboard,credentials]"

# One external secret-manager backend
python -m pip install -e ".[vault]"
python -m pip install -e ".[aws]"
python -m pip install -e ".[gcp]"

Local MCP server

The default transport is local stdio:

export GHOSTMCP_ALLOWED_CIDRS=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
export GHOSTMCP_REQUIRE_ENGAGEMENT_CONTEXT=true
export GHOSTMCP_MAX_TOOL_LEVEL=active
ghostmcp

Configure your MCP client to start the ghostmcp command. Keep the environment explicit instead of relying on shell-wide defaults.

Remote gateway

Remote mode fails closed unless authentication is configured or the explicit insecure override is enabled.

Bearer-token example:

export GHOSTMCP_TRANSPORT_MODE=remote_gateway
export GHOSTMCP_AUTH_MODE=token
export GHOSTMCP_AUTH_TOKEN="replace-with-a-long-random-token"
export GHOSTMCP_HTTP_HOST=127.0.0.1
export GHOSTMCP_HTTP_PORT=8000
ghostmcp

Clients authenticate at the HTTP transport with:

Authorization: Bearer <token>

The token is not exposed as an MCP tool argument. Non-loopback token binding requires GHOSTMCP_TLS_CERT_PATH and GHOSTMCP_TLS_KEY_PATH; otherwise startup fails. For network-accessible deployments, prefer mTLS, bind to an internal interface, and restrict the port with a firewall or private overlay network.

See Deployment and Security operations.

Dashboard

python -m pip install -e ".[dashboard]"
export GHOSTMCP_DASHBOARD_TOKEN="replace-with-a-long-random-token"
export GHOSTMCP_DB_PATH="$PWD/ghostmcp.db"
ghostmcp-dashboard

The dashboard binds to 127.0.0.1:8080 by default. It contains one in-process worker and one scheduler. Schedule claims are durable and leased in SQLite, but work that is already queued in memory is not restored after a process crash.

Run one dashboard instance unless all instances share the same database and compatible file-root policy. See Dashboard and scheduling.

Normalized assessment workflows

  • web_surface_assessment_tool validates scope, checks HTTP posture, and optionally runs WhatWeb and WAF detection when available.
  • tls_posture_assessment_tool validates the host and port, checks certificate state and expiry, and optionally runs sslscan.
  • host_exposure_assessment_tool performs a policy-bounded TCP exposure check over an explicit port list.

These workflows provide stable, typed entry points without requiring an agent to assemble many low-level calls.

Curated external tools

Curated wrappers register only when their binaries are available. Examples include nmap, WhatWeb, Nikto, Amass, Gobuster, Nuclei, ffuf, Feroxbuster, Subfinder, dnsx, sqlmap, sslscan, sslyze, TruffleHog, Gitleaks, SMB utilities, and metadata-analysis tools.

Availability is environment-dependent. Use toolchain_status_tool to inspect installed, missing, enabled, and disabled integrations.

Raw binary wrappers

Raw wrappers are disabled by default. Enabling the feature does not enable every discovered binary. Each binary must also appear in the allowlist.

export GHOSTMCP_ENABLE_RAW_TOOLS=true
export GHOSTMCP_RAW_TOOL_ALLOWLIST=nmap,testssl.sh

Raw wrappers remain subject to engagement context, capability and target validation, tool-level ceilings, argument limits, runtime limits, output limits, and audit logging. They should be enabled sparingly.

Policy-backed intrusive execution

Intrusive and sensitive capabilities fail closed unless the engagement is present in a mode-0600 policy file with an expiration, narrow target scope, capability list, and approval provenance:

export GHOSTMCP_ENGAGEMENT_POLICY_FILE=/etc/ghostmcp/engagement-policy.json
export GHOSTMCP_MAX_TOOL_LEVEL=intrusive

Start from engagement-policy.example.json. The runtime hashes the effective scope and records the scope digest, approval ID, and approver in audit events. The tool-provided engagement_mode can only narrow policy; it cannot grant authority.

Plugins

Plugins are disabled by default and loaded by entry-point name only when allowlisted.

export GHOSTMCP_ENABLE_PLUGINS=true
export GHOSTMCP_PLUGIN_GROUP=ghostmcp.plugins
export GHOSTMCP_PLUGIN_ALLOWLIST=my-approved-plugin

See Plugin development for the entry-point contract and deployment checklist.

Credential storage

Credential storage defaults to disabled. Select a backend explicitly:

# Encrypted local file
export GHOSTMCP_CREDENTIAL_BACKEND=encrypted
export GHOSTMCP_CREDENTIAL_STORE="$HOME/.local/state/ghostmcp/credentials.bin"
export GHOSTMCP_CRED_KEY_FILE="$HOME/.config/ghostmcp/credential.key"

Supported backend names are disabled, encrypted, vault, aws, gcp, and plaintext. Plaintext storage additionally requires GHOSTMCP_ALLOW_PLAINTEXT_CREDENTIALS=true and should be limited to isolated testing.

Use file-mounted secrets or a secret manager in production. Do not commit tokens, passwords, key files, credential stores, or audit HMAC keys.

Audit chain

Set an audit sink to persist JSONL events:

export GHOSTMCP_AUDIT_SINK_PATH=/var/log/ghostmcp/audit.jsonl
export GHOSTMCP_AUDIT_HMAC_KEY_FILE=/etc/ghostmcp/audit-hmac.key
export GHOSTMCP_AUDIT_FSYNC=true

Events use canonical JSON, prev_hash, and event_hash. When an HMAC key is configured, each event is also signed. Protect the audit file and key separately and ship audit output to append-only or centralized storage when possible.

Configuration baseline

Copy .env.example and review every value before deployment. Important defaults:

Setting Default Meaning
GHOSTMCP_ALLOW_PRIVATE_ONLY true Reject public target addresses
GHOSTMCP_REQUIRE_ENGAGEMENT_CONTEXT true Require an engagement ID for guarded calls
GHOSTMCP_MAX_TOOL_LEVEL active Global execution ceiling
GHOSTMCP_ENGAGEMENT_POLICY_FILE empty Protected policy input for scoped intrusive/sensitive authorization
GHOSTMCP_ALLOW_UNSCOPED_INTRUSIVE false Unsafe compatibility override
GHOSTMCP_ENABLE_RAW_TOOLS false Disable generated raw wrappers
GHOSTMCP_ENABLE_PLUGINS false Disable external plugins
GHOSTMCP_CREDENTIAL_BACKEND disabled Do not load or store credentials
GHOSTMCP_AUTH_MODE none Valid for stdio; remote mode blocks it
GHOSTMCP_DASHBOARD_ALLOW_UNAUTHENTICATED false Require dashboard authentication

See Configuration reference for all supported groups and production guidance.

Development

python -m pip install -e ".[dev,dashboard,credentials]"
ruff check .
mypy ghostmcp
bandit -q -r ghostmcp
pip-audit -r requirements-dev.lock.txt
python -m unittest discover -s tests -v
python -m build

CI validates Python 3.11 and 3.12, dependency locks, linting, typing, Bandit, dependency advisories, tests, package builds, clean-wheel installation, container construction, Trivy policy, and CodeQL.

Release status

The package version is 0.2.1. The runtime is beta-quality: policy enforcement is fail-closed, but operators must still layer network egress controls, least privilege, protected secrets, and written authorization around it.

License

GhostMCP is licensed under the GNU Affero General Public License v3.0 or later. See LICENSE.

Metadata

Release files for ghostmcp-server 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ghostmcp-server 0.2.1
File Size Uploaded Provenance Actions
ghostmcp_server-0.2.1.tar.gz 102.3 kB With provenance Details for ghostmcp_server-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ghostmcp-server 0.2.1
File Interpreter ABI Platform Actions
ghostmcp_server-0.2.1-py3-none-any.whl Python 3 none any Details for ghostmcp_server-0.2.1-py3-none-any.whl

Total release size: 206.3 kB

Release files / ghostmcp_server-0.2.1.tar.gz

Download URL ghostmcp_server-0.2.1.tar.gz
Size 102.3 kB
Tags Source
SHA-256 checksum
How to use checksums
38e3308f386c84e1013b1cc7d2e4be23bea6d35ec46a99e7c5cb7b5f5d6fda1a
BLAKE2b-256 checksum
How to use checksums
30e434633f762ca56512f11f667803c2ef8d54443ab963ca559d61e1b7c9d014
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.

Transparency log

Release files / ghostmcp_server-0.2.1-py3-none-any.whl

Download URL ghostmcp_server-0.2.1-py3-none-any.whl
Size 104.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
31b14c9518890d22965b9dcff21c0e926f91507c647835cecdf51b1938c9b6cc
BLAKE2b-256 checksum
How to use checksums
4585812a233be60d07d839969ec3e5ac4039babdc602910b7b73d4930a236f36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.

Transparency log

Security for ghostmcp-server 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ghostmcp_server-0.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page