MCP Server: Software Project Indexing & Semantic Search
This project provides a Model Context Protocol (MCP) server designed to index software project files and offer semantic search capabilities over the indexed content. It monitors project directories for changes and maintains an up-to-date index.
For detailed design and architectural decisions, please refer to ARCHITECTURE.md.
Usage (End Users)
This server is designed to be run easily by pointing it to the software project you want to index.
1. Run the Server
Navigate to a convenient location in your terminal. The server is started using the python -m command, specifying the module and the path to the project you wish to index.
python -m vector_index_mcp.main_mcp <path_to_your_project>
For example, to index a project located at ~/dev/my_cool_project, you would run:
python -m vector_index_mcp.main_mcp ~/dev/my_cool_project
Or, to index the current directory:
python -m vector_index_mcp.main_mcp .
The server will start, begin watching the specified project path for changes, and create/use a LanceDB database within that project's directory (by default).
2. Configuration
-
PROJECT_PATH(Required, via Command Line):- This is now passed as a direct command-line argument to the server, as shown above. It specifies the root directory of the software project you want to index.
-
Environment Variables (Optional, via
.envfile):-
Other settings can be configured using an
.envfile placed in the directory from where you run thepython -m ...command. The server usespydantic-settingsand will automatically load this.envfile. -
The following variables are supported:
LANCEDB_URI: Path where the LanceDB vector database will be stored.- Default:
./.lancedb(relative to the indexed project's path, meaning it's stored within the project itself).
- Default:
EMBEDDING_MODEL_NAME: The Hugging Face Sentence Transformer model used for generating embeddings.- Default:
all-MiniLM-L6-v2.
- Default:
IGNORE_PATTERNS: Comma-separated list of glob patterns specifying files/directories to exclude from indexing (e.g.,__pycache__/*,.git/*,*.db). These patterns are relative to thePROJECT_PATH.- Default:
.*,*.db,*.sqlite,*.log,node_modules/*,venv/*,.git/*
- Default:
LOG_LEVEL: Logging level for the application.- Default:
INFO.
- Default:
-
Example
.envfile (place this where you run the server command):# --- Optional (Defaults Provided) --- # URI for the LanceDB database. Default is './.lancedb' (inside the indexed project). # LANCEDB_URI=./my_project_index_data/.lancedb # Name of the Sentence Transformer model. Default is 'all-MiniLM-L6-v2'. # EMBEDDING_MODEL_NAME=sentence-transformers/paraphrase-multilingual-mpnet-base-v2 # Comma-separated list of glob patterns to ignore. # Default: .*,*.db,*.sqlite,*.log,node_modules/*,venv/*,.git/* # IGNORE_PATTERNS=*.log,*.tmp,node_modules/*,dist/*,build/* # Logging level. Default is INFO # LOG_LEVEL=DEBUG
-
3. Accessing the Server
Once running, the server provides its functionality via the Model Context Protocol (MCP). You can interact with it using MCP-compatible clients, such as:
- Claude Desktop (if configured to connect to this server)
mcp inspectCLI tool for exploring available tools and resources.
The server will announce its availability over MCP.
4. Editor/IDE Integration (e.g., for Roo)
To connect this MCP server to a compatible editor like Roo, you can configure it in the editor's settings. For Roo, you would create or update the .roo/mcp.json file in your project's root with the following configuration. This tells the editor how to launch and communicate with the server.
.roo/mcp.json:
{
"mcpServers": {
"vector-index-mcp": {
"command": "pipx",
"args": ["run", "vector-index-mcp", "./"],
"timeout": 60,
"env": {}
}
}
}
Development Setup
If you want to contribute to or modify the server itself:
-
Clone the repository:
git clone https://github.com/synonymouse/vector-index-mcp.git cd vector-index-mcp
-
Set up the development environment: This command creates a virtual environment (
.venv) if it doesn't exist, and installs the project in editable mode (-e) along with all runtime and development dependencies specified inpyproject.toml(.[dev]).make install-dev -
Activate the virtual environment:
source .venv/bin/activate
(On Windows using Git Bash or WSL, the command is the same. For Command Prompt/PowerShell, use
.venv\Scripts\activate) -
(Optional) Create a
.envfile in thevector-index-mcpproject root for development-specific settings if needed. For example, to specify a test project path when running directly:# In vector-index-mcp/.env (for development) # No PROJECT_PATH here, as it's passed as an argument LANCEDB_URI=./.dev_lancedb EMBEDDING_MODEL_NAME=all-MiniLM-L6-v2 LOG_LEVEL=DEBUG IGNORE_PATTERNS=__pycache__/*,.git/*,*.tmp
Then run the server pointing to a test project:
python vector_index_mcp/main_mcp.py ../path/to/your/test_project
Development Commands
Ensure your virtual environment is activated (source .venv/bin/activate) before running these make commands from the vector-index-mcp project root:
make test: Run the test suite usingpytest.make lint: Check code style and format usingruff.make run-dev: Runs the development server, indexing the current directory.make clean: Remove temporary files (__pycache__, build artifacts, etc.).make help: Display a list of available commands.
MCP Interface (MCP Tools)
The server provides its functionality through the Model Context Protocol (MCP). Interaction with these tools occurs via an MCP-compatible client.
Available MCP Tools
The following tools are exposed by the server (defined in vector_index_mcp/main_mcp.py):
-
trigger_index- Description: Triggers the indexing process for the specified project path.
- Arguments:
force_reindex: bool(optional, default:False): If true, forces a re-index, clearing any existing index data for the project first.
- Note: The
project_pathitself is implicitly handled by the server instance, as it's configured at startup. The tool acts on this pre-configured path.
-
get_status- Description: Gets the current status of the indexer (e.g., idle, indexing, last_indexed_time).
- Arguments: None.
-
search_index- Description: Searches the vector index for a given query.
- Arguments:
query: str(required): The search query string.top_k: int(optional, default:5): The number of top results to return.
Interacting with MCP Tools
Use an MCP client (like mcp inspect or a programmatic client) to discover and call these tools. The client will handle the communication with the server.
Project Structure
graph TD
MainMCP["vector_index_mcp/main_mcp.py (FastMCP Server)"]
MCPServerClass["vector_index_mcp/mcp_server.py (MCPServer Class)"]
Indexer["vector_index_mcp/indexer.py"]
FileWatcher["vector_index_mcp/file_watcher.py"]
ContentExtractor["vector_index_mcp/content_extractor.py"]
Config["vector_index_mcp/config.py (Settings)"]
Models["vector_index_mcp/models.py (Data Models)"]
PyProject["pyproject.toml"]
README["README.md"]
REFACTORING_PLAN["REFACTORING_PLAN.md"]
Tests["tests/"]
MainMCP --> MCPServerClass
MainMCP --> Config
MCPServerClass --> Indexer
MCPServerClass --> FileWatcher
MCPServerClass --> Config
Indexer --> ContentExtractor
Indexer --> Models
Indexer --> Config
FileWatcher --> Indexer
FileWatcher --> Models
FileWatcher --> Config
PyProject -. Used for build and dependencies .-> MainMCP
PyProject -. Used for build and dependencies .-> MCPServerClass
PyProject -. Used for build and dependencies .-> Indexer
PyProject -. Used for build and dependencies .-> FileWatcher
PyProject -. Used for build and dependencies .-> ContentExtractor
PyProject -. Used for build and dependencies .-> Config
PyProject -. Used for build and dependencies .-> Models
Metadata
Release files for vector-index-mcp 3.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| vector_index_mcp-3.1.2.tar.gz | 101.2 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| vector_index_mcp-3.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 129.0 kB
Release files / vector_index_mcp-3.1.2.tar.gz
| Download URL | vector_index_mcp-3.1.2.tar.gz |
|---|---|
| Size | 101.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1b83af89f3b453271617aea518411201a211fc8a2c51d191301599252165dde8
|
|
BLAKE2b-256 checksum How to use checksums |
ec33404cc31a984167ea17cc6dde1c2f623e0bb783daa88c3ec9ea1440bbbed1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 7, 2025.
Transparency logRelease files / vector_index_mcp-3.1.2-py3-none-any.whl
| Download URL | vector_index_mcp-3.1.2-py3-none-any.whl |
|---|---|
| Size | 27.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
95f0ffb154a04725c396197cb9c054d21ae9ba380c3072001013bec73571445d
|
|
BLAKE2b-256 checksum How to use checksums |
032188e18b6628213a81a5756ef60886b7b2b52906d53afd610b29c68a6d588f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 7, 2025.
Transparency logSecurity for vector-index-mcp 3.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for vector_index_mcp-3.1.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 7, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.