plumb

module
v0.0.0-...-215f043 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2026 License: MIT

README

CI Go Reference Go Report Card

plumb

IDE intelligence for agents — with guardrails for unattended work.

Plumb is an MCP server that gives a coding agent the intelligence layer of an IDE — LSP-backed semantics, a tree-sitter code index, and project memory — inside guardrails: atomic, lock-serialised writes with transactional rollback, scoped filesystem and git access, and a daemon that survives its own crashes. A single binary; nothing else to install.


Why Plumb

LLM agents usually work by reading whole files into the context window — token-heavy, lossy at scale, blind to symbol semantics, and unsafe to let loose on a real repo. Plumb is built on three pillars, in priority order.

1. Reliability & write-safety

Leaving an agent to edit a codebase for an hour is only viable if writes can't corrupt files and a crash can't wedge your session.

  • Atomic I/O — every write is staged in a temp file and renamed into place. No partial writes, ever. Symlink-aware, CRLF-tolerant.
  • Per-path locking — the daemon serialises concurrent writes to the same file across every session and chat window. No races.
  • Multi-file transactions — apply edits across dozens of files with guaranteed atomic rollback if any step fails.
  • Crash-resilient daemonplumb serve is a reconnecting proxy. If the daemon crashes or hangs, it respawns one and replays the handshake; the agent never notices. In-flight writes are never silently re-run.
  • Optimistic concurrency — mtime/sha guards catch stale edits before they clobber newer changes.

See it run: docs/demos/ has a self-contained two-agents-one-file demo where a stale write is refused with a clear message and nothing is lost.

2. Semantic intelligence

The same primitives your editor has, exposed as structured tools:

  • LSP-backed refactorsrename_symbol, replace_symbol_body, safe_delete_symbol understand scope, types, and references.
  • Real diagnostics inline — actual gopls/pyright output is appended to every write, so the agent learns it broke the build immediately.
  • Symbol search — scoped to your code, no stdlib or dependency noise.

3. Context efficiency & safety controls

  • Read only what you need — symbols or line ranges, not 2,000-line files.
  • Scoped access you control — a per-connection path allowlist (read-only vs read-write roots) plus tiered git gating (destructive and network operations are off by default and need explicit confirmation). See SECURITY.md.
  • One-round-trip bootstrapsession_start returns workspace, branch, recent commits, diagnostics, and project memory.

See the measured, reproducible numbers behind this: docs/use-cases.md — reading one function is ~8× less context than the whole file, and find_references returns the real call sites where a text search is ~44% noise.


Get started

Plumb is a single binary — from zero to your first answer:

1. Install

# Homebrew (macOS + Linux) — recommended
brew install plumbkit/plumb/plumb

# or with Go
go install github.com/plumbkit/plumb/cmd/plumb@latest

# or grab a prebuilt binary: https://github.com/plumbkit/plumb/releases

macOS note: prebuilt binaries are not yet notarised — on first run you may need xattr -d com.apple.quarantine ./plumb, or right-click → Open. Homebrew installs avoid this.

2. Connect your agent

plumb setup claude-code      # also: claude-desktop, codex, gemini, cursor, …

plumb setup writes the MCP config for you — no hand-editing JSON.

3. Open your project and try it

Make sure the language server you need is on your $PATH (gopls for Go, pyright for Python, …), then point your agent at a real question. In Claude Code:

cd your/project
claude "Use plumb to orient in this repo (session_start), then show me
everywhere <Handler> is called and what would break if I changed its signature."

Plumb resolves the workspace and runs session_start for orientation, then answers with real LSP and topology data — actual call sites and blast radius — instead of guessing from file dumps. It's read-only; nothing is modified. (Any connected agent works — just paste the prompt.)

No go.mod/pyproject.toml and not a git repo? Run plumb init once to pin the workspace root (it also seeds .plumb/context.md and project config).

Full walkthrough → docs/getting-started.md.


Language support (honest version)

Plumb negotiates LSP capabilities per language and also ships a built-in tree-sitter index for search and navigation with no language server. Support comes in tiers — we'd rather be precise than claim a big number.

Tier Languages What you get
First-class (CI-tested, real-binary integration) Go (gopls), Python (pyright) Full LSP: definitions, references, rename, diagnostics, hierarchies + all write tools
Validated Java (jdtls), Rust (rust-analyzer), Swift (sourcekit-lsp) Full LSP; just put the server on $PATH and it activates automatically
Experimental TypeScript/JS, Kotlin, Zig, HTML Navigation works against the real servers; diagnostics validation is still in progress. Put the server on $PATH to activate (exclude any language with [lsp.<lang>] enabled = false)
Search & navigation (tree-sitter, no LSP needed) 15+ incl. JS/TS/TSX, Bash, SQL, HCL, Dockerfile, TOML, YAML, Markdown Ranked symbol search, outlines, graph exploration via the Topology index

Real-binary validation has been exercised on macOS; Linux integration runs in CI and is being hardened pre-v1. Windows is tracked but not yet supported — the daemon's Unix-socket architecture needs a port.


How it works

plumb serve is a thin, reconnecting stdio proxy. The real work happens in one shared background daemon, so language servers stay warm across chats.

flowchart TD
    A1["Claude"] --> S1["plumb serve *"]
    A2["Codex"] --> S2["plumb serve *"]
    A3["Gemini"] --> S3["plumb serve *"]
    S1 --> K["plumb.sock"]
    S2 --> K
    S3 --> K
    K --> D["plumb daemon **"]
    D --> G["gopls → /projects/foo"]
    D --> P["pyright → /projects/bar"]

* plumb serve is a reconnecting proxy — if the daemon crashes or hangs it respawns one and replays the handshake, so your session survives without the agent noticing.

** one shared process, reused across every conversation.

Servers stay warm across chats, per-path locks are shared across every connection, and symbol indexes update live after each write. Full architecture → docs/architecture.md.


Monitoring (TUI)

Run plumb with no arguments for a live dashboard — see what your agent is doing in real time: every tool call as it happens, daemon health, per-tool stats, and streaming logs you can follow and filter. The fastest way to catch a runaway loop or confirm an edit landed.


Core capabilities

Plumb exposes 53 tools. The ones you'll use constantly:

session_start · find_symbol · get_definition · find_references · rename_symbol · edit_file · transaction_apply · diagnostics

The rest cover filesystem reads/writes, LSP hierarchies, tiered git, an optional local Topology index (ranked search + blast-radius/route analysis, no language server needed), and durable per-project memory. Full API reference: docs/tools.md.


Configuration

Global or per-project config.toml, or environment variables. Run plumb config show to see the resolved config with provenance.

[edits]
strict = true                  # require read_file before edit_file
rate_limit_per_minute = 30     # bound runaway agent loops

[git]
allow_destructive = false      # reset/checkout/rebase off by default
allow_push = false             # push/fetch/pull off by default

Full settings reference: docs/configuration.md.


The hard part

Agents can already read code well enough; writing it unsupervised — concurrently, transactionally, recoverably — is what's still unsolved. Plumb is the bet that this is the half worth getting right first. It's early, and the language coverage says so: a small validated core, the rest clearly marked experimental.


Roadmap

Plumb is pre-1.0. The core — write-safety, the resilient daemon, the topology index, and project memory — is in daily use. The road to 1.0 is mostly about proving it beyond the validated core and smoothing distribution. Issues and ideas welcome.

Shipped

  • Concurrency-safe, atomic, transactional writes with rollback
  • Crash-resilient reconnecting daemon
  • Tree-sitter topology index + per-project memory
  • Go and Python LSP adapters validated (real-binary)

Road to 1.0

  • Green Linux CI with real-binary LSP integration (today: validated on macOS; Linux hardening in progress)
  • Homebrew distribution (brew install plumb)
  • Promote experimental adapters to validated — pull-diagnostics support so Zig / TypeScript / Kotlin pass end-to-end
  • Swift on Xcode projects: build-server (BSP) guidance so semantic tools work without a SwiftPM manifest
  • Semantic re-rank for topology search → GA (today: opt-in, off by default)

Exploratory / post-1.0

  • Native Windows support
  • Retire the WASM tree-sitter path once the pure-Go parser handles Swift IUO and TS typed-arrow

Contributing

See CONTRIBUTING.md and AGENTS.md for architecture and code style. We follow Australian English in all prose. By contributing you agree to the Code of Conduct.

License

MIT — see LICENSE.

Directories

Path Synopsis
cmd
plumb command
smoke
Package smoke contains the plumb end-to-end integration smoke test.
Package smoke contains the plumb end-to-end integration smoke test.
internal
cache
Package cache provides a session-scoped, sharded, TTL-aware cache for LSP query results.
Package cache provides a session-scoped, sharded, TTL-aware cache for LSP query results.
cli
Package cli wires plumb's Cobra subcommands.
Package cli wires plumb's Cobra subcommands.
clientcaps
Package clientcaps is the single source of truth for what an MCP client can do natively, and the counterfactual savings model layered on top of it.
Package clientcaps is the single source of truth for what an MCP client can do natively, and the counterfactual savings model layered on top of it.
config
Package config loads and validates plumb's TOML configuration.
Package config loads and validates plumb's TOML configuration.
fsguard
Package fsguard guards filesystem walks against macOS TCC false-positive prompts.
Package fsguard guards filesystem walks against macOS TCC false-positive prompts.
langsupport
Package langsupport is the single source of truth for per-language capability in plumb: which structural engine builds the topology "Map" (symbols, outlines, ranges) and which LSP adapter, if any, provides the semantic "GPS" (definitions, references, types).
Package langsupport is the single source of truth for per-language capability in plumb: which structural engine builds the topology "Map" (symbols, outlines, ranges) and which LSP adapter, if any, provides the semantic "GPS" (definitions, references, types).
lsp
Package lsp defines the Client interface and the process supervisor.
Package lsp defines the Client interface and the process supervisor.
lsp/adapters/gopls
Package gopls is the plumb adapter for gopls, the official Go language server.
Package gopls is the plumb adapter for gopls, the official Go language server.
lsp/adapters/html
Package html is the plumb adapter for vscode-html-language-server, the HTML language server extracted from VS Code (built on the vscode-languageserver framework, the same base as the TypeScript and CSS servers).
Package html is the plumb adapter for vscode-html-language-server, the HTML language server extracted from VS Code (built on the vscode-languageserver framework, the same base as the TypeScript and CSS servers).
lsp/adapters/jdtls
Package jdtls is the plumb adapter for Eclipse JDT Language Server (jdtls), the Java language server maintained by the Eclipse Foundation.
Package jdtls is the plumb adapter for Eclipse JDT Language Server (jdtls), the Java language server maintained by the Eclipse Foundation.
lsp/adapters/kotlin
Package kotlin is the plumb adapter for kotlin-language-server (the fwcd/kotlin-language-server project).
Package kotlin is the plumb adapter for kotlin-language-server (the fwcd/kotlin-language-server project).
lsp/adapters/pyright
Package pyright is the plumb adapter for pyright-langserver, the Microsoft Python type checker and language server.
Package pyright is the plumb adapter for pyright-langserver, the Microsoft Python type checker and language server.
lsp/adapters/rust
Package rust is the plumb adapter for rust-analyzer, the official Rust language server.
Package rust is the plumb adapter for rust-analyzer, the official Rust language server.
lsp/adapters/swift
Package swift is the plumb adapter for sourcekit-lsp, Apple's language server for Swift (and C/C++/Objective-C).
Package swift is the plumb adapter for sourcekit-lsp, Apple's language server for Swift (and C/C++/Objective-C).
lsp/adapters/typescript
Package typescript is the plumb adapter for typescript-language-server, the TypeScript/JavaScript language server (tsserver wrapper).
Package typescript is the plumb adapter for typescript-language-server, the TypeScript/JavaScript language server (tsserver wrapper).
lsp/adapters/zig
Package zig is the plumb adapter for zls, the Zig language server.
Package zig is the plumb adapter for zls, the Zig language server.
lsp/jsonrpc
Package jsonrpc implements a JSON-RPC 2.0 client with LSP content framing (Content-Length headers over stdio).
Package jsonrpc implements a JSON-RPC 2.0 client with LSP content framing (Content-Length headers over stdio).
lsp/protocol
Package protocol defines LSP 3.17 types and method name constants.
Package protocol defines LSP 3.17 types and method name constants.
lsp/watcher
Package watcher tracks file-watcher glob patterns registered by a language server via client/registerCapability and filters DidChangeWatchedFiles events to only those the server actually asked to watch.
Package watcher tracks file-watcher glob patterns registered by a language server via client/registerCapability and filters DidChangeWatchedFiles events to only those the server actually asked to watch.
mcp
Package mcp implements a Model Context Protocol server over stdio.
Package mcp implements a Model Context Protocol server over stdio.
memory
Package memory provides a per-workspace markdown memory store.
Package memory provides a per-workspace markdown memory store.
paths
Package paths is the single source of truth for plumb's OS-appropriate base directories.
Package paths is the single source of truth for plumb's OS-appropriate base directories.
quality
Package quality runs offline code analysers (golangci-lint, ruff, …) against changed files and returns structured findings.
Package quality runs offline code analysers (golangci-lint, ruff, …) against changed files and returns structured findings.
quality/golangcilint
Package golangcilint implements a quality.Analyser that shells out to golangci-lint.
Package golangcilint implements a quality.Analyser that shells out to golangci-lint.
redact
Package redact strips likely secrets from text before it is persisted.
Package redact strips likely secrets from text before it is persisted.
render
Package render provides shared, pure presentation helpers for CLI and TUI output.
Package render provides shared, pure presentation helpers for CLI and TUI output.
semantics
Package semantics provides the embedding client for opt-in semantic re-rank of topology_search.
Package semantics provides the embedding client for opt-in semantic re-rank of topology_search.
session
Package session manages the registry of active plumb serve processes.
Package session manages the registry of active plumb serve processes.
stats
Package stats records MCP tool call metrics to a SQLite database.
Package stats records MCP tool call metrics to a SQLite database.
tokenise
Package tokenise provides identifier tokenisation shared by the topology and memory FTS indexes.
Package tokenise provides identifier tokenisation shared by the topology and memory FTS indexes.
tools/txlog
Package txlog implements a durable write-ahead log for transaction_apply.
Package txlog implements a durable write-ahead log for transaction_apply.
topology
Package topology maintains a persistent, disk-based semantic index of the workspace codebase using SQLite + FTS5.
Package topology maintains a persistent, disk-based semantic index of the workspace codebase using SQLite + FTS5.
topology/extractors/golang
Package golang provides a Go AST-based topology extractor.
Package golang provides a Go AST-based topology extractor.
topology/extractors/treesitter
Package treesitter provides gotreesitter-backed topology extractors.
Package treesitter provides gotreesitter-backed topology extractors.
topology/extractors/typescript
Package typescript provides a regex-based topology extractor for TypeScript and JavaScript source files (.ts, .tsx, .js, .jsx, .mjs, .cjs).
Package typescript provides a regex-based topology extractor for TypeScript and JavaScript source files (.ts, .tsx, .js, .jsx, .mjs, .cjs).
tui
Package tui implements the Bubble Tea v2 sessions dashboard for plumb.
Package tui implements the Bubble Tea v2 sessions dashboard for plumb.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL