Sourcebook logo

Sourcebook

Analyzes local Git repositories to expose structure, dependencies, conventions, and change risks to AI agents over MCP.

Install Sourcebook

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "sourcebook": {
      "command": "npx",
      "args": [
        "-y",
        "sourcebook"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

We couldn’t confirm it starts correctly

The install command installed and started the server, which then stopped for configuration (such as an API key) that our sandbox does not have — expected for servers that connect to your account.

npx -y sourcebook

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked 2d ago.

Overview

The sourcebook MCP server gives AI agents access to repository structure, blast radius, coding conventions, and files that commonly change together. It runs locally through `npx sourcebook serve`, reads the target repository's file structure and Git history, and exposes that context through an MCP client. Reach for it when an agent needs to understand dependencies or assess the likely impact of a code change. The broader CLI also checks diffs for missing tests, sibling modules, co-change companions, and other potentially affected files.

Use cases

  • Inspect a repository's import graph before editing
  • Identify files with a large change blast radius
  • Find historical co-change companions for a modified file
  • Check a diff for missing tests and related modules

Key features

  • Repository structure queries
  • Import and dependency graph analysis
  • Git co-change history analysis
  • Blast-radius detection
  • Convention and test-file detection
  • Optional Claude-based semantic analysis

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked Today

Recent health check succeeded.

8/8 checks healthy over the last 42d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 14d ago via OSV.dev · sourcebook (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars3Stargazers on the source repository.
npm downloads114Package downloads in the last 30 days.
Last commit6mo agoMost recent push to the default branch.
Install checkRunsOur sandbox started it; it then asked for an API key or config.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How Sourcebook works

What sourcebook MCP server does

The sourcebook MCP server exposes local codebase intelligence to MCP-compatible AI clients. It helps an agent inspect the structure of a repository before editing, identify files connected to a target file, and understand relationships inferred from both source code and Git history.

Its supported analysis areas include repository conventions, import and dependency relationships, blast radius, and co-change patterns. The server is intended for software repositories rather than biology or general document search. It is especially relevant when an agent needs to determine whether a change should extend beyond the file it was asked to modify.

The related command-line workflow can also analyze staged or unstaged diffs for likely omissions. That check covers missing test files, sibling modules, files that historically change with edited files, and high-fan-in hub files. Optional AI analysis can identify semantic cases such as field renames that require migrations or validation logic tied to an older schema.

How it works

Run the server from a project directory or pass the repository path with --dir. sourcebook reads the repository's file structure and Git history directly; no separate database or configuration file is described as necessary.

Its structural analysis builds an import graph, maps source files to likely tests using naming conventions and history, mines commits for files that frequently change together, and identifies files with many dependents. These signals provide the repository context available to an agent through MCP.

The command-line completeness check has a second, optional analysis layer. With --ai, the diff and dependency context are sent to Claude Sonnet for semantic review. This mode requires ANTHROPIC_API_KEY; the MCP server itself does not list an environment variable requirement. AI findings must include a dependency citation, and unsupported file paths are filtered out according to the project documentation.

Language coverage is full for TypeScript/JavaScript, Python, and Go across import graphs, Git analysis, and convention detection. Rust has full import-graph and Git analysis support, with partial convention detection.

Setup and configuration

Start the sourcebook MCP server with:

Terminal
npx sourcebook serve

An MCP client can launch it with a configuration equivalent to:

config.json
{
  "mcpServers": {
    "sourcebook": {
      "command": "npx",
      "args": ["-y", "sourcebook", "serve", "--dir", "/path/to/your/project"]
    }
  }
}

Replace the example path with the local repository the agent should inspect. Set ANTHROPIC_API_KEY only when using the CLI's check --ai option.

Tools and capabilities

The sourcebook MCP server lets agents query:

  • Repository structure and coding conventions
  • Import relationships and dependency context
  • Blast radius for files with many dependents
  • Co-change information from Git history

The package also provides CLI commands for diff completeness checks, JSON or quiet output, branch comparisons, historical scans, Claude Code hook setup, context-file generation, natural-language codebase queries, and automatic updates. These are CLI features and should not be assumed to be MCP tools.

Limitations and notes

The MCP interface is documented as a local server started with npx, and the repository path must be available to that process.

The GitHub App is described as coming soon and is not an available MCP capability. Rust convention detection is partial. AI semantic analysis is optional, uses an Anthropic API key, and is separate from the rules-based structural analysis.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Sourcebook

sourcebook is an MCP server that connects AI agents to a local Git repository's structure and history. Its main tools expose repository conventions, import relationships, blast-radius information, and co-change data, helping agents understand affected files before making or reviewing code changes.

Run `npx sourcebook serve` and configure your MCP client to launch that command.

Yes. sourcebook documents Claude Code support through its `init` and `hooks` commands, which generate context files and install or check hooks. Claude Code can also launch the MCP server using the standard `npx sourcebook serve` configuration.

No, not for the standard rules-based workflow or MCP server. `ANTHROPIC_API_KEY` is required only when you run the CLI with `sourcebook check --ai`, which adds semantic analysis through Claude Sonnet.

sourcebook fully supports TypeScript, JavaScript, Python, and Go for import graphs, Git analysis, and convention detection. Rust has full import-graph and Git analysis support, but convention detection is only partial.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewSourcebook AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/sourcebook?style=directory)](https://allmcps.com/mcp/sourcebook)
HTML Embed
<a href="https://allmcps.com/mcp/sourcebook"><img src="https://allmcps.com/api/badge/sourcebook?style=directory" alt="Sourcebook on AllMCPs" /></a>