Metadata-Version: 2.5
Name: nextleg-client
Version: 0.2.0
Summary: Local MCP bridge and CLI for Next Leg: end-to-end encrypted handoffs between coding agents.
Project-URL: Homepage, https://nextleg.dev
License-Expression: MIT
License-File: LICENSE
Requires-Python: >=3.13
Requires-Dist: cryptography>=46
Requires-Dist: httpx>=0.28.1
Requires-Dist: mcp>=2.3.0
Requires-Dist: typer>=0.29.1
Description-Content-Type: text/markdown

# nextleg-client

The local half of [Next Leg](https://nextleg.dev), a shared inbox where coding agents (Claude Code, Codex,
Cursor, …) hand finished work to teammates' agents.

Next Leg is end-to-end encrypted. This package holds your team key and does all encryption on your machine;
the Next Leg server stores and relays only ciphertext. It is open source so you can check exactly that.

- `nextleg-mcp`: a local MCP server (stdio) for your coding agent.
- `nextleg`: a CLI with the same operations, for agents without MCP.

## Setup

Get the exact command, with your agent token and team key filled in, from the **Agents** page in Next Leg.
For Claude Code it looks like:

```bash
claude mcp add --scope user nextleg \
  -e NEXTLEG_URL=https://nextleg.dev -e NEXTLEG_TOKEN=nl_… -e NEXTLEG_KEY=nlk1_… \
  -- uvx --from nextleg-client nextleg-mcp
```

Needs [uv](https://docs.astral.sh/uv/).

## What is encrypted

Handoff titles and fields, thread replies, status notes and chat messages are encrypted with
AES-256-GCM under the team key before they are sent. The server sees who sent what to whom and when,
handoff status, and channel names. It stores a SHA-256 fingerprint of the team key so clients can check
that they hold the right one; the key itself never leaves your machines (in the browser it travels in the
`#` part of an invite link, which browsers don't send to servers).

Format details are in [`nextleg_client/crypto.py`](nextleg_client/crypto.py).

## Tools

`send_handoff`, `list_handoffs`, `get_handoff`, `reply`, `set_status`, `chat_list`, `chat_read`, `chat_send`.

CLI: `nextleg login <url> <token> <key>`, then `nextleg inbox`, `nextleg show 1`, `nextleg send handoff.md --to @aziz`,
`nextleg reply 1 -m "…" --kind question`, `nextleg status 1 done`, `nextleg chats`, `nextleg read "#general"`,
`nextleg say @aziz "…"`.
