Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface
MCP server for semantic code search and navigation
Sourcerer MCP builds a semantic search index for a git workspace, then exposes it through MCP tools. It parses code into chunks, stores embeddings in a local database, and lets an agent jump straight to the functions or classes it needs.
Builders who want their agent to search code by meaning instead of reading whole files.
You can find relevant code and jump to exact chunks without wasting tokens on full-file reads.
What it does
Semantic code search
Finds related code by meaning with the `semantic_search` tool instead of simple text matching.
Chunk retrieval
Returns a specific function, class, or method by ID with `get_chunk_code`.
Similar code lookup
Uses `find_similar_chunks` to surface code that matches a selected chunk.
Workspace indexing
Rebuilds or refreshes the index with `index_workspace` and reports progress with `get_index_status`.
Git-aware file tracking
Respects `.gitignore`, watches changes with `fsnotify`, and re-indexes edited files.
How to get it
- 1Run
go install github.com/st3v3nmw/sourcerer-mcp/cmd/sourcerer@latest
- 2Run
brew tap st3v3nmw/tap brew install st3v3nmw/tap/sourcerer
README
Sourcerer MCP π§
An MCP server for semantic code search & navigation that helps AI agents work efficiently without burning through costly tokens. Instead of reading entire files, agents can search conceptually and jump directly to the specific functions, classes, and code chunks they need.
Demo
Requirements
- OpenAI API Key: Required for generating embeddings (local embedding support planned)
- Git: Must be a git repository (respects
.gitignorefiles) - Add
.sourcerer/to.gitignore: This directory stores the embedded vector database
Installation
Go
go install github.com/st3v3nmw/sourcerer-mcp/cmd/sourcerer@latest
Homebrew
brew tap st3v3nmw/tap
brew install st3v3nmw/tap/sourcerer
Configuration
Claude Code
claude mcp add sourcerer -e OPENAI_API_KEY=your-openai-api-key -e SOURCERER_WORKSPACE_ROOT=$(pwd) -- sourcerer
mcp.json
{
"mcpServers": {
"sourcerer": {
"command": "sourcerer",
"env": {
"OPENAI_API_KEY": "your-openai-api-key",
"SOURCERER_WORKSPACE_ROOT": "/path/to/your/project"
}
}
}
}
How it Works
Sourcerer π§ builds a semantic search index of your codebase:
1. Code Parsing & Chunking
- Uses Tree-sitter to parse source files into ASTs
- Extracts meaningful chunks (functions, classes, methods, types) with stable IDs
- Each chunk includes source code, location info, and contextual summaries
- Chunk IDs follow the format:
file.ext::Type::method
2. File System Integration
- Watches for file changes using
fsnotify - Respects
.gitignorefiles viagit check-ignore - Automatically re-indexes changed files
- Stores metadata to track modification times
3. Vector Database
- Uses chromem-go for persistent vector storage in
.sourcerer/db/ - Generates embeddings via OpenAI's API for semantic similarity
- Enables conceptual search rather than just text matching
- Maintains chunks, their embeddings, and metadata
4. MCP Tools
semantic_search: Find relevant code using semantic searchget_chunk_code: Retrieve specific chunks by IDfind_similar_chunks: Find similar chunksindex_workspace: Manually trigger re-indexingget_index_status: Check indexing progress
This approach allows AI agents to find relevant code without reading entire files, dramatically reducing token usage and cognitive load.
Supported Languages
Language support requires writing Tree-sitter queries to identify functions, classes, interfaces, and other code structures for each language.
Supported: Go, JavaScript, Markdown, Python, TypeScript
Planned: C, C++, Java, Ruby, Rust, and others
Contributing
All contributions welcome! See CONTRIBUTING.md.
$ ls @stephenmwangi.com
- gh:st3v3nmw/obsidian-spaced-repetition
- gh:st3v3nmw/lsfr
Files in the repo
- .github
- cmd
- internal
- testdata
- .gitignore
- CODE_OF_CONDUCT.md
- CONTRIBUTING.md
- go.mod
- go.sum
- LICENSE
- README.md
Discussion (0)
Ask about usage, or say what you built with itSign in to join the discussion.
No comments yet. Be the first to say what this is good for.
More connectors
High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph β average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

Universal provider proxy for OpenAI Codex & Claude Code β use any LLM (Claude, Gemini, Grok, DeepSeek, Ollamaβ¦) with Codex CLI, App, SDK, and Claude Code
Git-native persistent memory for AI coding agents. Implements Google OKF v0.2 with sub-300Β΅s in-memory BM25 search, embedded MCP server, and progressive disclosure. Slashes token bloat by 80% with zero external databases or dependencies. Built in pure Go.
Local-first code intelligence graph for MCP and CLI. Builds a persistent map of your codebase so AI coding tools read only what matters, with benchmarked context reductions on reviews and large-repo workflows.
Stop your AI from making things up β it proposes, deterministic tools decide, every claim checked against ground truth with evidence. Grounded facts and context survive resets. Reverse engineering is the proving ground. MCP server + CLI.