Skip to main content
Glama

bridge-plugin (bridge / brg CLI, MCP Server & Universal Agent Skills)

Zero-dependency, agent-native CLI, Model Context Protocol (MCP) server, and Cross-Agent Skills (agentskills.io) SDK for Bridge (https://bridge.xray.tech).

Works across Claude Code, Claude Desktop, OpenAI Codex, Cursor, Windsurf, and Gemini CLI, as well as CI/CD pipelines (GitHub Actions, GitLab CI, Railway, Vercel).


Key Capabilities

  1. Universal 7-Day Organizational Context Gate (bridge context / bridge_context_pull):

    • Pulls a single distilled 7-day organizational snapshot from GET /api/v1/fleet/context:

      • Active & recently verified Tasks with 1-2 sentence verbatim speaker quotes & FactSource citations.

      • Strictly separates Spoken Claims (SPOKEN_CLAIM_RAIL_2 / TIER2_CANDIDATE, never treated as done) from Verified Proof (VERIFIED_PROOF_RAIL_3_5 / TIER1_READY & TIER0_AUTO).

      • Pending & recently resolved Decisions with winning options & weighted criteria (doNotViolate: true).

      • Active FleetLease locks & recent FleetSeams (win, decision, friction, handoff).

      • Latest ORG and TEAM Morning Briefs (bridge_brief_latest / /api/v1/briefs) plus active 72-hour Corrections.

      • Session-Reloaded Organization Custom Instructions (customInstructions): Automatically pulls organization-wide agent rules configured in Bridge (Settings → Organization Custom Instructions) and caches them locally at .bridge/org_instructions.md on every session start.

    • Opens every coding session with a 🟢 Green / 🟡 Yellow / 🔴 Red Alignment Check.

  2. Organization Custom Instructions (brg instructions):

    • Author once in Bridge (/settings#custom-instructions or brg instructions set --file ...) to customize how AI coding agents behave for every developer and harness in your organization at once.

    • Manage from the CLI with brg instructions show, brg instructions pull, brg instructions set, and brg instructions clear.

  3. Cross-Agent Skills Standard (agentskills.io / npx skills add XRAY-INC/bridge-plugin -g):

    • skills/bridge-context/SKILL.md — Context gate, spoken-claim vs verified-proof rule, custom instructions enforcement, and 🟢/🟡/🔴 Alignment Check.

    • skills/bridge-cli/SKILL.md — Complete shell guide (bridge / brg, BRIDGE_API_KEY, .bridge.json, semantic exit codes 0-4).

    • skills/bridge-api/SKILL.md — Direct REST API guide (https://bridge.xray.tech/api/v1/* with xrkey_v1 tokens).

    • skills/bridge-updates/SKILL.md — High-signal write-back protocol (bridge seam win|decision|friction, bridge decide propose, bridge handoff).

    • skills/bridge-afk/SKILL.md — Unattended Away-From-Keyboard (/afk) run protocol with savepoints, frozen files, worktree isolation, scope claims, and AFK_RECEIPT.md.

    • Dual marketplace manifests (.claude-plugin/marketplace.json, .claude-plugin/plugin.json, .agents/plugins/marketplace.json) and hooks/hooks.json (SessionStart context gate + PreToolUse brg guard).

  4. Local Safety, Savepoints, Frozen Files & Shared-Login Identity:

    • Shared-Login Teammate Identity (brg user <alias|email> [--session|--roster|--clear]): Resolves organization roster aliases (synced via brg context into .bridge/roster.json or configured via teamRoster / emailDomain in .bridge.json) on shared accounts or machines (~/.config/bridge/credentials.json or session-scoped .bridge/session_user.json) and attaches userEmail, actorEmail, and userName to every seam, claim, handoff, scratchpad entry, and decision card.

    • Off-Branch Savepoints, Undo & Automatic GC (brg savepoint, brg undo, brg rollback, brg savepoint prune): Creates deduplicated off-branch snapshots (refs/bridge-snapshots/<snap-id> with untracked trees stored in .git/objects + .git/bridge/snapshots.json, or content-addressed ~/.cache/bridge/snapshots for non-Git folders — zero unpacked copies in <repo>/.bridge/snapshots/), automatically prunes evicted refs and legacy .bridge/snapshots/ folders, and rewinds step-by-step without git reset --hard (rescuing newly created untracked files into .bridge/rescued/<snap-id>/).

    • Frozen File Locks & PreToolUse Guard (brg freeze, brg unfreeze, brg guard): Protects sensitive files (.env*, prisma/migrations/**, billing modules) and enforces cross-worktree scope claims and automatic pre-mutation savepoints before agent tool execution.

    • Non-Git Workspace Linking (brg init --project "<Project>" --client "<Workspace>" / brg link-project): Binds non-Git project folders to Bridge projects.

  5. Dual-Binary Ergonomics (bridge + brg) & Semantic Exit Codes (0-4):

    • Primary binary bridge + zero-collision 3-character alias brg.

    • TTY renders aligned tables; non-TTY pipes or --json emit deterministic JSON on stdout.

    • Exit codes: 0 (OK), 1 (Error), 2 (Concurrency/Decision Block), 3 (Auth Missing), 4 (Offline Spooled to .bridge/spool.jsonl).


Related MCP server: mcp-server

Installation

0. One-Command Machine Setup

export PATH="$HOME/.local/bin:$PATH"
export BRIDGE_API_KEY="xrkey_v1..."
curl -fsSL https://bridge.xray.tech/install.sh | sh

1. Universal Agent Skills (agentskills.io — Claude Code, Codex, Cursor, Windsurf, Gemini CLI)

npx skills add XRAY-INC/bridge-plugin -g

2. Python CLI & MCP Server (uv / pipx / pip)

uv tool install --force git+https://github.com/XRAY-INC/bridge-plugin.git
# or
pipx install --force git+https://github.com/XRAY-INC/bridge-plugin.git

3. Claude Code & Codex Plugin Marketplaces

/plugin marketplace add XRAY-INC/bridge-plugin
/plugin install bridge@bridge-plugin

4. One-Command Agent & Git Hook Setup

bridge setup
bridge setup claude
bridge setup cursor
bridge setup antigravity
bridge setup codex
bridge setup git-hooks

Quickstart

# 1. Authenticate with your Bridge API key (xrkey_v1...)
export BRIDGE_API_KEY="xrkey_v1..."
bridge auth login --api-key "$BRIDGE_API_KEY"

# 2. Bind your repository (.bridge.json)
bridge init

# 3. Pull 7-day organizational context, custom instructions & 🟢/🟡/🔴 Alignment Check
brg context --days 7 --team platform-eng --json
brg instructions show
brg briefs --json

# 4. Start a task branch and reserve file scope globs
bridge tasks start task_104 --slug oauth-pkce
bridge claim "src/auth/*" --ttl 30m --reason "OAuth PKCE flow"

# 5. Propose or check 1-Click Decisions when hitting a trade-off
bridge decide propose \
  --title "Token Storage Strategy" \
  --context "Choose between HttpOnly cookie session vs Web Worker token" \
  --options "HttpOnly Cookie,Web Worker Token" \
  --urgency HIGH

# 6. Log high-signal seams and close your turn with a handoff
bridge seam win "Implemented OAuth 2.1 PKCE verifier and unit tests"
bridge release --all
bridge handoff "PKCE verifier merged; next up: token rotation endpoint"

License

Bridge Customer SDK License — see LICENSE.

Available Tools

8 tools
bridge_brief_latestC

Fetch latest ORG/TEAM Morning Briefs and 72h Corrections.

Inputs: kind, team.

bridge_contextC

Read or update Bridge status, branch binding, claims, teammate user identity, and scratchpad.

Inputs: user, topic, session, write_body, +1 more.

bridge_context_pullC

Pull 7-day org context: tasks, quotes, citations, decisions, leases, seams, briefs & 72h corrections.

Inputs: days, repo, team.

bridge_decideC

List, propose, score, resolve, or check 1-Click Decisions (--to recipients, blocking/advisory).

Inputs: to, mode, score, title, +10 more.

bridge_factC

Ingest a bounded (<=280 char) verification fact for task reconciliation.

Inputs: statement (required), kind, task_id, confidence.

bridge_jobC

List, dispatch, claim, complete, or compile capsules for Bridge agent jobs.

Inputs: globs, notes, action, job_id, +3 more.

bridge_scopeC

Claim, release, list scope leases, or freeze/unfreeze/savepoint/undo local files.

Inputs: all, ttl, globs, action, +2 more.

bridge_seamC

Log, edit, retract, or list seams (win, decision, friction, handoff).

Inputs: tag, user, action, project, +5 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.8/5.0

    Scored across 8 tools

    Disambiguation3/5

    Each tool is nominally tied to a domain entity (brief, job, seam, scope, decision, fact), but bridge_context vs. bridge_context_pull are easy to confuse, and briefs/72h corrections appear in both. Several tools also multiplex many unrelated actions (list/dispatch/claim/complete/compile in bridge_job), so an agent must read the description carefully rather than relying on the tool name to pick correctly.

    Naming Consistency4/5

    All tools share a consistent 'bridge_' namespace prefix, which makes the set instantly recognizable. However, the suffixes are bare nouns with no verb, and bridge_context_pull breaks the noun pattern, so the name alone rarely tells you which operation you are invoking.

    Tool Count4/5

    Eight tools is a well-scoped count for an agent-coordination bridge, and each maps to a distinct domain concept. The caveat is heavy multiplexing inside single tools, which pushes a lot of surface area into few names rather than splitting cleanly.

    Completeness4/5

    The surface covers the core lifecycle: briefs, 7-day context, job dispatch/claim/complete, seams with log/edit/retract, scope leases, decisions with propose/score/resolve, and fact ingestion. Gaps are minor — there is no obvious dedicated messaging or teammate-facing tool beyond identity in bridge_context.

    Maintenance

    ActivityMaintained
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      An MCP server that exposes tools for issuing scoped agent credentials, delegating narrower child credentials, handling approvals, revoking task trees, and retrieving audit trails and evidence packets.
      14
      1
      Apache 2.0
    • F
      license
      Not graded
      quality
      D
      maintenance
      A universal MCP server for registering internal, external, and OpenAPI-based APIs as MCP tools. It exposes them to MCP clients via Streamable HTTP and provides admin portal, RBAC/session auth, credential injection, and audit logging.
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      This MCP server provides a stateful, resettable, verifiable API runtime that gates every tool call, enabling agents to run long workflows against provider-shaped environments without live provider write access. It records decisions, side effects, and outcome evidence for replayable, verifiable benchmark runs.
      Apache 2.0
    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables enterprise agent fleets to register workers, dispatch tasks by capability, monitor continuous heartbeat telemetry, trip automated circuit breakers, and recover from checkpointed state through a zero-dependency MCP server.
      MIT