Skip to main content
Glama

PyRIT MCP Server

An MCP (Model Context Protocol) server that exposes Microsoft's PyRIT AI red-teaming framework as a set of structured, discoverable tools for MCP-compatible agents (Claude Code, Antigravity, etc.).

This server is an execution layer only. It does not contain pentesting methodology, does not decide which attack to run, and does not hardcode attack sequences. The calling agent is responsible for all planning and decision-making; this server just executes what it's told, against authorized targets, and returns structured results.

Quickstart

uv sync
uv run python server.py

This starts the server on stdio, ready to be attached to an MCP client. See docs/examples.md for Claude Code / Antigravity client configuration.

Related MCP server: Maester MCP Server

What it does

  • Engagements: independent, stateful red-team sessions (create_engagement, list_engagements, get_engagement, close_engagement).

  • Targets: configure any REST/JSON chat endpoint as an attack target (configure_target, get_target, validate_target).

  • Attacks: run/continue/cancel any of PyRIT's attack strategies against a target (list_attack_strategies, run_attack, continue_attack, cancel_attack).

  • Scoring: score any response with a PyRIT scorer (score_response, get_scores).

  • Reports: generate JSON/Markdown/HTML reports from engagement findings, scores, and timeline (generate_report, list_reports, export_report).

  • Discovery: introspect what's available (get_server_info, get_pyrit_version, list_capabilities).

  • Findings: record and list findings on an engagement (add_finding, list_findings).

See docs/tool_reference.md for the full tool reference.

Documentation

Requirements

  • Python 3.12+

  • uv (or Poetry)

Testing

uv run pytest

Security notes

This server is designed for authorized AI security assessments only. It stores no API keys in reports, redacts auth tokens/headers in every serialized view, and never logs secret values. It sends real HTTP requests to whatever endpoint you configure as a target -- only point it at systems you are authorized to test.

Contributing

Contributions are welcome. See CONTRIBUTING.md.

License

MIT

Available Tools

22 tools
add_findingC

Record a finding on an engagement (e.g. a confirmed jailbreak or policy violation).

Findings are included in generated reports. The agent decides what constitutes a finding; the server only stores it.

Inputs: title (required), description (required), engagement_id (required), evidence, +1 more. Returns: data, error, success

cancel_attackC

Cancel a currently running attack within an engagement.

Inputs: attack_run_id (required), engagement_id (required). Returns: data, error, success

close_engagementB

Close an engagement, cancelling any attacks still running within it.

Inputs: engagement_id (required). Returns: data, error, success

configure_targetA

Configure (or replace) the REST chat target for an engagement.

    `target.request_template` is the JSON body sent to the endpoint, with the
    literal token `target.prompt_placeholder` (default "{{PROMPT}}") substituted
    with the outgoing prompt text anywhere it appears. `target.response_text_path`
    is a dotted/indexed path used to extract the reply text from the JSON response
    (e.g. "choices.0.message.content").
    

Inputs: target (required), engagement_id (required). Returns: data, error, success

continue_attackC

Continue a previous attack conversation with a new objective/turn.

Inputs: objective (required), attack_name (required), engagement_id (required), conversation_id (required), +2 more. Returns: data, error, success

create_engagementA

Create a new, independent AI red-team engagement and return its id.

The returned engagement id must be used for all subsequent target/attack/ scoring/report tool calls that operate within this engagement.

Inputs: name (required). Returns: data, error, success

export_reportC

Copy a previously generated report to an arbitrary destination path.

Inputs: report_id (required), engagement_id (required), destination_path (required). Returns: data, error, success

generate_reportA

Generate a report (format: json, markdown, or html) for an engagement.

    The report includes an executive summary, findings, scores, metadata, and
    a timeline of engagement events. The file is written under the server's
    report output directory and tracked on the engagement.
    

Inputs: engagement_id (required), title, format. Returns: data, error, success

get_engagementA

Get the current summary state of a single engagement by id.

Inputs: engagement_id (required). Returns: data, error, success

get_pyrit_versionA

Get the installed PyRIT framework version.

Inputs: no named parameters. Returns: data, error, success

get_scoresC

List all scores recorded so far within an engagement.

Inputs: engagement_id (required). Returns: data, error, success

get_server_infoB

Get PyRIT MCP server identity, version, and current engagement counts.

Inputs: no named parameters. Returns: data, error, success

get_targetB

Get the currently configured target for an engagement (secrets redacted).

Inputs: engagement_id (required). Returns: data, error, success

health_checkA

Basic liveness check for the MCP server.

Inputs: no named parameters. Returns: data, error, success

list_attack_strategiesA

List available PyRIT attack strategies and their constructor parameters.

Discovery only -- this does not recommend or select a strategy. The calling agent must choose which attack to run based on its own plan.

Inputs: no named parameters. Returns: data, error, success

list_capabilitiesA

List discoverable server capabilities: attack strategies, scorers, datasets, report formats.

    Discovery only. The agent is responsible for deciding which capability to use.
    

Inputs: no named parameters. Returns: data, error, success

list_engagementsA

List all engagements, optionally filtered by status ('active' or 'closed').

Inputs: status. Returns: data, error, success

list_findingsC

List all findings recorded so far on an engagement.

Inputs: engagement_id (required). Returns: data, error, success

list_reportsC

List all reports generated so far for an engagement.

Inputs: engagement_id (required). Returns: data, error, success

run_attackA

Run a named PyRIT attack strategy against the engagement's configured target.

    Starts a new conversation. Use `continue_attack` to keep talking within the
    same conversation. Optionally scores the final response with `scorer_names`.
    

Inputs: objective (required), attack_name (required), engagement_id (required), scorer_names, +2 more. Returns: data, error, success

score_responseC

Score arbitrary text (e.g. a target response) with a named PyRIT scorer.

    Returns success/confidence/risk/explanation/raw_score/metadata per PRD contract.
    Scorers that require an LLM judge (see list_capabilities) reuse the engagement's
    configured target as the judge model.
    

Inputs: text (required), scorer_name (required), engagement_id (required), scorer_params, +1 more. Returns: data, error, success

validate_targetC

Send a lightweight connectivity check to the engagement's configured target.

Inputs: engagement_id (required). Returns: data, error, success

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 22 tools

    Disambiguation5/5

    Each tool targets a distinct action (create, configure, run, cancel, etc.) on a specific resource (engagement, target, attack, finding, report). The list tools clearly differentiate by what they list, and get vs list tools are distinct. No two tools have ambiguous boundaries.

    Naming Consistency5/5

    All tool names use consistent verb_noun snake_case (e.g., create_engagement, run_attack, list_findings). The verbs are varied but follow a predictable pattern, and there is no mixing of naming conventions or vague verbs.

    Tool Count5/5

    22 tools is well-scoped for an AI red-team engagement server, covering engagement management, target configuration, attack execution, scoring, reporting, and status queries. Each tool earns its place without feeling excessive or insufficient.

    Completeness5/5

    The tool set provides full lifecycle coverage: create/close engagements, configure/validate targets, run/continue/cancel attacks, score responses, add findings, generate/export/list reports, and list capabilities. No obvious gaps exist that would hinder an agent from completing typical red-team workflows.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Exposes the Maester security test framework for Microsoft 365/Entra/Defender as MCP tools, enabling AI agents to run tests, audit AI agents and MCP servers, and investigate security posture.
      9
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables LLM-driven security assessments by exposing Kali tools like nmap, httpx, sqlmap, and ffuf as MCP tools, with explicit planning, parallel tool calls, tiered memory, MITRE ATT&CK mapping, and human approval gates for intrusive operations.
      2
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to orchestrate 100+ security tools over MCP for authorized penetration testing, including recon, scanning, exploitation, attack-chain planning, and knowledge-base retrieval.
      7
      Apache 2.0