Marshal

GitHub

Frontier AI to search and analyze complex discovery, at the lowest practical cost.

A case's budget doesn't grow with the size of its discovery. A matter with little money behind it can still come with a huge, messy production: scanned documents with bad OCR, hours of video and audio, phone extractions, email. The review platforms built for that volume are priced for the largest matters, so smaller cases get reviewed by hand. Marshal is for those cases. I built it for criminal defense discovery, but you can use it on any kind of case.

Marshal runs on your own computer. It converts the production into searchable text, including transcripts of the audio and video, and connects the case to Claude Cowork or Perplexity Computer. You ask questions in the chat app you already use and get answers with citations to the actual files, by path and Bates number.

Processing a medium-sized case costs about $20, once. After that, Claude Pro is about $20 a month. By medium I mean roughly 15–50 GB and 50–200 files: PDFs (often with bad OCR), photos, 5–15 hours of bodycam, calls, or surveillance, and sometimes a phone dump.

Examples of what you can ask

What's included

  1. Processing. Marshal reads documents and re-runs OCR on bad pages, transcribes audio and video with speakers and timestamps, describes photos and video frames, and lists the people and places in each file. It records a status and quality score for every file, so you can see what was produced and what didn't process cleanly.
  2. A connection to your AI app. From Cowork or Computer you can search the case, read any file, read phone chats, and pull cell-site records, with results cited by path and Bates.
  3. Browser review. A case overview, a document explorer, and full-text search with a preview pane.
  4. Viewers for defense work. Bodycam and dashcam on a shared timeline with a synced transcript, Cellebrite chats, and cell-site records on a map.
  5. A case notebook. Timelines, witness pages, cross outlines, theory, and motion notes, saved as pages that link back to the discovery. They're still there after the chat ends.

Using it with other tools

Cowork can connect to other services in the same conversation, so you can draft a motion that cites the discovery, quotes the email chain, and checks case law without switching programs.

ConnectorUsed for
MarshalSearching the discovery, opening files, writing notebook pages
OutlookEmail with the government and co-counsel
CourtListenerOpinions and dockets
PACER / RECAPFederal filings
Westlaw / LexisIf your office already subscribes

Security and confidentiality

Only you can connect. By default Marshal accepts connections only from the computer it runs on, and every request needs an access token it generates the first time you start it. To use it from your other devices, connect them with Tailscale.

Your files are never modified. The AI can search and read the discovery but can't edit, delete, or add files. Notebook pages, notes, and flags are stored in Marshal's own database.

Some content goes to outside services during processing: audio to OpenAI for transcription, text to Voyage for search, and images of badly scanned pages and photos to OpenAI or Anthropic. You can turn each of these off to keep everything local, at some cost to quality. The security section of the README lists exactly what goes where, so you can check it against your ethics rules and each provider's terms.

Check before you rely on it. Open the cited file and confirm what the AI told you before you put it in a filing or use it in court.

Getting started

You need a computer that can run long jobs overnight, Python 3.12+, uv, ffmpeg, a Voyage API key (search), an OpenAI API key (transcription), and Claude Pro for Cowork. API keys are billed separately from a ChatGPT or Claude subscription.

Before processing anything, set a spending limit or budget alert with each API provider. Marshal's cost estimate is only a ballpark, and odd files, like very long recordings or badly scanned documents, can drive the cost up.
git clone https://github.com/adam-elewa/Marshal.git
cd Marshal
uv sync

uv run marshal estimate "/path/to/case"      # what will this cost?
uv run marshal ingest "/path/to/case" --slug my-case --name "My Case"
uv run marshal serve                         # http://127.0.0.1:7340
uv run marshal token                         # access token + browser sign-in link

Open the sign-in link from marshal token to review the case in your browser. Then connect your AI app.

Connecting Claude or Perplexity

Claude on any device. Add Marshal as a custom connector on your Claude account and it works in claude.ai, Claude Desktop, Cowork and the mobile app, on any computer. Claude connects from Anthropic's servers, so Marshal needs a secure public address: a Cloudflare Tunnel, with Cloudflare letting only Anthropic's servers reach the connector and asking for an email login for everything else. Then in Claude, open Customize → Connectors → Add custom connector, enter your Marshal address, and add an authorization header with your token. The README has the step-by-step.

Claude Desktop and Cowork, same computer or Tailscale only. Install Node.js. In Claude Desktop, open Settings → Developer → Edit Config, add Marshal as below with your token after Bearer, then quit and reopen Claude. This works when Marshal runs on the same computer, or on another one on your Tailscale network (use its Tailscale address instead of 127.0.0.1).

{
  "mcpServers": {
    "marshal": {
      "command": "npx",
      "args": [
        "-y", "mcp-remote", "http://127.0.0.1:7340/mcp",
        "--allow-http", "--transport", "http-only",
        "--header", "Authorization:${MARSHAL_AUTH}"
      ],
      "env": { "MARSHAL_AUTH": "Bearer <your token>" }
    }
  }
}

Claude Code. One command:

claude mcp add --transport http marshal http://127.0.0.1:7340/mcp \
  --header "Authorization: Bearer <your token>"

Perplexity. Perplexity connects to Marshal from its own servers, so Marshal needs a secure public address, the same Cloudflare Tunnel as above, with Cloudflare Access letting only Perplexity through. Then in Perplexity, open Plugins → Add custom → Add MCP connector, choose Remote, and enter your Marshal address and token. The README has the step-by-step. This setup hasn't been tested end to end yet.

Rather not use the terminal?

Open Claude Code or Cowork, point it at the Marshal repo, and paste prompts like these, with your own folder path and case name:

Clone https://github.com/adam-elewa/Marshal, run uv sync, make sure my Voyage and OpenAI keys are set, and estimate the cost of ingesting /path/to/my-case with Marshal's estimate command. Summarize the cost and a rough time estimate, and stop for my approval before spending anything.

Ingest that folder as case my-case ("My Case") with a sensible number of workers for this machine. Tell me when it's done and list any files that failed. Then start the Marshal server, run marshal token, and set up the Marshal connector in Claude Desktop with that token.

Then, in a Cowork chat:

Using the Marshal tools, load get_instructions, describe what's in the production, and wait for my first question. Only cite paths and Bates numbers the tools return.

Forensic viewers (beta)

The forensic viewers are experimental. For now they cover two things: chats from Cellebrite phone extractions, and cell-site location records on a map. They're meant to speed up review, not to replace a forensic examiner. A phone extraction doesn't include everything on the phone, and cell-site records show which tower handled a call, not where the phone was. If it matters in court, have a qualified examiner check it.

License

Marshal is free software under the AGPL-3.0. You can use, study, and change it in a practice or public defender office. If you modify it or host it for others, you have to share your source under the same license, so no closed-source forks. Charging for setup, hosting, or support is fine.

Contributing

I'd like other defense lawyers to help build this, including those who don't write code. If you know what a case needs, whether that's a new viewer, a better way to build a timeline, or a fix, you can ask a coding assistant like Claude to make the change in the repo and send it back. The best improvements will come from lawyers who try cases.

To work together, email adamelewa@gmail.com.

Public beta. Not legal advice.