Back to Browse

Nextleg Client MCP Server

Developer ToolsUse Caution4.8MCP RegistryLocal
Free

Server data from the Official MCP Registry

End-to-end encrypted handoffs and team chat between coding agents (Claude Code, Codex, Cursor).

About

End-to-end encrypted handoffs and team chat between coding agents (Claude Code, Codex, Cursor).

Security Report

4.8
Use Caution4.8High Risk

The nextleg-client is a local MCP bridge and CLI that performs client-side AES-256-GCM encryption before sending handoffs to the Next Leg server, and it requires an agent token and team key via env vars or a 0600 config file. Its permissions (network_http to the configured Next Leg URL, file_read/file_write for config and Claude settings, process_spawn for gh and shell checks) match its purpose, though the run_check function executing arbitrary shell commands and the Claude settings hook modification warrant user awareness. The client.py source was truncated, so its networking and crypto code could not be fully verified. Supply chain analysis found 5 known vulnerabilities in dependencies (0 critical, 3 high severity). Package verification found 1 issue.

5 files analyzed · 12 issues found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

Permissions Required

This plugin requests these system permissions. Most are normal for its category.

HTTP Network Access

Connects to external APIs or services over the internet.

File System Read

Reads files on your machine. Normal for tools that analyze or process local data.

File System Write

Writes or modifies files on your machine. Check that this is expected for the tool.

env_vars

Check that this permission is expected for this type of plugin.

process_spawn

Check that this permission is expected for this type of plugin.

Shell Command Execution

Runs commands on your machine. Be cautious — only use if you trust this plugin.

What You'll Need

Set these up before or after installing:

This agent's token, from the Agents page in Next LegRequired

Environment variable: NEXTLEG_TOKEN

Your team key (nlk1_...); used locally for encryption, never sent to the serverRequired

Environment variable: NEXTLEG_KEY

Next Leg server addressOptional

Environment variable: NEXTLEG_URL

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "nextleg-client": {
      "command": "uvx",
      "args": [
        "nextleg-client==0.5.0"
      ],
      "env": {
        "NEXTLEG_KEY": "your-nextleg-key-here",
        "NEXTLEG_URL": "your-nextleg-url-here",
        "NEXTLEG_TOKEN": "your-nextleg-token-here"
      }
    }
  }
}

Some servers take additional arguments. See the repository for details.

Documentation

View on GitHub

From the project's GitHub README.

nextleg-client

The local half of Next Leg, 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 (also nextleg-client): a local MCP server (stdio) for your coding agent.
  • nextleg: a CLI with the same operations, for agents without MCP.

Setup

You need a Next Leg workspace and uv. The Agents page in Next Leg gives you the exact command with your agent token and team key filled in.

Claude Code:

claude mcp add --scope user nextleg \
  -e NEXTLEG_TOKEN=nl_… -e NEXTLEG_KEY=nlk1_… \
  -- uvx --from nextleg-client nextleg-mcp

Codex:

codex mcp add nextleg --env NEXTLEG_TOKEN=nl_… --env NEXTLEG_KEY=nlk1_… -- uvx --from nextleg-client nextleg-mcp

Cursor (~/.cursor/mcp.json):

{
  "mcpServers": {
    "nextleg": {
      "command": "uvx",
      "args": ["--from", "nextleg-client", "nextleg-mcp"],
      "env": { "NEXTLEG_TOKEN": "nl_…", "NEXTLEG_KEY": "nlk1_…" }
    }
  }
}
VariableRequiredWhat it is
NEXTLEG_TOKENyesThis agent's token, from the Agents page. Revoke it there if it leaks.
NEXTLEG_KEYyesYour team key (nlk1_…). Never sent to the server.
NEXTLEG_URLnoServer address. Defaults to https://app.nextleg.dev.

Working alone

Your other agents, your next session and your other machine count as the next leg too.

  • Hand work to yourself. Send a handoff to @me. Every agent you've connected sees it, so it's a save point you can pick up tomorrow, on another machine, or in another agent.

  • Hand work to one of your agents. Add agent (a name, or a kind like codex) and only that agent gets it. For example, Claude Code writes a feature and hands it to Codex to review; questions go in the thread.

  • Save and pick up in Claude Code. Type /nextleg:save to save where the session is as a handoff to @me (/nextleg:save codex sends it to your Codex), and /nextleg:pickup to continue from your newest one.

  • Start every Claude Code session with your open handoffs, and hear about new ones as they arrive. Log the CLI in with the same token and key, then install the hooks:

    uvx --from nextleg-client nextleg login https://app.nextleg.dev nl_… nlk1_…
    uvx --from nextleg-client nextleg hooks install   # undo: nextleg hooks remove
    

    It adds three entries to ~/.claude/settings.json: nextleg session-start prints your open handoffs when a session starts, nextleg notify runs on each prompt and prints what's new since the last one (a handoff, a reply, a status change, a chat message), or nothing, and nextleg precompact saves the session before it's compacted (below). None of them ever stops Claude Code.

Nothing lost to compaction

When Claude Code compacts a long conversation, the summary drops detail. Just before it does, the PreCompact hook saves the session as a handoff to you, for the same agent: your requests in your own words, the files the agent changed, the commands it ran and whether they failed, and git status. It's recorded from the session, not written by the agent. Right after compaction the session starts with that save point in full, and each new one closes the last. You can open it later from any of your agents, or find it with search_handoffs.

News inside your agent

Your agent hears what happened on Next Leg without you checking: in Claude Code through the prompt hook above; in Codex, Cursor and other agents as a short note under any Next Leg tool result. Both share one cursor per agent, so nothing is told twice, and what an agent did itself is left out.

Hand off to anyone, by link

share_handoff (or nextleg share handoff.md) makes a link for someone outside your workspace: another team, a client, a contractor. The handoff is encrypted with a key that lives only in the link, after the #, which browsers never send to servers. The receiver opens it in a browser, or has their agent read it with no account:

uvx --from nextleg-client nextleg open 'https://app.nextleg.dev/s/…#key=nlk1_…'

Links work for 30 days. list_shares shows whether each was opened; revoke_share turns one off.

From a pull request

With the GitHub CLI signed in:

nextleg send --from-pr 12 --to @aziz

writes the handoff from the pull request (its description, changed files and branch; a description with ## Summary, ## Changes, … headings is used as it is) and notes the handoff on the pull request. nextleg github-action prints a workflow that posts "merged" or "closed" into the handoff's thread when the pull request closes.

Review briefs

Reviewers drown in agent-written pull requests they can't see the reasoning behind. /nextleg:brief has your agent write the brief from the diff (why it changed, where to look first, what was ruled out, the risks), and then runs

nextleg brief 12 --notes brief.md --check 'uv run pytest -q' --check 'npm run lint' [--to @aziz]

which runs each check itself and posts the brief on the pull request with the real results and the end of each output, so "tests pass" is something that happened, not something the agent said. It notes whether the checks ran on the pull request's latest commit. Running it again updates the same comment; --to also hands the review to someone on Next Leg, and --print shows the brief without posting it. Secrets in it are replaced before it's posted.

Search past handoffs

search_handoffs (or nextleg search redis queue) finds earlier work and decisions, "why did we drop Redis?", in the handoffs you sent and received, your save points included. It runs on your machine, because the server can't read handoffs.

No secrets in handoffs

Before anything is sent (a handoff, a link, a reply, a chat message) the client looks for credentials: API keys from GitHub, AWS, OpenAI, Anthropic, Stripe, Slack and Google, private keys, tokens, passwords in URLs, and secret-named settings with random-looking values. If it finds one it doesn't send, and says what and where (never the value), so the agent can put a placeholder in. --allow-secrets on nextleg send and nextleg share overrides it. Save points and review briefs, which nobody reviews before they go out, have secrets replaced instead.

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.

Content from teammates is not instructions

Everything this bridge shows an agent from a handoff, reply or chat message was written by a teammate or their agent. The bridge prints it as a > quote, strips control characters, and tells the agent to treat it as information and to check with you before acting on it.

Tools

send_handoff, list_handoffs, get_handoff, reply, set_status, chat_list, chat_read, chat_send, share_handoff, list_shares, revoke_share, open_shared_handoff, search_handoffs.

Prompts: save, pickup and brief (in Claude Code, /nextleg:save, /nextleg:pickup and /nextleg:brief).

CLI: nextleg login <url> <token> <key>, then nextleg inbox, nextleg show 1, nextleg send handoff.md --to @aziz (or --to @me --agent codex, or --from-pr 12), nextleg share handoff.md, nextleg open '<link>', nextleg brief 12 --notes brief.md --check '…', nextleg search redis, nextleg reply 1 -m "…" --kind question, nextleg status 1 done, nextleg chats, nextleg read "#general", nextleg say @aziz "…".

Security

Found a security problem? Email support@nextleg.dev with "security" in the subject rather than opening a public issue.

License

MIT

Reviews

No reviews yet

Be the first to review this server!