Enterprise Code Search MCP Server
Allows indexing and semantic search of Git repositories, enabling AI-powered code discovery across version-controlled codebases
Provides local, private AI embeddings for semantic code search, supporting models like nomic-embed-text and all-minilm for enterprise code analysis without external API calls
Enables semantic code search using OpenAI's embedding models (text-embedding-3-small, text-embedding-3-large) for generating vector representations of code
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Enterprise Code Search MCP Server search for authentication logic in all indexed projects"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Enterprise Code Search MCP Server
A powerful Model Context Protocol (MCP) server for semantic code search with shared vector database. Supports both OpenAI and Ollama for embeddings, and can index local projects or Git repositories.
š Features
Semantic code search using AI embeddings
Dual provider support: OpenAI or Ollama (local, private)
Flexible indexing: Local projects or Git repositories
Shared vector database with ChromaDB
Multi-project management: Handle multiple projects simultaneously
Automatic project structure analysis
Similar code search based on code snippets
Enterprise-ready: Private, secure, self-hosted
Related MCP server: MCP Codebase Index
š Requirements
Node.js 18+
Docker and Docker Compose
Git (for repository indexing)
š ļø Quick Start
1. Clone the repository
git clone https://github.com/your-username/semantic-context-mcp.git
cd semantic-context-mcp2. Install dependencies
npm install3. Configure environment
cp .env.example .env
# Edit .env with your configuration4. Start services
# Start ChromaDB and Ollama
docker-compose up -d
# Wait for Ollama to download models
docker-compose logs -f ollama-setup5. Build and run
npm run build
npm startāļø Configuration
Using Ollama (Recommended for Enterprise)
# .env
EMBEDDING_PROVIDER=ollama
OLLAMA_HOST=http://localhost:11434
OLLAMA_MODEL=nomic-embed-text
CHROMA_HOST=localhost
CHROMA_PORT=8000Using OpenAI
# .env
EMBEDDING_PROVIDER=openai
OPENAI_API_KEY=your-api-key
OPENAI_MODEL=text-embedding-3-smallš§ Claude Desktop Integration
To use this MCP server with Claude Desktop, add to your claude_desktop_config.json:
{
"mcpServers": {
"enterprise-code-search": {
"command": "node",
"args": ["/path/to/semantic-context-mcp/dist/index.js"],
"env": {
"EMBEDDING_PROVIDER": "ollama",
"OLLAMA_HOST": "http://localhost:11434",
"OLLAMA_MODEL": "nomic-embed-text",
"CHROMA_HOST": "localhost",
"CHROMA_PORT": "8000",
"COMPANY_NAME": "YourCompany"
}
}
}
}šÆ Usage Examples
1. Index a local project
Index my local project at /home/user/my-app with the name "frontend-app"2. Search in code
Search for "main application function" in all indexed projects3. Find similar code
Find code similar to:
```python
def authenticate_user(username, password):
return check_credentials(username, password)4. Analyze project structure
Analyze the structure of project "frontend-app"š ļø Available Tools
Tool | Description |
| Index a local directory |
| Semantic search in code |
| List all indexed projects |
| Get embedding provider information |
š Example Queries
Functional searches
"Where is the authentication logic?"
"Functions that handle database operations"
"Environment variable configuration"
"Unit tests for the API"
Code analysis
"What design patterns are used?"
"Most complex functions in the project"
"Error handling in the code"
Technology-specific search
"Code using React hooks"
"PostgreSQL queries"
"Docker configuration"
š§ Advanced Configuration
Recommended Ollama Models
# For code embeddings
ollama pull nomic-embed-text # Best for code (384 dims)
ollama pull all-minilm # Lightweight alternative (384 dims)
ollama pull mxbai-embed-large # Higher precision (1024 dims)File Patterns
The server supports extensive file type recognition including:
Programming Languages: Python, JavaScript/TypeScript, Java, C/C++, Go, Rust, PHP, Ruby, Swift, Kotlin, Scala, and more
Web Technologies: HTML, CSS, SCSS, Vue, Svelte
Configuration: JSON, YAML, TOML, Docker, Terraform
Documentation: Markdown, reStructuredText, AsciiDoc
Database: SQL files
Performance Tuning
# Maximum chunk size (characters)
MAX_CHUNK_SIZE=1500
# Maximum file size (KB)
MAX_FILE_SIZE=500
# Batch size for indexing
BATCH_SIZE=100š¢ Enterprise Deployment
Option 1: Dedicated Server
# On enterprise server
docker-compose up -dOption 2: Network Deployment
# Configure for network access
CHROMA_HOST=192.168.1.100
OLLAMA_HOST=http://192.168.1.100:11434š Security Considerations
Key Benefits
Private Data: Ollama keeps everything local
No External APIs: When using Ollama, no data leaves your network
Self-hosted: Full control over your code and embeddings
Isolated Environment: Docker containers provide isolation
Security Best Practices
# Restrict ChromaDB access
CHROMA_SERVER_HOST=127.0.0.1 # Localhost only
# Use HTTPS for production
OLLAMA_HOST=https://ollama.company.comš Monitoring & Troubleshooting
Useful Logs
# View indexing logs
docker-compose logs -f enterprise-mcp-server
# ChromaDB performance
docker-compose logs -f chromadb
# Monitor Ollama
curl http://localhost:11434/api/tagsCommon Issues
Ollama not responding:
curl http://localhost:11434/api/tags
# If it fails: docker-compose restart ollamaChromaDB slow:
# Check disk space
docker system df
# Clean if necessary
docker system prunePoor embedding quality:
Try different model:
all-minilmvsnomic-embed-textAdjust chunk size
Verify source file quality
š¤ Collaborative Workflow
Typical Enterprise Workflow
DevOps indexes main projects
Developers search code using Claude
Automatic updates via CI/CD
Code analysis for code reviews
Best Practices
Index after important merges
Use descriptive project names
Maintain project-specific search filters
Document naming conventions
š ļø Development
Project Structure
src/
āāā index.ts # Main MCP server
āāā http-server.ts # HTTP server variant
scripts/ # Setup and utility scripts
docker-compose.yml # Service orchestration
package.json # Dependencies and scriptsAvailable Scripts
npm run build # Compile TypeScript
npm run dev # Development mode
npm run start # Production mode
npm run clean # Clean build directoryš API Reference
The MCP server implements the standard Model Context Protocol with these specific tools:
index_local_project: Index local directories with configurable file patterns
search_codebase: Semantic search with project filtering and similarity scoring
list_indexed_projects: Enumerate all indexed projects with metadata
get_embedding_provider_info: Get current provider status and configuration
Each tool includes detailed JSON schema with examples and validation.
š¤ Recommended AI Models
For embeddings (Ollama)
nomic-embed-text: Optimized for codeall-minilm: Balanced, fastmxbai-embed-large: High precision
For embeddings (OpenAI)
text-embedding-3-small: Cost-effectivetext-embedding-3-large: Higher precision
š³ Docker Support
The project includes a complete Docker setup:
ChromaDB: Vector database for embeddings
Ollama: Local embedding generation
PostgreSQL: Optional metadata storage
All services are orchestrated with Docker Compose for easy deployment.
ā Support
If this project helps you with your development workflow, consider supporting it:

š License
MIT License - see LICENSE file for details.
š¤ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Fork the project
Create your feature branch (
git checkout -b feature/AmazingFeature)Commit your changes (
git commit -m 'Add some AmazingFeature')Push to the branch (
git push origin feature/AmazingFeature)Open a Pull Request
š Support & Issues
š§ Issues: GitHub Issues
š¬ Discussions: GitHub Discussions
ā Support: Buy Me a Coffee
Available Tools
4 toolsget_embedding_provider_infoB
Get information about the current embedding provider
Inputs: no named parameters.
index_local_projectC
Index a local project directory into the vector database
Inputs: project_name (required), project_path (required), exclude_patterns, include_patterns.
list_indexed_projectsB
List all projects currently indexed
Inputs: no named parameters.
search_codebaseC
Search the indexed codebase using semantic search
Inputs: query (required), limit, project_filter.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose with no overlap: get_embedding_provider_info retrieves configuration details, index_local_project handles indexing, list_indexed_projects enumerates existing projects, and search_codebase performs semantic queries. The descriptions clearly differentiate between setup, management, and query operations.
All tools follow a consistent verb_noun naming pattern (e.g., get_embedding_provider_info, index_local_project, list_indexed_projects, search_codebase). The verbs (get, index, list, search) are appropriately descriptive and maintain a uniform snake_case style throughout.
With 4 tools, this server is well-scoped for enterprise code search, covering essential operations: provider info retrieval, indexing, project listing, and semantic search. Each tool earns its place without redundancy, making the set manageable and focused on core functionality.
The toolset covers the primary workflows for code search: setup (get provider info), ingestion (index projects), management (list projects), and querying (search). A minor gap exists in update/delete operations for indexed projects (e.g., reindexing or removal), but agents can likely work around this with the provided tools.
Related MCP Connectors
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Codebase intelligence for AI coding agents: graph, git history, docs, decisions, code health.
Shared memory for coding agents. Stop re-explaining your codebase every session.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides semantic code search capabilities that run 100% locally using EmbeddingGemma embeddings. Enables finding code by meaning across 15 file extensions and 9+ programming languages without API costs or sending code to the cloud.238-
- AlicenseNot gradedqualityDmaintenanceEnables semantic search across your codebase using Google's Gemini embeddings and Qdrant Cloud vector storage. Supports 15+ programming languages with smart code chunking and real-time file change monitoring.67 npm20MIT
- AlicenseAqualityDmaintenanceProvides intelligent semantic code search using local AI embeddings, enabling natural language queries to find relevant code by meaning rather than exact keywords. Indexes codebases in the background with smart project detection and privacy-first local processing.6114 npm200MIT
- AlicenseAqualityDmaintenanceProvides semantic code search over codebases using local embeddings with natural language queries. Supports hybrid search, file watching, and respects .gitignore.117MIT