Skip to main content
Glama
README.md
# LawryAI Desktop

**LawryAI Dev Drop #1** — the first public building block of LawryAI.

> **Own nothing. Orchestrate everything.**

Legal AI should not start with another shiny interface. It should start where law firms already
work: inside their existing systems. LawryAI Desktop is a local-first host that logs into the
software a firm already uses and re-exposes it to any
[Model Context Protocol](https://modelcontextprotocol.io) client (Claude Desktop, Cline, …), so an
AI agent can read and prepare work for a lawyer to approve.

The ERP stays the ERP. The case-management software stays the case-management software. The AI
layer connects, understands, and assists.

This repo is the **host**. The systems it talks to are **connectors**, each in its own repo. The
first one is a connector for [ActaPort](https://actaport.de), a German legal case-management
system. It is compiled into the binary — one download, no plugin installation.

## How it works

You log in yourself, and the host reuses that session, locally, on your behalf — it only ever
reaches what your own account already can:

1. The **desktop app** opens the service's login page in a WebView. You log in once; the app
   captures the session cookies into a local SQLite database.
2. The **same binary**, launched with `--stdio`, runs headless as an **MCP server**. Your MCP
   client spawns it as a subprocess; it replays the saved cookies and returns results as MCP tool
   calls.

Everything stays on your machine. There is no cloud proxy — calls go directly from your desktop to
the service. See [ARCHITECTURE.md](ARCHITECTURE.md) and [SECURITY.md](SECURITY.md).

### Host and connector

Authentication lives only in the host. A connector receives a read-only `SessionProvider` — it can
*use* a session the host captured, but has no way to log in, store a session, or open a WebView.

```
src-tauri/
├── src/                     auth · session · mcp · headless · recipes (composition root)
└── crates/recipe-core/      the connector SDK: Recipe trait, MCP tool types, SessionProvider
```

`recipe-core` is deliberately free of `tauri`, `reqwest`, `rusqlite` and `tokio`.

## Download

Grab the latest `.dmg` from [Releases](https://github.com/HeyLawry/lawryai-desktop/releases).
**macOS only for now** (universal — Apple Silicon and Intel). Windows builds compile but the login
flow has not been verified there yet, so they are not published. Linux is untested.

Two assets are attached to each release; the **`.dmg`** is the one you want (the `.app.tar.gz` is a
fallback).

### Installing (both steps are required)

1. Open the `.dmg` and drag **LawryAI** to your Applications folder.
2. Clear the quarantine flag:

   ```bash
   xattr -dr com.apple.quarantine /Applications/LawryAI.app
   ```

These builds are **unsigned** — there is no Apple Developer ID yet. Without step 2 macOS refuses to
open the app, and on Apple Silicon it reports it as *"damaged and can't be opened"*, which looks
like a corrupt download but is not. On macOS 15 and later, right-click → *Open* no longer works
around this.

> **Do not run the app from `~/Downloads`.** A quarantined app is launched through macOS *App
> Translocation* from a randomised read-only path, and the config panel copies whatever path the
> app is running from. You would paste a temporary path into your MCP client, it would work once,
> and then break. Moving to Applications *and* clearing quarantine both avoid this.
>
> Self-check: if the path shown in the app contains `/AppTranslocation/`, you skipped a step.

## Quick start

Prefer to build it yourself? Prerequisites: [Node.js](https://nodejs.org/) 18+,
[Rust](https://rustup.rs/), and the [Tauri prerequisites](https://tauri.app/start/prerequisites/)
for your OS.

```bash
npm install
npm run tauri dev      # develop (Vite + Tauri, live reload)
npm run tauri build    # release binary + bundle
```

Then:

1. Open the app and click **Login to ActaPort**; log in.
2. Copy the **Connect your MCP client** config it shows (it fills in the real binary path).
3. Paste it into your MCP client and restart the client.

### Claude Desktop config

```json
{
  "mcpServers": {
    "lawryai": {
      "command": "/absolute/path/to/LawryAI",
      "args": ["--stdio"]
    }
  }
}
```

On macOS the path is inside the app bundle, e.g. `/Applications/LawryAI.app/Contents/MacOS/LawryAI`.
The app's setup panel prints the correct path for you. Add `"--readonly"` to `args` to disable all
write tools.

The server reports itself as **LawryAI**, so your client lists one connector. Tools are grouped by
prefix — ActaPort's are `actaport_*`; future connectors add sibling prefixes.

Keep the app installed: when the session expires, open it and log in again — the MCP server reuses
that session.

## Tools

101 tools across 14 ActaPort modules, all carrying MCP annotations
(`readOnlyHint` / `destructiveHint`); destructive ones begin their description with `DANGEROUS:`.
The app lists every tool in your MCP client once you have logged in.

Write, send and delete tools are exposed by default. Your MCP client's own tool-approval UI is the
gate for each call. To remove the risk entirely, run with `--readonly` (or set
`LAWRYAI_READONLY=1`): write tools are hidden from the tool list **and** rejected if called.

## Build from source

The connector is a **private** git dependency: the published `.dmg` already bundles it, and building
the full app from source needs access to that repo. With access:

```bash
cargo build --manifest-path src-tauri/Cargo.toml
bash scripts/mcp_smoke.sh src-tauri/target/debug/lawryai-desktop
cargo test --manifest-path src-tauri/Cargo.toml
```

The smoke test drives a real MCP handshake against an empty session store and asserts the protocol,
the tool listing, a graceful "not authenticated" tool result, and read-only mode — no credentials
needed.

Tests are split across the two repos: 4 protocol tests here, 3 query/RSQL tests in the connector. A
green build here does **not** cover the connector's units.

There is no per-push CI — the project builds **only when a release tag is pushed**, and that job
runs clippy, the tests, and the smoke test against the bundled app before publishing a draft. So
run the commands above locally before you tag; nothing else will catch a break first.

To develop against a local connector checkout, point the dependency at it temporarily:

```bash
# in src-tauri/Cargo.toml
recipe_actaport = { package = "recipe-actaport-mcp", path = "../../recipe-actaport-mcp" }
```

## Status and roadmap

This is a first public artifact, not the finished product. See [ROADMAP.md](ROADMAP.md).

## License

AGPL-3.0-or-later — see [LICENSE](LICENSE).

If you run a modified version of this software as a network service, the AGPL requires you to make
your changes available to its users.

## Trademarks and use

LawryAI is not affiliated with, endorsed by, or sponsored by ActaPort or any other vendor it
connects to. "ActaPort" is a trademark of its respective owner, used here only to describe
interoperability. For help with LawryAI, use this repository's issues — **do not contact ActaPort
support**.

LawryAI acts only within a session you establish yourself, with your own credentials and your own
permissions; it circumvents no access control. You are responsible for ensuring your use complies
with your agreements with each vendor. Where a vendor offers an official integration API (ActaPort
offers a paid REST API add-on), that is the sanctioned path for automation.