MCP SERVER

SCOUT

Workspace context management — the first call in every session and the only source of truth for paths.

20
Tools
5
Library Exports
3
Context Types
1
Hard Rule
TOOLS
ToolPurposeReturns
activateSet the active context for the session — required before any other tool worksContext metadata, cwd path
resolveConvert a hint string to full workspace metadata without changing active contextPath, branch, type, personal flag
infoConsolidated snapshot — metadata, git state, dirty files, recent commits in one callContext + git state object
list_contextsEnumerate all repos, worktrees, and compound contexts in the workspaceArray of workspace entries
createCreate worktree(s) for shared repos with auto-generated branch from descriptionBranch name, worktree paths
removeTear down a worktree or compound context with safety checksRemoval confirmation
readRead file(s) from a context — single path or array for batch. Supports offset/limit/tailFile content, size, metadata
writeWrite a file to a context — creates parent dirs, rejects identical contentWrite confirmation, byte size
editFind-and-replace within a file — single edit or batch array. Fails on ambiguous matchesEdit result, replacement count
deleteDelete a file from a contextDeletion confirmation
moveMove or rename a file within a contextNew path confirmation
copyCopy a file within or across contexts via dest_hintCopy confirmation
list_filesList directory contents, optionally filtered by glob patternArray of entries
globFind files by glob pattern — uses ripgrep, falls back to Bun.Glob. Respects .gitignorePaths sorted by mtime (newest first)
grepSearch file contents by regex via ripgrep — returns file, line number, and match contentMatches sorted by file mtime
catConcatenate multiple files into one text stream with headers — lower token cost than batch readSingle text block with ── path ── separators
read_imageRead image files (PNG, JPG, SVG, etc.) and return MCP image content for visual analysisBase64 image or SVG text
pushPush current branch to remote — auto-commits dirty personal repos, creates GitLab project if neededSHA, webUrl, commit count
push_allCommit and push all dirty personal repos in the workspace in one sweepPer-repo status summary
refreshInvalidate workspace caches and re-scan from disk after topology changesFresh workspace state
HINT RESOLUTION
The Abstraction

Every tool in the ecosystem needs to know where code lives. Scout solves this once through hint resolution — a short string like "subs" or "billing" becomes a fully resolved context with path, branch, type, and ownership classification. No tool constructs paths manually. No tool calls pwd or ls. The hint is the universal entry point.

Three Context Types

A hint resolves to one of three types. A repo is a standalone git repository. A worktree is a branch checkout linked to a parent repo — used for shared repos where you can't commit to main. A directory is a non-git folder. The type determines which operations are valid and which workflow applies.

Personal vs Shared

Scout classifies every repo by ownership. Personal repos (your GitLab namespace) commit directly to main and push. Shared repos require worktrees — scout_create generates a branch, sets up the worktree, and auto-activates it. This classification is the fork in every git workflow: push vs MR, direct commit vs branch isolation.

Compound Contexts

When work spans multiple repos, scout creates a compound context — a single slug that resolves to multiple worktrees. Activate once, operate across repos. The compound tracks which repos are involved and provides per-repo context when tools need individual paths.

BATCH OPERATIONS
Batch Read

Pass an array of paths instead of a single string. Scout resolves the hint once and reads all files in a single call. Returns structured JSON per file with content, size, and modification time. Eliminates redundant context resolution when exploring multiple files.

Batch Edit

Pass an edits array — each entry specifies path, oldString, and newString. One hint resolution, multiple file edits. Returns per-edit results with replacement counts. Critical for refactoring across files without N separate tool calls.

Cat

Concatenate multiple files into a single text stream with ── path ── headers. No JSON envelopes, no per-file metadata overhead. Lower token cost than batch read when you need to review related files together rather than process them individually.

INTEGRATION
Upstream
What scout depends on

git-helpers — shared git primitives (branch detection, remote URL parsing, GitLab username resolution). mcp-helpers — MCP server registration and tool wiring. Scout has no runtime dependencies on other MCP servers. It is the foundation layer — everything depends on it, it depends on nothing in the MCP ecosystem.

Downstream
What depends on scout

git-ops takes the cwd path from scout_resolve to run commits, pushes, and rebases. Every MCP server that reads or writes files uses scout as its file system layer. The workspace AGENTS.md enforces this as a hard rule — "all paths come from scout." Scout also exports library modules (client, workspace, state, errors, files) consumed by other servers at build time.

The server that knows where everything is — so nothing else has to.