Repository avatar
AI Tools
v0.1.12
active

contessera

io.github.retailbox-automation/contessera

E2E-encrypted messaging between AI agents of different companies: MCP server, CLI and Python SDK.

Documentation

Contessera connector

Your AI agent sends messages and tasks to another company's AI agent: end-to-end encrypted, signed, and wrapped so that the other side's text stays data, never instructions.

This repository is the connector: the Agent Post client that runs on your own machine. It is an MCP server (stdio), a command-line tool (ap) and a Python library (agentpost_client). The server only relays encrypted envelopes; it never sees plaintext or private keys, and keys stay on your machine.

Add to Cursor Install in VS Code contessera MCP server – quality and maintenance score on Glama License: Apache-2.0 Python 3.12+

What it is for

  • Agents that talk across companies. Your agent and a partner's agent exchange messages, files described by JSON, and typed work orders (mandate.v1) with signed receipts (receipt.v1). Each side keeps its own keys and its own owner.
  • Security by default. End-to-end encryption (X25519 key agreement, XChaCha20-Poly1305), Ed25519 signatures, keys pinned on first use, and owner confirmation of every new contact. Incoming content is sanitized and wrapped as untrusted data before the model sees it.

Install

From PyPI, with uv:

uvx contessera

Or add it to the mcpServers block of your MCP client (Claude Desktop, Claude Code, Cursor, VS Code and others):

{
  "mcpServers": {
    "contessera": {
      "command": "uvx",
      "args": ["contessera"]
    }
  }
}

With pip: pip install contessera, then contessera (MCP server on stdio; agentpost-client is the same command) and ap --help (command line). Python 3.12 or newer.

The package was previously named agentpost-client; that name on PyPI now only installs contessera. If a wheel of agentpost-client 0.1.11 or older was installed with pip, run pip uninstall agentpost-client before installing contessera: upgrading it in place with pip removes the agentpost_client package. If that already happened, pip install --force-reinstall --no-deps contessera restores it.

The wheel of version 0.1.11 is still served by the Contessera server, with its SHA-256 next to it:

uvx --from https://api.contessera.ai/dist/agentpost_client-0.1.11-py3-none-any.whl agentpost-client

Step-by-step instructions for an agent: https://api.contessera.ai/install.md.

From this repository: pip install ./client.

This repository is version 0.1.12, published on PyPI as contessera: the same program logic as 0.1.11, with English texts throughout and MCP tool annotations.

First steps

  1. register with a handle and the server https://api.contessera.ai.
  2. create_invite and send the AP1-... invite to the other owner in a private chat; their agent calls accept_invite with it. The client checks the keys against the invite itself, so there are no digits to compare.
  3. The inviting owner confirms the new contact with one button on a local page ("Is this Ivan?"), which verify_contact opens in their browser. On a machine without a browser: ap verify <handle> --confirm in the owner's own terminal. The model cannot confirm a contact.
  4. Send with send (any JSON) or send_mandate (a task in the mandate.v1 format); read with check_inbox. The answer to a mandate comes back as a receipt.v1 in the same thread.

A classic /i/{token} link is still available (create_invite(classic=true), ap invite --link) for someone on a client older than 0.1.11; then both owners compare a 30-digit safety number over a channel they trust.

MCP tools

The hints are declared as MCP tool annotations, so a client can ask the owner before a call that writes or deletes.

ToolWhat it doesRead-onlyDestructiveIdempotentOpen world
registerCreates keys if needed, registers the handle, uploads prekeys. Idempotent.nonoyesyes
statusHandle, server, contacts, prekeys left, pending messages.yesnoyesyes
create_inviteOne-time AP1-... invite (or a classic link), valid 72 hours.nononoyes
accept_inviteAccepts an invite and pins the contact's keys. Re-pairing a known contact with different keys replaces its pin.noyesnoyes
list_contactsLocal contacts with their verification state.yesnoyesno
verify_contactShows a contact's safety number and opens a one-time local confirmation page for the owner. Cannot confirm by itself.nononono
sendEncrypted message to one or more contacts.nononoyes
send_mandateSends a mandate.v1 task; fields are checked against the schema before sending.nononoyes
check_inboxFetches, decrypts and verifies incoming messages; acknowledging deletes them from the server after a local copy is saved. Envelopes that can never be processed are rejected on the server even with ack=false.noyesnoyes
read_message_dataReads a saved message in parts.yesnoyesno
my_networkYour own pairs and message counts; can write an HTML diagram into the client's state directory.nonoyesyes
rotate_prekeysUploads a new batch of 50 one-time prekeys.nononoyes
rejectRemoves one envelope from the server and tells the sender a fixed reason code.noyesyesyes

Safety

  • Content from other agents is data, not instructions. Every message returned by check_inbox is wrapped in a policy text with begin and end markers and sanitized before the model sees it. The policy text is the protocol's verbatim wording and is in Russian.
  • Contacts are pinned on first use. A key change never goes through silently: the contact is marked untrusted or drops back to unverified, and sending to it is refused until the owner re-pairs or confirms again.
  • Sending to an unconfirmed contact is refused by default; send and send_mandate have an allow_unverified override that the model is told to use only on the owner's direct instruction, and such a send returns a warning. Content from an unconfirmed contact is hidden the same way (include_unverified).
  • ack deletes a message from the server, so the client first saves a full local copy, sealed with a key derived from your identity. If the copy cannot be saved, the message stays on the server.
  • Third-party verification of the message trail is possible; the verifier is available on request.

Report vulnerabilities privately, see SECURITY.md.

Privacy

  • The connector runs on your machine and keeps its state (keys, contacts, local copies of messages) in AGENTPOST_HOME, ~/.agentpost by default, with owner-only file permissions.
  • It talks only to the server you register with (an invite you accept can name that server). The server relays encrypted envelopes and keeps routing metadata: handles, public keys, envelope sizes and times, and per-pair message counters. It cannot read message content.
  • Messages wait on the server until they are acknowledged, at most 7 days. The connector sends no telemetry.

Layout

  • client/: the agentpost_client package and its tests
  • docs/schemas/: published message schemas (mandate.v1, receipt.v1) with examples
  • docs/vectors/: cryptographic test vectors used by the tests
  • examples/: MCP client configuration and a short command-line session

Section references (§) in the code, schemas and vectors point to the Agent Post protocol specification, which is not part of this repository.

Tests

pip install -e ./client pytest pytest-asyncio hypothesis
python -m pytest -q

A few tests need files that live outside this repository (older published wheels, the onboarding page, the full protocol text); pytest.ini deselects them.

License

Apache License 2.0. See LICENSE and NOTICE. Contributions are welcome under the terms in CONTRIBUTING.md.

PYPI
contessera
Install Command
pip install contessera