# Set up Redivivus for this agent

These are the instructions from the Redivivus project (https://redivivus.app) for connecting an AI agent to its Ghidra server. The server gives read access to the reverse-engineered Diablo II 1.14d `Game.exe` (Windows) and the Mac build of the same version.

Run the steps for your agent yourself. Sign-in happens in the browser with GitHub the first time a Redivivus tool is used; never ask the user for a token or password.

## Claude Code

```
claude plugin marketplace add jaenster/redivivus
claude plugin install redivivus@redivivus
```

The plugin brings the MCP server (`redivivus`, at `https://ghidra.redivivus.app/mcp`) and the house rules as a skill. Then tell the user to run `/reload-plugins` and then `/mcp`, and to sign in to `redivivus` with GitHub.

## Codex

```
codex mcp add redivivus --url https://ghidra.redivivus.app/mcp
codex mcp login redivivus
```

## Cursor, GitHub Copilot and others

Add this under `"mcpServers"` in `.cursor/mcp.json`, `.vscode/mcp.json` or your agent's MCP config:

```json
"redivivus": { "url": "https://ghidra.redivivus.app/mcp" }
```

Sign-in starts on the first Redivivus tool call.

## How to work with it

- Every tool takes `program`: `"win"` (1.14d `Game.exe`, the default and ground truth) or `"mac"`.
- The server is read-only. Address functions and data by address (`0x00456789`), not by name.
- Tool results are TOON: objects are `key: value` lines, uniform arrays are tables `name[N]{col,col}:` with one comma-separated row per line. Multi-line text (pseudocode, comments, hex dumps) follows as its own plain-text block, headed `--- N: <field> <address> ---`, and the field reads `<see text block N>`. A result TOON would not shrink comes as JSON. TOON is the default on every new connection; `set_output_format` with `json` switches, `toon` switches back. Tool arguments are JSON as usual.
- Read the house rules before proposing a name, type or prototype: https://redivivus.app/agent-setup/rules.md
- Read the Ghidra traps before proposing a type, prototype or calling convention: https://redivivus.app/agent-setup/reference.md

## Proposing a correction

Corrections go through the `propose` tool: one claim per proposal, made of edits (names, types, prototypes) by address, each with the value you saw and evidence a reviewer can re-check (an xref, a call site, the Mac counterpart, an assert string). "It looks like" is not evidence. A proposal holds up to 250 edits applied all-or-nothing, so a bulk sweep of one kind (every parameter of a family of functions, say) can go as one claim; there is no cap on how many proposals you submit. The tool checks the proposal live against the databases (a large one takes a few minutes); `proposal_status` follows it through review. Approved proposals are applied to Ghidra and the regenerated source with the contributor as git author. All proposals: https://redivivus.app/proposals

## When done

Tell the user:

> Redivivus is set up. The `redivivus` MCP server is added; reload your agent and sign in with GitHub when asked.
