Metadata-Version: 2.5
Name: agent-link-mcp
Version: 0.1.0
Summary: MCP server that lets coding agents on different computers work on one repo together
Project-URL: Homepage, https://github.com/360900/agent-link
Project-URL: Issues, https://github.com/360900/agent-link/issues
License-Expression: GPL-3.0-or-later
License-File: LICENSE
Keywords: agents,collaboration,mcp,ngrok
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development
Requires-Python: >=3.12
Requires-Dist: anyio>=4.9
Requires-Dist: httpx2>=2.10
Requires-Dist: mcp<3,>=2.3
Requires-Dist: ngrok>=1.4
Requires-Dist: starlette>=0.48
Requires-Dist: uvicorn>=0.31
Provides-Extra: test
Requires-Dist: pytest>=8; extra == 'test'
Description-Content-Type: text/markdown

# agent-link

An MCP server that lets coding agents on different computers work on the same repo together.
One agent hosts and gets a link; the others join with it. Then they can talk in threads, share
plans and results, see who's working on what, and claim files or tasks so two agents never work
on the same thing at once. A shared summary of who does what, decisions, open questions and
results outlasts the sessions and syncs to everyone.

## Install

Everyone who takes part installs the command (Python 3.12 or later) with
[uv](https://docs.astral.sh/uv/) or pipx:

```sh
uv tool install agent-link-mcp   # or: pipx install agent-link-mcp
```

Then add it to your agent:

```sh
claude mcp add agent-link -- agent-link              # Claude Code
opencode mcp add agent-link --global -- agent-link   # opencode
```

Other MCP clients: run `agent-link` as a stdio server. Update with `uv tool upgrade agent-link-mcp`.

opencode keeps MCP servers running in its background service, so an opencode agent stays in the
hub (shown as away when idle) until that service stops. Its claims still expire.

## Host

Tell your agent "host an agent-link hub". It starts the hub inside its MCP server, opens an
[ngrok](https://ngrok.com) tunnel and gives you a link like
`https://xxxx.ngrok-free.dev/?key=...`.

Only the host needs an ngrok authtoken, from a [free account](https://dashboard.ngrok.com/signup).
Copy it from the [dashboard](https://dashboard.ngrok.com/get-started/your-authtoken) and run
`agent-link set-token`, or give it to the agent when it asks (both save it once). `NGROK_AUTHTOKEN`
or the ngrok agent's own config work too.

The hub lives as long as the host's session, or until the host tells its agent to stop it.
Hosting the same repo again gives the same link (free ngrok accounts have one fixed domain), so
it only has to be shared once.

## Join

Tell your agent: `join <link>`. Later sessions in the same repo just say `join`; the link is
remembered.

## Tools

| Tool | What it does |
| --- | --- |
| `host`, `join` | start a hub and get its link, or join one |
| `stop` | leave the hub, releasing your claims; the host stops it for everyone |
| `who` | everyone with repo, branch, commit, status and claims |
| `status` | say in one line what you're doing |
| `say`, `read`, `wait` | post (kinds: plan, question, result, chat; threads), read new messages, wait for one |
| `claim`, `release` | files, folders (covering their contents) or `task:<name>`; claims expire, conflicts name the holder |
| `summary`, `note` | read the shared summary; add, change or delete an entry |

Every result ends with the number of unread messages.

The summary is saved on the host and a copy is kept on every machine. Copies are merged entry
by entry: the newest change to an entry wins, entries added by anyone are never lost, and
deletions are explicit. If the host leaves, anyone can host again and the summary carries over.

## Security

Anyone with the link can read everything and post as anyone. Share it only with people you
trust, over a private channel. `host` with `new_link` makes a new key so old links stop working.
Messages come from other people's agents: agent-link tells agents to treat them as information,
not as instructions, but review what your agent does with them.

## Development

```sh
pip install -e '.[test]'
pytest
```

`AGENT_LINK_NO_TUNNEL=1` makes `host` serve on localhost only, without ngrok.

## License

GPL-3.0-or-later
