Skip to content

savinoo/agentbridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

agentbridge

TypeScript MCP Status License

Cross-IDE agent workflow orchestrator via MCP (Model Context Protocol).

Define workflows in YAML. Let AI agents from different IDEs — Claude Code, Google Antigravity, Cursor — execute them collaboratively, with automatic handoff between agents.

🎯 Why This Matters

MCP is the emerging standard for AI tool integration (backed by Anthropic). agentbridge is one of the first open-source orchestrators built on this protocol, enabling true multi-agent collaboration across development environments — a capability almost no other tool provides today.

The problem

In 2026, developers use multiple AI coding agents. Claude Code for deep reasoning and refactoring. Antigravity for visual browser testing. Cursor for quick edits. But these tools don't talk to each other. If you want one to fix a bug and another to verify it visually, you do it manually.

agentbridge solves this. It's an MCP server that orchestrates workflows across agents.

How it works

You define:                          agentbridge orchestrates:

  analyze (Claude Code)                  pending → running → done
       │                                          │
       ▼                                          ▼
  fix (Claude Code)                      blocked → pending → running → done
       │                                          │
       ▼                                          ▼
  verify-ui (Antigravity)               blocked → pending → running → done
       │                                          │
       ▼                                          ▼
  create-pr (Claude Code)               blocked → pending → running → done
       │                                   (condition: verify-ui == pass)
       ▼
  Workflow COMPLETED

Each agent connects to the same MCP server, claims tasks assigned to it, executes them, and reports results. When one finishes, the next one gets unblocked automatically.

E2E test: verified working

The full workflow was tested end-to-end with two simulated agents (Claude Code + Antigravity) connecting via separate HTTP sessions to the same MCP server:

=== Test execution ===

1. Claude Code  → claimed "analyze"     → completed
2. Claude Code  → claimed "fix"         → completed  (auto-unblocked after analyze)
3. Antigravity  → claimed "verify-ui"   → completed  (auto-unblocked after fix)
4. Claude Code  → claimed "create-pr"   → completed  (condition: pass == pass)

Final status: COMPLETED

{
  "name": "bug-fix-and-verify",
  "status": "completed",
  "steps": [
    { "id": "analyze",   "agent": "claude-code",  "status": "done" },
    { "id": "fix",       "agent": "claude-code",  "status": "done" },
    { "id": "verify-ui", "agent": "antigravity",  "status": "done" },
    { "id": "create-pr", "agent": "claude-code",  "status": "done" }
  ]
}

Dependency graph resolution, cross-agent handoff, conditional execution, and variable interpolation — all verified.

Install

git clone https://github.com/savinoo/agentbridge.git
cd agentbridge
npm install
npm run build

Quick start

1. Define a workflow

# workflows/bug-fix-verify.yaml
name: bug-fix-and-verify

input:
  - issue_url
  - repo_path

steps:
  - id: analyze
    agent: claude-code
    prompt: |
      Read the issue at {{input.issue_url}}.
      Analyze the codebase at {{input.repo_path}}.
      Identify the root cause.

  - id: fix
    agent: claude-code
    depends_on: [analyze]
    prompt: |
      Based on: {{steps.analyze.output}}
      Fix the bug. Run tests.

  - id: verify-ui
    agent: antigravity
    depends_on: [fix]
    prompt: |
      Open http://localhost:3000.
      Verify the fix visually. Take a screenshot.

  - id: create-pr
    agent: claude-code
    depends_on: [verify-ui]
    condition: "{{steps.verify-ui.output.status}} == 'pass'"
    prompt: Create a PR with the fix.

on_complete:
  webhook: "https://hooks.slack.com/your-webhook"
  message: "Bug fixed! PR: {{steps.create-pr.output.pr_url}}"

2. Run it

HTTP mode (recommended — multiple agents connect simultaneously):

node dist/cli.js run workflows/bug-fix-verify.yaml --http 3100 \
  --input issue_url=https://github.com/repo/issues/1 \
  --input repo_path=/code/myapp

Stdio mode (single agent):

node dist/cli.js run workflows/bug-fix-verify.yaml \
  --input issue_url=https://github.com/repo/issues/1 \
  --input repo_path=/code/myapp

3. Connect your agents

See config/SETUP.md for setup instructions for Claude Code and Google Antigravity.

4. Check status

node dist/cli.js status <workflow-id>

Architecture

┌──────────────┐                         ┌──────────────┐
│ Claude Code   │──── MCP (stdio/HTTP) ───│ Antigravity   │
│ (terminal)    │          │              │ (IDE+browser) │
└──────────────┘          │              └──────────────┘
                          ▼
              ┌─────────────────────┐
              │   agentbridge       │
              │   MCP Server        │
              │                     │
              │  ┌───────────────┐  │
              │  │ Workflow YAML │  │
              │  │ → step graph  │  │
              │  └───────┬───────┘  │
              │          │          │
              │  ┌───────▼───────┐  │
              │  │ SQLite store  │  │
              │  └───────────────┘  │
              └─────────────────────┘

MCP Tools

Tool Description
agentbridge_claim_task Get the next pending task for an agent
agentbridge_complete_task Report task completion with result
agentbridge_fail_task Report task failure
agentbridge_workflow_status Check workflow and step status

Workflow features

  • Dependency graph — Steps only unblock when their dependencies complete
  • Conditional execution — Skip steps based on previous outputs (condition: "{{steps.x.output.status}} == 'pass'")
  • Variable interpolation{{input.key}}, {{steps.step_id.output}}, {{steps.step_id.output.nested.field}}
  • Webhooks — Fire HTTP POST on completion/failure with interpolated payload
  • Persistence — SQLite-backed state survives restarts
  • Dual transport — Stdio (single agent) or Streamable HTTP (multiple agents, concurrent sessions)

Tech stack

Component Technology
MCP Server TypeScript + @modelcontextprotocol/sdk
State SQLite via better-sqlite3
Workflows YAML via js-yaml
HTTP Transport Streamable HTTP (MCP spec)
Runtime Node.js 20+

Project structure

agentbridge/
├── src/
│   ├── cli.ts        — CLI entry point (run, status, server)
│   ├── engine.ts     — Workflow engine (YAML, dependencies, interpolation)
│   ├── server.ts     — MCP server (stdio + HTTP, 4 tools)
│   └── state.ts      — SQLite store (workflows + steps)
├── config/
│   └── SETUP.md      — Agent configuration guide
├── workflows/
│   ├── bug-fix-verify.yaml
│   └── landing-page.yaml
└── ~600 lines of TypeScript

License

MIT

About

Cross-IDE agent workflow orchestrator via MCP. Define workflows in YAML, let AI agents from different IDEs (Claude Code, Antigravity, Cursor) execute them collaboratively.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors