Skip to main content

Claude CLI transcript indexer and MCP server

Project description

AgentiBridge

Cloudflare-backed persistent session controller for your Claude Code agents

AgentiBridge - Persistent session controller for your AI Agents

PyPI License: MIT Tests Docker Python 3.12+

flowchart LR
    E([Any AI Client]) -->|query| D{{MCP Tools}}
    D -->|read| C[(SessionStore)]
    C -->|indexed by| B[Collector]
    B -->|watches| A([Claude Code sessions])

    classDef sessions fill:#6366f1,stroke:#4338ca,color:#fff
    classDef collector fill:#f59e0b,stroke:#d97706,color:#fff
    classDef store fill:#10b981,stroke:#059669,color:#fff
    classDef tools fill:#8b5cf6,stroke:#7c3aed,color:#fff
    classDef client fill:#06b6d4,stroke:#0284c7,color:#fff

    class A sessions
    class B collector
    class C store
    class D tools
    class E client

Why AgentiBridge?

Your Claude Code sessions disappear when the terminal closes. AgentiBridge indexes every transcript automatically and makes them searchable, resumable, and dispatchable — from any MCP client.

  • 🔒 Security-first — OAuth 2.1 with PKCE, API key auth, Cloudflare Tunnel with zero inbound ports. Your data never leaves your infrastructure.
  • 🔍 AI-powered search — Semantic search with pgvector embeddings. Ask natural language questions across all your past sessions.
  • ⚙️ Automatic indexing — Background collector watches ~/.claude/projects/ and incrementally indexes new transcripts. No manual exports.
  • 🌐 Multi-client — Works with Claude Code CLI, claude.ai, ChatGPT, Grok, and any MCP-compatible client.
  • 🏠 Fully self-hosted — Postgres, Redis, and your data stay on your machine. No SaaS, no vendor lock-in.
  • 🚀 Background dispatch — Fire-and-forget task dispatch with session restore. Resume work where you left off.
  • Zero config to start — Filesystem fallback means no Redis or Postgres required for basic use. Scale up when you need to.

Quick Start

pip install agentibridge
agentibridge run
curl http://localhost:8100/health

Then add AgentiBridge to ~/.mcp.json:

{
  "mcpServers": {
    "agentibridge": {
      "url": "http://localhost:8100/mcp"
    }
  }
}

If you set AGENTIBRIDGE_API_KEYS, add "headers": {"X-API-Key": "your-key"} to the block above.

That's it. Your Claude Code sessions are now searchable from any MCP-compatible client.


CLI Commands

Stack

Command What it does
agentibridge run Start the stack
agentibridge run --rebuild Force pull and rebuild before starting
agentibridge stop Stop the stack
agentibridge restart Restart the stack
agentibridge logs View recent logs
agentibridge logs --follow Stream logs live

Status

Command What it does
agentibridge status Service health, container status, session count
agentibridge version Print version
agentibridge config View current configuration
agentibridge config --generate-env Generate a .env template
agentibridge help Full reference

Cloudflare Tunnel

Command What it does
agentibridge tunnel Show tunnel status and current URL
agentibridge tunnel setup Interactive wizard: install, auth, DNS, config

Dispatch Bridge

Command What it does
agentibridge bridge start Start the host-side dispatch bridge
agentibridge bridge stop Stop the dispatch bridge
agentibridge bridge logs Tail dispatch bridge logs

Client Setup

Command What it does
agentibridge connect Print ready-to-paste configs for all clients
agentibridge install --docker Install systemd service (Docker)
agentibridge install --native Install systemd service (native Python)
agentibridge locks View or clear Redis locks

MCP Tools

Foundation

Tool Example use
list_sessions "Show me my recent sessions"
get_session "Get the full transcript for session abc123"
get_session_segment "Show me the last 20 messages from that session"
get_session_actions "What tools did I use most in that session?"
search_sessions "Find sessions where I worked on authentication"
collect_now "Refresh the index now"

AI-Powered

Tool Example use
search_semantic "What were my sessions about database migrations?"
generate_summary "Summarize what happened in session abc123"

Requires embeddings + LLM configured. See Semantic Search.

Dispatch

Tool Example use
restore_session "Load the context from my last session on this project"
dispatch_task "Continue that refactor task in the background"
get_dispatch_job "What's the status of job xyz?"

Requires the dispatch bridge running on the host. See Session Dispatch.

Knowledge Catalog

Tool Example use
list_memory_files "What memory files exist across my projects?"
get_memory_file "Show me the MEMORY.md for the antoncore project"
list_plans "What plans have I created recently?"
get_plan "Show me the plan called moonlit-rolling-reddy"
search_history "Find prompts where I mentioned docker"

Exposes Claude Code's knowledge layer: project memory files, implementation plans, and prompt history.


Configuration

Remote Access

Variable Default Purpose
AGENTIBRIDGE_TRANSPORT stdio Set to sse for remote clients
AGENTIBRIDGE_HOST 127.0.0.1 Bind address
AGENTIBRIDGE_PORT 8100 Listen port
AGENTIBRIDGE_API_KEYS (empty) Comma-separated API keys; empty = no auth

Optional Features

Variable Purpose
POSTGRES_URL Enables semantic search (pgvector)
LLM_API_BASE OpenAI-compatible embeddings/chat endpoint
LLM_EMBED_MODEL Embedding model (e.g. text-embedding-3-small)
LLM_CHAT_MODEL Chat model for summaries (e.g. gpt-4o-mini)
ANTHROPIC_API_KEY Preferred for generate_summary (falls back to LLM_CHAT_MODEL)
CLAUDE_DISPATCH_URL Bridge URL for Docker → host Claude CLI dispatch
AGENTIBRIDGE_PLANS_DIR Plans directory (default: ~/.claude/plans)
AGENTIBRIDGE_HISTORY_FILE History file (default: ~/.claude/history.jsonl)

See Configuration Reference for the full list.


Connect to Claude Code (same machine)

Add to ~/.mcp.json:

// No API key configured (default)
{
  "mcpServers": {
    "agentibridge": {
      "url": "http://localhost:8100/mcp"
    }
  }
}
// With API key (if AGENTIBRIDGE_API_KEYS is set)
{
  "mcpServers": {
    "agentibridge": {
      "url": "http://localhost:8100/mcp",
      "headers": { "X-API-Key": "your-key" }
    }
  }
}

Run agentibridge connect to get ready-to-paste configs for other clients (ChatGPT, Claude Web, Grok, generic MCP).


Connect to Claude.ai

Claude.ai requires a public HTTPS URL to reach your MCP server. The easiest way is a Cloudflare Tunnel.

1. Set up the tunnel:

agentibridge tunnel setup

2. Choose an auth method:

Path A — API key (simpler; works for all clients):

{
  "mcpServers": {
    "agentibridge": {
      "url": "https://mcp.yourdomain.com/mcp",
      "headers": { "X-API-Key": "your-key" }
    }
  }
}

Set AGENTIBRIDGE_API_KEYS=your-key in your .env to enable key validation.

Path B — OAuth (Claude.ai handles the flow automatically):

No manual JSON needed. Claude.ai discovers the OAuth endpoint via /.well-known/oauth-authorization-server and completes the PKCE flow on its own. Set OAUTH_ISSUER_URL to enable it.

See Remote Access & Auth for the full env var reference.


Cloudflare Tunnel

Quick tunnel (no account needed)

Gets you a temporary *.trycloudflare.com URL — useful for testing, changes on restart.

docker compose --profile tunnel up -d
agentibridge tunnel    # prints the current public URL

Named tunnel (your own domain)

Gets you a persistent https://mcp.yourdomain.com that survives restarts.

Requires: A Cloudflare account with a domain added.

agentibridge tunnel setup    # interactive wizard
agentibridge run
curl https://mcp.yourdomain.com/health

The wizard installs cloudflared, authenticates, creates the DNS record, and writes the config. The bridge itself has no domain config — it just listens on localhost:8100 and the tunnel routes your domain to it.

See Cloudflare Tunnel Guide for full details.


Developer Setup

git clone https://github.com/The-Cloud-Clock-Work/agentibridge
cp .env.example .env
docker compose up --build -d

See CONTRIBUTING.md for testing, linting, and CI details.


Resources


FAQ

Isn't this just session history?

History is the data layer. The product is remote fleet control — dispatch tasks from your phone, search sessions from any MCP client, monitor jobs from claude.ai. You go from 0% productivity away from your desk to controlling your agents from anywhere.

VS Code / Cursor already has conversation history.

IDE conversation history is excellent for local replay within that IDE. AgentiBridge serves CLI-first developers and adds capabilities no IDE provides: remote multi-client access, background dispatch from any device, and semantic search across your full session history. When you leave your desk, your IDE history can't dispatch a background task from your phone. AgentiBridge can.

Won't Anthropic build this natively?

AgentiBridge is self-hosted, vendor-neutral infrastructure. Native features optimize for one vendor's client. AgentiBridge works with Claude Code, claude.ai, ChatGPT, Grok, and any MCP client. Your data stays on your machine, and you control the storage backend, embedding model, and access policies. MIT licensed — no lock-in.

Do I need Redis and Postgres?

No. pip install agentibridge && agentibridge run works with zero dependencies — filesystem-only storage out of the box. Add Redis for caching and Postgres for semantic search when you need them.

Is my data sent anywhere?

No. No telemetry, no SaaS dependencies. Cloudflare Tunnel is opt-in, and even then only MCP tool responses traverse the tunnel — your transcripts stay local.

Which clients are supported?

Claude Code CLI, claude.ai, ChatGPT, Grok, and any MCP-compatible client. Run agentibridge connect for ready-to-paste configs.


Code Quality

This project is continuously analyzed by SonarQube for code quality, security vulnerabilities, and test coverage.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentibridge-0.2.2.tar.gz (73.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentibridge-0.2.2-py3-none-any.whl (70.6 kB view details)

Uploaded Python 3

File details

Details for the file agentibridge-0.2.2.tar.gz.

File metadata

  • Download URL: agentibridge-0.2.2.tar.gz
  • Upload date:
  • Size: 73.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for agentibridge-0.2.2.tar.gz
Algorithm Hash digest
SHA256 a19c23151962194f2de9ae74250ddc0499d7e8dcef29d879a96ebe1067368e49
MD5 51f40a70a1fa363611603fd742f69872
BLAKE2b-256 2fc61ab19abf8792a198cfec9f36cdb7c40b9150fe8163205b9c3ff39737ab4b

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentibridge-0.2.2.tar.gz:

Publisher: publish-pypi.yml on The-Cloud-Clock-Work/agentibridge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agentibridge-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: agentibridge-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 70.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for agentibridge-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2a576e5567cbd990244c07de44c59f3a9b765e196eacce63d4a03872697c97aa
MD5 fb1e118f22e5940cc47a1e3d96256112
BLAKE2b-256 6be3f65a438b2631226e0e39d1330de279640f94b5cfd515665e93c798aba744

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentibridge-0.2.2-py3-none-any.whl:

Publisher: publish-pypi.yml on The-Cloud-Clock-Work/agentibridge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page