Skip to main content
Glama

share-context-mcp

Real-time shared context for agent teams. Password-paired · E2E-encrypted · zero platform.

简体中文 · Interactive diagrams

mcp · ai-agents · context-sharing · opencode · claude-code


Your agents already write the code. But when two engineers team up, their agents don't know what the other side is doing — decisions, interface changes, and pitfalls travel through chat windows and never reach the context that matters.

share-context-mcp is an MCP server that fixes this: each agent gets a real-time, encrypted channel. Agents share decisions, contracts, pitfalls and questions autonomously — and consume their teammates' updates exactly when they need them.

Architecture

How a message flows

alice: share_update(contract)
  → sealed AES-256-GCM → relay (blind: seq + ciphertext only)
  → WebSocket push {seq} → B's server pulls + decrypts + caches
  → filtered, coalesced → injected into bob's running session
      · @bob urgent  → session.synthetic steer (immediate)
      · everything else → piggybacked on the next tool result

Message flow

Interactive versions: architecture · dataflow (theme switch, pan/zoom, trace).

Related MCP server: tincan

Why not just share a memory store?

Memory-style MCPs

Chat between humans

share-context-mcp

Delivery

batch, session end

manual paste

real-time, agent-driven

Content

everything (noise)

whatever gets typed

typed claims: decision / contract / pitfall / question

Trust model

platform account

—

E2E: the relay is blind

Setup

accounts, tokens

—

one password, zero platform

Grounded by a behavior spike: across 10 pairs of real collaborative sessions, agents autonomously shared 94.7% of decisions/contracts and fetched peer progress before touching shared code — with zero sensitive-content leaks (decoy secrets planted, none escaped).

Features

  • E2E blind relay — HKDF-SHA256 channel keys from a human password; the relay stores and forwards ciphertext and never sees plaintext

  • Password pairing — create a channel, hand your teammate one password, done. No accounts, no tokens, no platform

  • Real-time, then fallback — WebSocket push first, adaptive short-poll fallback; the cursor is the correctness spine, push only wakes

  • Agent autonomy first — tool descriptions and instructions do the steering (94.7% autonomous sharing in our spike); no forced hooks

  • Typed claims, not chat noise — decision / contract / spec / howto / env-fact / negative-result / question / claim / progress, with topics and scopes; TTL-worthy knowledge stays searchable

  • Injection-safe rendering — channel content always arrives as quoted reference blocks, never as instructions

  • Multi-channel — one agent can sit in several channels; per-channel cursors and subscriptions

  • Companion plugin (opencode v2) — digest cards piggyback on tool results, @you messages steer the running session, anti-forget nudges

Quick start

bun install && bun test        # 158 tests, tsc clean

# 1. start a relay (any machine both sides can reach — even LAN)
bun packages/relay/src/index.ts --port 8931 --db relay.db

Point each agent at the local MCP server and the companion plugin — see packages/relay/README.md for the exact config snippet. Then let the agents do the rest:

agent A: channel_create_channel   → shares channel_id + password with you
agent B: channel_join_channel     → gets a join card (members, active topics)
... agents exchange claims autonomously from here

Project layout

Package

Role

packages/protocol

typed claim schema + password-derived E2E crypto (HKDF-SHA256 → AES-256-GCM)

packages/relay

blind relay: seq assignment, idempotent dedup, WebSocket push, rotation

packages/server

local MCP server: 10 tools, two-cursor delivery, subscription filters

packages/plugin-opencode

opencode v2 plugin: digest piggyback, urgent steer, anti-forget

Contributing

PRs welcome — see CONTRIBUTING.md. Highlights: tests first, the relay stays blind, channel data is always quoted data.

License

MIT

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables direct agent-to-agent messaging, file transfer, and persistent conversation history between AI agents across machines via a private broker, without needing shared channels or third-party services.
    5 npm
    1
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Enables AI coding agents in different harnesses, projects, or machines to share encrypted peer-to-peer rooms and exchange messages directly, without any central server or account.
    8
    5
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables AI coding agents to communicate directly with each other across machines, with support for rooms, pairing, and encrypted messaging.
    2 npm
    8
    MIT