Sourcerer
MCP for semantic code search & navigation that reduces token waste
What is Sourcerer?
Sourcerer is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to mcp for semantic code search & navigation that reduces token waste
MCP for semantic code search & navigation that reduces token waste
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- MCP for semantic code search & navigation that reduces token
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx sourcererConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Sourcerer
Sourcerer is an MCP server for semantic code search and navigation that helps AI agents work efficiently without burning through token budgets. Instead of reading entire files to find relevant code, agents can issue conceptual searches and jump directly to the specific functions, classes, or modules they need. It uses OpenAI embeddings to index your codebase and supports Go, JavaScript, TypeScript, Python, and Markdown out of the box.
Prerequisites
- Go 1.21 or later installed, OR Homebrew on macOS for the tap-based install
- An OpenAI API key for generating code embeddings (OPENAI_API_KEY)
- An MCP-compatible client such as Claude Code or Claude Desktop
- A local codebase to index (the workspace root path is required at startup)
Install the sourcerer binary
Install via go install or Homebrew. The go install approach works on any platform; the Homebrew tap is the easiest option on macOS.
# Via Go
go install github.com/st3v3nmw/sourcerer-mcp/cmd/sourcerer@latest
# Via Homebrew (macOS)
brew tap st3v3nmw/tap
brew install st3v3nmw/tap/sourcererSet your OpenAI API key
Sourcerer uses OpenAI's embedding API to build a semantic index of your code. Export your API key in your shell or set it in your MCP client configuration.
export OPENAI_API_KEY=sk-...Add sourcerer to Claude Code
The quickest way to register the server with Claude Code is the claude mcp add command. It sets the required environment variables and registers the server in one step.
claude mcp add sourcerer \
-e OPENAI_API_KEY=your-openai-api-key \
-e SOURCERER_WORKSPACE_ROOT=$(pwd) \
-- sourcererOr configure via mcp.json
Alternatively add the server to your project's mcp.json or Claude Desktop config. Set SOURCERER_WORKSPACE_ROOT to the absolute path of the repository you want indexed.
{
"mcpServers": {
"sourcerer": {
"command": "sourcerer",
"env": {
"OPENAI_API_KEY": "your-openai-api-key",
"SOURCERER_WORKSPACE_ROOT": "/absolute/path/to/your/project"
}
}
}
}Index your workspace
On first use, ask the agent to index the workspace using the index_workspace tool. This builds the semantic vector index from your source files. You can monitor progress with get_index_status.
Search your codebase semantically
Use semantic_search to find code by concept rather than exact text. Use get_chunk_code to retrieve the full source of a specific chunk, and find_similar_chunks to locate analogous patterns elsewhere in the codebase.
Sourcerer Examples
Client configuration
MCP client config for sourcerer with the required environment variables.
{
"mcpServers": {
"sourcerer": {
"command": "sourcerer",
"env": {
"OPENAI_API_KEY": "your-openai-api-key",
"SOURCERER_WORKSPACE_ROOT": "/path/to/your/project"
}
}
}
}Prompts to try
Example prompts that use sourcerer's semantic search to navigate a codebase efficiently.
- "Find all functions related to user authentication and token validation"
- "Search for code that handles database connection pooling"
- "Locate the error handling middleware for HTTP requests"
- "Find similar patterns to the retry logic in the payments module"
- "Show me where the caching layer is initialized and configured"Troubleshooting Sourcerer
Index build fails with OpenAI API errors
Verify your OPENAI_API_KEY is valid and has not exceeded its rate limit or quota. The embedding API requires an active key with sufficient credits. Check your usage at platform.openai.com.
sourcerer binary not found after installation
If installed via go install, ensure $GOPATH/bin (typically ~/go/bin) is in your PATH. Run: export PATH=$PATH:$(go env GOPATH)/bin. For Homebrew, run: brew link sourcerer.
Files are not appearing in search results
Only Go, JavaScript, TypeScript, Python, and Markdown files are currently indexed. Verify SOURCERER_WORKSPACE_ROOT points to the correct directory and re-run the index_workspace tool to rebuild the index after adding new files.
Frequently Asked Questions about Sourcerer
What is Sourcerer?
Sourcerer is a Model Context Protocol (MCP) server that mcp for semantic code search & navigation that reduces token waste It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Sourcerer?
Follow the installation instructions on the Sourcerer GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Sourcerer?
Sourcerer works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Sourcerer free to use?
Yes, Sourcerer is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Sourcerer Alternatives — Similar Developer Tools Servers
Looking for alternatives to Sourcerer? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
Browse More Developer Tools MCP Servers
Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Sourcerer in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Sourcerer?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.