Skip to main content

goose-pentest-mcp

A Model Context Protocol extension for self-pentest workflows. Exposes six tools to Goose (or any MCP-compatible client) so an LLM can list targets, trigger scans, read findings, and mark them resolved — all against your backend.

The extension is a thin HTTP client. It does not shell out, write files, or scan anything itself. You supply the backend; it supplies the agent surface.

What you need

  1. A backend implementing the six endpoints in BACKEND_CONTRACT.md.
  2. An API key your backend will accept in X-Pentest-Key.
  3. Goose (or another MCP client) installed locally.

If you have not built a backend yet, see the Reference implementation section below — there's a working FastAPI one (Apache-2.0) you can read or adapt.

Install

pip install goose-pentest-mcp
# or, if you use uv:
uvx goose-pentest-mcp

To install from source (or hack on it):

git clone https://github.com/turer73/goose-pentest-mcp.git
cd goose-pentest-mcp
pip install -e .

Configure Goose

Edit ~/.config/goose/config.yaml:

extensions:
  pentest:
    type: stdio
    name: pentest
    display_name: "Self-Pentest"
    description: "List targets, trigger scans, manage findings"
    enabled: true
    bundled: false
    timeout: 600
    cmd: python
    args:
      - -m
      - goose_pentest_mcp.server
    env_keys:
      - PENTEST_API_KEY
    envs:
      PENTEST_API_BASE: "https://your-backend.example.com/api/v1/security"

Then export the key from your shell rc:

export PENTEST_API_KEY="$(cat ~/.secrets/pentest-key)"

config.yaml may end up holding (or revealing the path to) live secrets; chmod 600 ~/.config/goose/config.yaml is the minimum hygiene. If restic / borg / rclone covers ~/.config/, those backups carry the key — rotate after first install if backups already ran.

Tools

Tool Verb + path
pentest_list_targets GET /pentest/targets
pentest_run_scan POST /pentest/run
pentest_get_run GET /pentest/runs/{job_id}
pentest_recent_findings GET /pentest/findings
pentest_get_finding GET /pentest/findings/{id}
pentest_resolve_finding PUT /pentest/findings/{id}/resolve

Full request/response shapes: see BACKEND_CONTRACT.md.

Blast radius

The extension's surface is exactly the six endpoints above. It cannot:

  • shell out (no exec / command tool)
  • read or write files outside the HTTP contract
  • escape the API perimeter your backend enforces

So an LLM with access to this extension can do at most what an authenticated client with your API key could do. The whitelist is enforced on the backend (not in this extension), so a scan request for an off-list domain returns HTTP 400 — the LLM sees the error and adjusts.

If you co-install an extension that does shell out (e.g. developer), the above guarantee no longer holds for that combined surface. Choose deliberately.

First smoke test

You: list my pentest targets
Goose: [calls pentest_list_targets] → example.com, shop.example.com, ...

You: any open findings on shop.example.com?
Goose: [calls pentest_recent_findings(project="shop.example.com")] → ...

If pentest_list_targets returns {"error": true, "status_code": 401}, PENTEST_API_KEY isn't reaching the subprocess — check env_keys: and your shell export. Connection errors mean PENTEST_API_BASE is wrong or the backend is unreachable.

Reference implementation

linux-ai-server hosts a FastAPI implementation of the full backend contract under /api/v1/security/pentest/* (Apache-2.0). It serves all six endpoints out of the box — point PENTEST_API_BASE at it and it works without an adapter:

PENTEST_API_BASE=https://your-host/api/v1/security

Files of interest:

  • app/api/security.py — endpoints + X-Pentest-Key auth (legacy X-Memory-Key also accepted for in-place migration)
  • automation/self-pentest.sh — example scan script the backend spawns

License

Apache-2.0. See LICENSE.

Metadata

Release files for goose-pentest-mcp 0.1.0

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

Source distribution (sdist)

Source distribution for goose-pentest-mcp 0.1.0
File Size Uploaded Provenance
goose_pentest_mcp-0.1.0.tar.gz 12.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for goose-pentest-mcp 0.1.0
File Interpreter ABI Platform
goose_pentest_mcp-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.3 kB

Release files / goose_pentest_mcp-0.1.0.tar.gz

Download URL goose_pentest_mcp-0.1.0.tar.gz
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
750c1fdfc1375c1cc1ee065fde7dcc6c917128838db1a35c34bc8a75182fb1db
BLAKE2b-256 checksum
How to use checksums
4f21375944e6026e18b097dd72d5fd331a5f422197d4a2a3104825bdcb9d954d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release files / goose_pentest_mcp-0.1.0-py3-none-any.whl

Download URL goose_pentest_mcp-0.1.0-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
46e2d112fd181ad86d563141cb0079cb6870bb4aee303be2c4ea292744ab21cd
BLAKE2b-256 checksum
How to use checksums
fbf37a54b846ef0859846daded1bf478ae1fa5940c08ab3d1e6c08c7de8dec6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Security for goose-pentest-mcp 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.1.0 This release

2 release files No 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