Skip to main content
Opfor can run as an MCP server, exposing its workflow as tools that any MCP-compatible assistant (Cursor, Claude Desktop, Windsurf) can call. Your assistant runs a full red-team from chat — no terminal required.
This is different from attacking an MCP server as a target. Here, opfor is the MCP server. To test an MCP server, see MCP mode in the CLI.

How it works

The assistant calls three tools in sequence:
1

opfor_list_evaluators

Discover available evaluator IDs and suites. Call this first when you haven’t named specific evaluators.
2

opfor_setup

Configure a target and write opfor.config.json. Returns the config path.
3

opfor_run

Generate attacks on the fly, run them, judge responses, and write HTML + JSON reports.
No pre-generated attack file is needed — opfor_run handles generation, execution, and reporting in one shot.

Install

Or run directly via npx without cloning (see the npx tab above).

Register the server

Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project-scoped):
The server reads API keys from your project’s .env automatically — no env block needed in the config.

Usage

Once registered, just talk to your assistant:
It calls opfor_list_evaluatorsopfor_setupopfor_run and returns a findings summary in chat, with reports saved to disk.

Tools reference

opfor_list_evaluators

No parameters. Returns every evaluator ID, severity, standards map, and all predefined suites.

opfor_setup

Configures a run and writes opfor.config.json. Returns the config path to pass to opfor_run.
Agent target (target_kind = "agent"):Client-owned targets set only agent_session_send_*; server-owned targets (the target returns its own id) also set agent_session_receive_*. See session handling.MCP target (target_kind = "mcp"):
Evaluator selection (pick one):LLM configuration:LLM object: { provider, model, api_key_env, base_url? }.Run settings:

opfor_run

Runs the full evaluation from a config produced by opfor_setup.

API key resolution

The server resolves keys in order:
  1. The env var named in the LLM config’s api_key_env
  2. The provider’s default env var (e.g. OPENAI_API_KEY for openai)
It loads .env from the working directory automatically — keys never go in the MCP config JSON.

Providers

Supported providers and their default env vars.