Sourcerer MCP logo

Sourcerer MCP

by st3v3nmw

Semantic code search and navigation for Git workspaces using Tree-sitter parsing and OpenAI embeddings.

Install Sourcerer MCP

Run the project’s own setup commands, in order.

Setup steps from the project

st3v3nmw/sourcerer-mcp installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Install
    go install github.com/st3v3nmw/sourcerer-mcp/cmd/sourcerer@latest
    
  2. 2. Install
    brew tap st3v3nmw/tap
    
  3. 3. Install
    brew install st3v3nmw/tap/sourcerer
    
  4. 4. Add to Claude Code
    claude mcp add sourcerer -e OPENAI_API_KEY=your-openai-api-key -e SOURCERER_WORKSPACE_ROOT=$(pwd) -- sourcerer
    

Overview

st3v3nmw/sourcerer-mcp MCP server indexes code in a Git workspace for semantic search and targeted navigation. It parses supported files with Tree-sitter, creates chunks for functions, classes, methods, and types, then stores OpenAI-generated embeddings in a local vector database. Agents can search by concept, retrieve chunk code, find similar chunks, re-index the workspace, and check indexing status. Reach for it when an agent needs relevant code without loading entire files into context.

Use cases

  • Search a repository by describing the code concept you need
  • Retrieve a specific function or class without opening the whole file
  • Find code chunks similar to an existing implementation
  • Check indexing progress after workspace changes

Key features

  • Semantic code search with OpenAI embeddings
  • Tree-sitter-based code chunking
  • Automatic re-indexing for changed files
  • Persistent chromem-go vector storage
  • Chunk retrieval and similarity search
  • Support for Go, JavaScript, Markdown, Python, and TypeScript

Security & health

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

ActiveLast checked

Recent health check succeeded.

30/31 checks healthy over the last 112d

Adoption & maintenance

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

GitHub stars121Stargazers on the source repository.
Last commit1y agoMost recent push to the default branch.
Directory activity2 viewsConfig copies, upvotes, and views on AllMCPs.

How Sourcerer MCP works

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.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

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

Frequently Asked Questions about Sourcerer MCP

st3v3nmw/sourcerer-mcp is an MCP server that connects AI agents to a Git-based code workspace and an OpenAI embedding workflow. Its main tools provide semantic search, chunk-code retrieval, similar-chunk discovery, manual workspace indexing, and index-status checks for supported source files.

Install it with Go or Homebrew. Use `go install github.com/st3v3nmw/sourcerer-mcp/cmd/sourcerer@latest`, or run `brew tap st3v3nmw/tap` followed by `brew install st3v3nmw/tap/sourcerer`.

Set `OPENAI_API_KEY` and `SOURCERER_WORKSPACE_ROOT`. The first authorizes embedding generation, while the second identifies the project workspace used by the server.

It documents Claude Code registration and a generic `mcp.json` configuration using the `sourcerer` command and environment variables, so Cursor-specific behavior should be verified separately.

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 PreviewSourcerer MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/st3v3nmw-sourcerer-mcp?style=directory)](https://allmcps.com/mcp/st3v3nmw-sourcerer-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/st3v3nmw-sourcerer-mcp"><img src="https://allmcps.com/api/badge/st3v3nmw-sourcerer-mcp?style=directory" alt="Sourcerer MCP on AllMCPs" /></a>