Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

HTTP Mode

Bobbin can run as an HTTP REST API server for centralized deployments, shared team use, or webhook-driven indexing.

Starting the HTTP Server

bobbin serve --server                  # HTTP on port 3030 (default)
bobbin serve --server --port 8080      # Custom port
bobbin serve --server --mcp            # HTTP + MCP stdio simultaneously

The server binds to 0.0.0.0 on the specified port and includes CORS headers for browser-based clients.

REST API Endpoints

MethodPathDescription
GET/searchSemantic/hybrid/keyword search
GET/grepKeyword/regex pattern search
GET/contextTask-aware context assembly
GET/chunk/{id}Read a specific chunk by ID
GET/readRead file lines by path and range
GET/relatedFind temporally coupled files
GET/refsFind symbol definitions and usages
GET/symbolsList symbols in a file
GET/hotspotsIdentify high-churn complex files
GET/impactPredict change impact
GET/reviewDiff-aware review context
GET/similarFind similar code or duplicate clusters
GET/primeProject overview with live stats
GET/beadsSearch indexed beads/issues
GET/statusIndex statistics
GET/metricsPrometheus metrics
POST/webhook/pushTrigger re-indexing (for CI/CD)
ParameterTypeDefaultDescription
qstringrequiredSearch query
modestringhybridSearch mode: hybrid, semantic, keyword
typestringallFilter by chunk type
limitinteger10Maximum results
repostringallFilter by repository
curl "http://localhost:3030/search?q=error+handling&limit=5"

GET /grep

ParameterTypeDefaultDescription
patternstringrequiredSearch pattern
ignore_caseboolfalseCase-insensitive search
regexboolfalseEnable regex matching
typestringallFilter by chunk type
limitinteger10Maximum results
repostringallFilter by repository
curl "http://localhost:3030/grep?pattern=handleAuth&limit=5"

GET /context

ParameterTypeDefaultDescription
qstringrequiredTask description
budgetinteger500Max lines of content
depthinteger1Coupling expansion depth
max_coupledinteger3Max coupled files per seed
limitinteger20Max initial search results
coupling_thresholdfloat0.1Min coupling score
repostringallFilter by repository
curl "http://localhost:3030/context?q=refactor+auth+flow&budget=300"

GET /read

ParameterTypeDefaultDescription
filestringrequiredFile path (relative to repo root)
start_lineintegerrequiredStart line number
end_lineintegerrequiredEnd line number
contextinteger0Extra context lines before/after
curl "http://localhost:3030/read?file=src/main.rs&start_line=1&end_line=20"
ParameterTypeDefaultDescription
filestringrequiredFile path to find related files for
limitinteger10Maximum results
thresholdfloat0.0Min coupling score
curl "http://localhost:3030/related?file=src/auth.rs&limit=5"

GET /refs

ParameterTypeDefaultDescription
symbolstringrequiredSymbol name to find
typestringallFilter by symbol type
limitinteger20Max usage results
repostringallFilter by repository
curl "http://localhost:3030/refs?symbol=parse_config"

GET /symbols

ParameterTypeDefaultDescription
filestringrequiredFile path
repostringallFilter by repository
curl "http://localhost:3030/symbols?file=src/config.rs"

GET /hotspots

ParameterTypeDefaultDescription
sincestring1 year agoTime window for churn analysis
limitinteger20Maximum results
thresholdfloat0.0Min hotspot score
curl "http://localhost:3030/hotspots?since=6+months+ago&limit=10"

GET /impact

ParameterTypeDefaultDescription
targetstringrequiredFile or file:function target
depthinteger1Transitive depth (1-3)
modestringcombinedSignal: combined, coupling, semantic, deps
limitinteger15Maximum results
thresholdfloat0.1Min impact score
repostringallFilter by repository
curl "http://localhost:3030/impact?target=src/auth.rs&depth=2"

GET /review

ParameterTypeDefaultDescription
diffstringunstagedDiff spec: unstaged, staged, branch:<name>, or commit range
budgetinteger500Max lines of content
depthinteger1Coupling expansion depth
repostringallFilter by repository
curl "http://localhost:3030/review?diff=staged&budget=300"

GET /similar

ParameterTypeDefaultDescription
targetstring-Chunk ref or text (required unless scan=true)
scanboolfalseScan for duplicate clusters
thresholdfloat0.85/0.90Min similarity threshold
limitinteger10Max results or clusters
repostringallFilter by repository
cross_repoboolfalseCross-repo comparison in scan mode
curl "http://localhost:3030/similar?target=src/auth.rs:login&limit=5"
curl "http://localhost:3030/similar?scan=true&threshold=0.9"

GET /prime

ParameterTypeDefaultDescription
sectionstring-Specific section to show
briefboolfalseCompact overview only
curl "http://localhost:3030/prime?brief=true"

GET /beads

ParameterTypeDefaultDescription
qstringrequiredSearch query
priorityinteger-Filter by priority (1-4)
statusstring-Filter by status
assigneestring-Filter by assignee
rigstring-Filter by rig name
limitinteger10Maximum results
enrichbooltrueEnrich with live Dolt data
curl "http://localhost:3030/beads?q=auth+bug&status=open"

GET /status

Returns index statistics in JSON format.

curl http://localhost:3030/status

GET /metrics

Returns Prometheus-compatible metrics.

curl http://localhost:3030/metrics

POST /webhook/push

Triggers re-indexing. Useful for CI/CD pipelines or git webhook integrations.

curl -X POST http://localhost:3030/webhook/push

Thin-Client Mode

When a remote bobbin server is running, CLI commands can delegate to it instead of accessing local storage:

bobbin search "auth" --server http://localhost:3030
bobbin status --server http://localhost:3030

The --server flag is a global option available on all commands. When set, the CLI acts as a thin client that forwards requests to the HTTP server.

Use Cases

Team Server

Run bobbin on a shared machine with a large codebase indexed once:

# On the server
bobbin init
bobbin index
bobbin serve --server --port 3030

Team members connect via --server flag or configure their AI client to point at the server.

CI/CD Integration

Add a webhook step to your CI pipeline to keep the index fresh:

# After deploy or merge
curl -X POST http://bobbin-server:3030/webhook/push

Combined Mode

Run both HTTP and MCP simultaneously for maximum flexibility:

bobbin serve --server --mcp

This starts the HTTP server on the configured port and the MCP stdio server concurrently. The MCP server handles AI client connections while the HTTP server handles REST API requests and webhooks.