Advanced MCP server for code intelligence using Tree-sitter, DuckDB, and ChromaDB
Project description
CodeInteliMCP - Intelligent Code Analysis Server
An advanced MCP (Model Context Protocol) server that combines Tree-sitter parsing with graph databases and vector search for lightning-fast code intelligence across multiple repositories.
๐ Features
- Multi-Repository Support: Manage and analyze multiple codebases simultaneously
- Instant Usage Search: Find where functions/classes are used in milliseconds
- Semantic Code Search: Find similar code patterns using vector embeddings
- Dependency Analysis: Visualize and query code dependencies
- Impact Analysis: See what breaks when you change something
- Auto-indexing: Smart incremental updates as you code
- Multi-language Support: Python, JavaScript, TypeScript, Go, Rust, and more
๐ Architecture
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ Claude Code โโโโโโถโ MCP Server โโโโโโถโ Tree-sitter โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ โ
โผ โผ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ
โ DuckDB โ โ ChromaDB โ
โ (Graph) โ โ (Vectors) โ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ
๐ฏ Core Capabilities
1. Graph Queries (via DuckDB)
- Function call relationships
- Import dependencies
- Class inheritance trees
- Variable usage tracking
2. Vector Search (via ChromaDB)
- Semantic code similarity
- Natural language code search
- Pattern detection
- Code duplication finding
3. Real-time Analysis (via Tree-sitter)
- On-demand parsing
- Syntax validation
- Code structure analysis
- AST manipulation
๐ฆ Quick Start
Automated Setup (Recommended)
# Clone the repository
git clone https://github.com/rahulvgmail/CodeInteliMCP.git
cd CodeInteliMCP
# Run the setup script
python setup_for_claude.py
The setup script will:
- Install all dependencies
- Configure Claude Desktop/Code
- Create data directories
- Set up environment variables
Manual Setup
# Install dependencies
pip install mcp duckdb chromadb sentence-transformers aiofiles
pip install tree-sitter tree-sitter-python tree-sitter-javascript
# Add to Claude Desktop config (~/.config/claude/claude_desktop_config.json):
{
"mcpServers": {
"code-intelligence": {
"command": "python",
"args": ["/path/to/CodeInteliMCP/code_intelligence_mcp/server_minimal.py"],
"env": {
"CODE_INTEL_PROJECT_ROOT": "/path/to/your/project"
}
}
}
}
๐ ๏ธ Available Tools
This MCP server provides the following tools:
Repository Management
-
add_repository- Add a new repository to trackname(string, required): Repository namepath(string, required): Path to repositorydescription(string, optional): Repository descriptionmake_active(boolean, optional): Set as active repository
-
list_repositories- List all tracked repositories -
set_active_repository- Set the active repository for operationsname(string, required): Repository name to make active
-
index_repository- Index an entire repositoryrepository_name(string, required): Name of repository to indexinclude_patterns(string, optional): Comma-separated file patterns to includeexclude_patterns(string, optional): Comma-separated file patterns to exclude
Code Analysis
-
index_file- Index a single file into the code graphfile_path(string, required): Path to the file to index
-
find_symbol- Find a symbol by namename(string, required): Symbol name to search forfile_path(string, optional): Limit search to specific file
-
find_usages- Find all usages of a symbolname(string, required): Symbol name to find usages forfile_path(string, optional): Limit search to specific file
-
semantic_search- Search for code using semantic similarityquery(string, required): Natural language search querylimit(integer, optional): Maximum number of results (default: 10)symbol_types(string, optional): Comma-separated list of symbol types to filter
-
find_similar_code- Find code similar to a given symbolsymbol_name(string, required): Reference symbol namefile_path(string, optional): File containing the reference symbol
System Tools
-
test_connection- Test that the server is working -
get_index_stats- Get current index statistics -
get_vector_stats- Get vector store statistics
๐ Usage Examples
Once configured, use these tools in Claude:
# Add a new repository
add_repository(name="my-app", path="/path/to/my-app", description="Main application")
# Index the repository
index_repository(repository_name="my-app", include_patterns="**/*.py,**/*.js")
# Search for authentication functions
semantic_search(query="authentication and login functions", limit=20)
# Find where a class is used
find_usages(name="UserService")
# Find similar implementations
find_similar_code(symbol_name="login_user")
๐ Documentation
- USER_GUIDE.md: Complete setup and usage guide
- ARCHITECTURE.md: Technical architecture details
- IMPLEMENTATION_PLAN.md: Development roadmap
๐ Performance Targets
- Initial indexing: < 1 minute for 100k LOC
- Incremental updates: < 1 second per file
- Usage queries: < 50ms
- Semantic search: < 200ms
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iflow_mcp_rahulvgmail_codeintelimcp-0.1.0.tar.gz.
File metadata
- Download URL: iflow_mcp_rahulvgmail_codeintelimcp-0.1.0.tar.gz
- Upload date:
- Size: 32.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7f5e8dfef11e98432e2148d18d066f1668042a660400f6ddf2aed9421d270e0
|
|
| MD5 |
c3eb9d1c6de48a0f56926c00d71979b8
|
|
| BLAKE2b-256 |
a969e72a958597d45d788db00898dee7784a6a6238b3a0d90d4ac99e3cab230f
|
File details
Details for the file iflow_mcp_rahulvgmail_codeintelimcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: iflow_mcp_rahulvgmail_codeintelimcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 40.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb648c76a7c9cb7bb5d8e547891026e79d4e7528d0b337ecf7dd13e4bec14942
|
|
| MD5 |
9478ea8fa30e2bdedb205e7bbeb0a4b9
|
|
| BLAKE2b-256 |
6e576e7060654a9280b23f1b6881a3409b444f919ef8f1670f9acf233aea1cc3
|