# st3v3nmw/sourcerer-mcp [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/st3v3nmw/sourcerer-mcp  
**GitHub Stars:** 121  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/st3v3nmw-sourcerer-mcp

## Description
MCP for semantic code search & navigation that reduces token waste

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/st3v3nmw/sourcerer-mcp), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
go install github.com/st3v3nmw/sourcerer-mcp/cmd/sourcerer@latest
```

2. Install:

```sh
brew tap st3v3nmw/tap
```

3. Install:

```sh
brew install st3v3nmw/tap/sourcerer
```

4. Add to Claude Code:

```sh
claude mcp add sourcerer -e OPENAI_API_KEY=your-openai-api-key -e SOURCERER_WORKSPACE_ROOT=$(pwd) -- sourcerer
```

## Documentation

## What st3v3nmw/sourcerer-mcp MCP server does

The st3v3nmw/sourcerer-mcp MCP server gives an AI agent semantic access to a codebase. Rather than relying only on literal text matches or opening complete files, it identifies structured code sections and lets the agent request the sections relevant to a task. Indexed chunks can represent functions, classes, methods, interfaces, types, and other structures recognized by the language parser.

The server operates on a Git repository and respects the repository's `.gitignore` rules. Supported languages are Go, JavaScript, Markdown, Python, and TypeScript. Support for C, C++, Java, Ruby, Rust, and other languages is listed as planned rather than currently available.

## How it works

Tree-sitter parses source files into syntax trees. Sourcerer extracts meaningful code units and assigns stable identifiers such as `file.ext::Type::method`. Each indexed unit contains source text, location information, and contextual summaries.

OpenAI generates embeddings for those chunks. The resulting vectors and related metadata are stored persistently with chromem-go under `.sourcerer/db/`. A file watcher built with fsnotify notices changes, and the server re-indexes changed files while tracking modification times. The `git check-ignore` command is used to avoid indexing ignored files.

The st3v3nmw/sourcerer-mcp MCP server exposes this index through MCP tools. Semantic queries return conceptually relevant code, while chunk retrieval provides the source for a known chunk ID. Similarity lookup can identify related chunks beyond the initial search results.

## Setup and configuration

Install the command with Go:

```shell
go install github.com/st3v3nmw/sourcerer-mcp/cmd/sourcerer@latest
```

Or install it through the project's Homebrew tap:

```shell
brew tap st3v3nmw/tap
brew install st3v3nmw/tap/sourcerer
```

Running the server requires an OpenAI API key for embedding generation and a Git repository as the workspace. Set `SOURCERER_WORKSPACE_ROOT` to the project path. The repository should also add `.sourcerer/` to `.gitignore`, because the local vector database is stored there.

For Claude Code, the README provides a command that passes both environment variables when registering the server. The generic `mcp.json` example uses the `sourcerer` executable, `OPENAI_API_KEY`, and `SOURCERER_WORKSPACE_ROOT`.

## Tools and capabilities

The available MCP tools are:

- `semantic_search`: find code using a conceptual query.
- `get_chunk_code`: retrieve source for a specific chunk ID.
- `find_similar_chunks`: locate chunks similar to a selected chunk.
- `index_workspace`: manually start workspace indexing.
- `get_index_status`: inspect indexing progress.

These operations cover discovery, focused source retrieval, related-code exploration, explicit re-indexing, and status checks. The st3v3nmw/sourcerer-mcp MCP server is therefore suited to coding agents that need targeted repository context and can supply an OpenAI key.

## Limitations and notes

Embedding generation currently depends on OpenAI; local embeddings are described as planned. The workspace must be a Git repository, and indexing follows `.gitignore`. Language coverage depends on available Tree-sitter queries, so unsupported languages may not produce the same structural chunks.

_Full upstream README: https://allmcps.com/mcp/st3v3nmw-sourcerer-mcp/readme_

