forgejo-mcp-broker/.beads
Ole-Morten Duesund 5eeac663d8 feat(broker): wire OAuth + MCP session glue into main; e2e test (forgejo-mcp-broker-q6n)
cmd/broker/main.go now composes every phase-2-5 component into a live
binary:

  /healthz      → internal/httpserver
  /oauth/*      → internal/oauth.Server.Handler()
  /.well-known  → internal/oauth.Server.Handler()
  /mcp          → oauth.Authenticator.RequireBearer
                   over session.Registry.Handler()

The SpawnFunc passed to the registry composes supervisor + bridge: each
new MCP session forks `forgejo-mcp --transport stdio` with the user's
upstream token in env, wraps stdio with a bridge, and returns the
bridge's HandleSSE as the per-session http.Handler. The reaper is wired
with a refresh callback that calls forgejo.Client.Refresh and persists
rotated tokens back to access_tokens before the rotator swaps the
session's child.

cmd/broker/e2e_test.go is the gating local validation: builds the
binary, builds forgejo-mcp from the sibling repo (skipped if absent),
stands up a fake Forgejo, runs the broker, and walks
register → authorize → callback → token → /mcp initialize → tools/list.
This catches:

  - any component left unwired
  - the subprocess-context bug fixed in this commit (using a request
    context in supervisor.Start kills the child when the request that
    minted it returns; the fix is a long-lived childCtx)
  - the happy-path Mcp-Session-Id mint+reuse cycle that unit tests
    can't exercise without a real subprocess

docs/phase7-findings.md documents both the local automated validation
(this test) and the manual Claude.ai-side checklist (OAuth completes,
tool discovery, tool invocation, session reuse, idle reap, mid-session
token refresh, revocation). The Claude.ai half is fundamentally manual
and stays that way; the automated test catches the broker bugs that
would otherwise hide behind operator setup mistakes.

Closes forgejo-mcp-broker-q6n. Phase 7 — and the project's primary
implementation track — complete.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 17:55:18 +02:00
..
hooks bd init: initialize beads issue tracking 2026-04-24 16:34:50 +02:00
.gitignore bd init: initialize beads issue tracking 2026-04-24 16:34:50 +02:00
config.yaml bd init: initialize beads issue tracking 2026-04-24 16:34:50 +02:00
issues.jsonl feat(broker): wire OAuth + MCP session glue into main; e2e test (forgejo-mcp-broker-q6n) 2026-04-27 17:55:18 +02:00
metadata.json bd init: initialize beads issue tracking 2026-04-24 16:34:50 +02:00
README.md bd init: initialize beads issue tracking 2026-04-24 16:34:50 +02:00

Beads - AI-Native Issue Tracking

Welcome to Beads! This repository uses Beads for issue tracking - a modern, AI-native tool designed to live directly in your codebase alongside your code.

What is Beads?

Beads is issue tracking that lives in your repo, making it perfect for AI coding agents and developers who want their issues close to their code. No web UI required - everything works through the CLI and integrates seamlessly with git.

Learn more: github.com/steveyegge/beads

Quick Start

Essential Commands

# Create new issues
bd create "Add user authentication"

# View all issues
bd list

# View issue details
bd show <issue-id>

# Update issue status
bd update <issue-id> --claim
bd update <issue-id> --status done

# Sync with Dolt remote
bd dolt push

Working with Issues

Issues in Beads are:

  • Git-native: Stored in Dolt database with version control and branching
  • AI-friendly: CLI-first design works perfectly with AI coding agents
  • Branch-aware: Issues can follow your branch workflow
  • Always in sync: Auto-syncs with your commits

Why Beads?

AI-Native Design

  • Built specifically for AI-assisted development workflows
  • CLI-first interface works seamlessly with AI coding agents
  • No context switching to web UIs

🚀 Developer Focused

  • Issues live in your repo, right next to your code
  • Works offline, syncs when you push
  • Fast, lightweight, and stays out of your way

🔧 Git Integration

  • Automatic sync with git commits
  • Branch-aware issue tracking
  • Dolt-native three-way merge resolution

Get Started with Beads

Try Beads in your own projects:

# Install Beads
curl -sSL https://raw.githubusercontent.com/steveyegge/beads/main/scripts/install.sh | bash

# Initialize in your repo
bd init

# Create your first issue
bd create "Try out Beads"

Learn More


Beads: Issue tracking that moves at the speed of thought