MCPSERV.CLUB
st3v3nmw

Sourcerer MCP

MCP Server

Semantic code search for AI agents

Stale(60)
78stars
1views
Updated 14 days ago

About

Sourcerer MCP builds a vector index of your codebase, enabling AI agents to locate functions, classes, and snippets conceptually without reading entire files, thus saving tokens and improving efficiency.

Capabilities

Resources
Access data sources
Tools
Execute functions
Prompts
Pre-built templates
Sampling
AI model interactions

Sourcerer MCP Demo

Overview

Sourcerer MCP is a semantic code search and navigation server that enables AI assistants to locate and retrieve the exact pieces of source code they need—without sifting through entire files or consuming large token budgets. By building a persistent, vector‑based index of a Git repository, it lets agents query concepts such as “functions that handle authentication” or “methods that parse JSON,” returning only the relevant functions, classes, or code blocks. This focused retrieval dramatically reduces the amount of context that must be fed back into a language model, making interactions faster and cheaper.

The server parses the codebase with Tree‑sitter to extract AST nodes that represent meaningful units—functions, classes, methods, and types. Each unit is given a stable identifier () and stored along with its source, location, and a short contextual summary. When files change, Sourcerer automatically re‑indexes them using while respecting , ensuring the index stays in sync with the repository. The resulting embeddings, generated through OpenAI’s API and stored in a Chromem‑go vector database, enable concept‑based search rather than simple keyword matching.

Key capabilities are exposed via MCP tools: returns the most relevant code chunks for a query; fetches the source of a specified chunk; identifies code blocks that are semantically close to a given snippet; and / allow manual control over indexing. These tools let developers and AI agents quickly jump to the exact code they need, whether it’s a helper function in a large library or a specific implementation detail in a new feature branch.

Typical use cases include automated code review assistants that can pull the relevant functions for a given issue, pair‑programming bots that need to suggest refactorings without loading entire files, or documentation generators that locate the right snippets for inline examples. By integrating seamlessly with existing MCP workflows, Sourcerer enhances productivity for developers who rely on AI to navigate complex codebases, offering a token‑efficient, context‑aware alternative to traditional file‑based search.