Smart Code Search MCP Server
Enables semantic code search across projects using AI embeddings to find code by meaning rather than just text matching. Provides fast intelligent search, symbol analysis, and code similarity detection with multi-language support.
README
SCS-MCP - Smart Code Search for Claude Desktop
An MCP (Model Context Protocol) server that provides intelligent semantic code search capabilities to Claude Desktop.
Features
- ๐ Semantic Search - Find code by meaning, not just text matching
- ๐งต Thread-Safe - Handles concurrent requests without SQLite threading errors
- ๐ Fast Performance - <100ms search response time with caching
- ๐ Multi-Language Support - Python, JavaScript, TypeScript, and more
- ๐ Hybrid Search - Combines semantic and text matching for best results
Installation
Prerequisites
- Python 3.8+
- Claude Desktop
- WSL (for Windows users)
Quick Install
- Clone the repository:
git clone https://github.com/stevenjjobson/scs-mcp.git
cd scs-mcp
- Run the installer:
./scripts/install.sh
- Configure Claude Desktop by adding to
%APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"scs-mcp": {
"command": "wsl",
"args": [
"bash",
"-c",
"cd /path/to/scs-mcp && python3 -m src.server"
]
}
}
}
- Restart Claude Desktop
Available Tools
1. search
Search code by meaning using AI embeddings
Query: "database connection thread safety"
Returns: ThreadSafeDB class and related implementations
2. index
Index a project for semantic search
Project: /path/to/project
Force: true/false to reindex
3. analyze_symbol
Deep analysis of a specific symbol
Symbol: "SmartCodeSearch"
Returns: Definitions, references, and tests
4. find_similar
Find code similar to a given snippet
Code: "def test():"
Returns: Similar function definitions
5. get_context
Get relevant context for current work
Recent files: ["file1.py", "file2.py"]
Recent symbols: ["function1", "class1"]
Architecture
scs-mcp/
โโโ src/
โ โโโ server.py # Main MCP server
โ โโโ core/
โ โ โโโ clean_search.py # Clean search implementation
โ โ โโโ db_wrapper.py # Thread-safe SQLite wrapper
โ โ โโโ search.py # Search compatibility layer
โ โโโ utils/
โโโ scripts/
โ โโโ install.sh # Installation script
โ โโโ download_model.py # Model downloader
โโโ config/
โ โโโ mcp_config.json # MCP configuration
โโโ requirements.txt
Key Improvements
- โ Fixed SQLite threading issues with thread-local connections
- โ Clean MCP protocol communication (no stdout pollution)
- โ Compatible with existing database schemas
- โ Handles both dictionary and tuple result formats
- โ Semantic search with proven accuracy
Performance
- First search: <100ms (model pre-loaded)
- Cached searches: <20ms
- Memory usage: ~500MB baseline
- Supports 100+ searches/minute
Development
To test the server locally:
python3 scripts/test_server.py
License
MIT
Author
Steven J. Jobson
Acknowledgments
Built for use with Claude Desktop using the Model Context Protocol (MCP).
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
E2B
Using MCP to run code via e2b.