# Sunstone Weave: Local Semantic Code Search [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/space-bacon/blackwindow-weave-mcp  
**GitHub Stars:** 1  
**npm Downloads (last month):** 348  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/sunstone-weave-local-semantic-code-search

## Description
Semantic search over local folders of code and docs, with a code-search encoder running on your CPU.

## Tools
Capabilities this server exposes over MCP:

- **weave_folder** — Index a folder, or bring its index up to date. Only files whose size or modification time changed are read again. A run longer than 25 s returns at once and continues in the background.
- **weave_search** — The passages nearest a plain-language or code query, with file, line range and score. Searches the folders woven in this session, or every woven folder if none was, or one folder when asked.
- **weave_list** — The woven folders with their file and passage counts, and any weave still running.
- **weave_forget** — Delete a folder's index. The folder's files are not touched.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "sunstone-weave-local-semantic-code-search": {
    "command": "npx",
    "args": ["-y","blackwindow-weave-mcp@0.1.2"],
    "env": {
      "BLACKWINDOW_WEAVE_CACHE": "",
      "ONNXRUNTIME_NODE_INSTALL": ""
    }
  }
}
```

**Requires environment variables:** `BLACKWINDOW_WEAVE_CACHE`, `ONNXRUNTIME_NODE_INSTALL` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What Sunstone Weave does

Sunstone Weave: Local Semantic Code Search gives MCP clients semantic search over folders on the local machine. It is intended for source code and documentation, allowing an agent to ask questions in natural language or with code-oriented wording and receive nearby passages. Results include the source file, line range, passage text, and a similarity score.

The server keeps a separate index for each woven folder. A folder can be supplied when the process starts, or the model can request indexing through the MCP tools. Re-indexing checks file size and modification time, so unchanged files are not read again. Removing an index does not alter the underlying folder.

## How it works

The server uses the Motherlode code-search encoder, a 33-million-parameter model, through transformers.js and ONNX Runtime. Embeddings run on the CPU. Code is divided around definitions into passages of roughly 700 characters, while prose is divided around paragraphs and sentences into passages of roughly 420 characters. Vectors are centred using the model’s shipped mean and normalized before exact passage scoring.

Git work trees are enumerated through Git, which respects `.gitignore`. Other folders are walked directly. The indexer skips common dependency and build directories, virtual environments, lock files, minified files, files larger than 1 MB, and files detected as binary. JSON and XML are also excluded.

Search scores every passage in the selected indexes. A folder that has not been checked recently may be refreshed automatically when fewer than 200 files changed. If more changes are detected, the response reports that the index is stale rather than performing that update during the search.

## Setup and configuration

Sunstone Weave: Local Semantic Code Search runs on macOS, Linux, and Windows with Node 20 or newer. Install the pinned npm package from a terminal before configuring a client:

```sh
npx -y blackwindow-weave-mcp@0.1.2 --version
```

The server uses stdio. Configure the client to start that command and pass one or more `--folder` arguments, or let the model call `weave_folder` after startup. On Windows, clients must start `npx` through `cmd /c`.

The encoder and folder indexes are stored under `~/.cache/blackwindow-weave` by default, or under the equivalent Windows user cache directory. Set `BLACKWINDOW_WEAVE_CACHE` to change that location. On Linux x64, `ONNXRUNTIME_NODE_INSTALL=skip` avoids downloading unused CUDA libraries because this server runs on the CPU.

The first install downloads the runtime and encoder assets. The README reports six requests to Hugging Face and about 134 MB of cached files on the first run; subsequent runs do not make those requests when the files remain cached. A client timeout during installation can leave an incomplete npm cache entry, which should be removed before reinstalling.

## Tools and capabilities

- `weave_folder` creates or updates a folder index. Runs exceeding 25 seconds return while indexing continues in the background.
- `weave_search` finds passages closest to a plain-language or code query. It searches folders woven in the current session, all woven folders when no scope is given, or a requested folder.
- `weave_list` reports woven folders, file and passage totals, and active indexing work.
- `weave_forget` deletes a folder’s index without deleting or modifying its files.

## Limitations and notes

Indexing and search performance depends on repository size and hardware. The README measures about 68 passages per second on an Apple M2 Ultra, but those figures are from one machine and are not retrieval-quality benchmarks. The project points to the encoder’s model card for retrieval evaluation.

Other than the initial Hugging Face download, the documented operation is local. Platforms tested by CI include Linux x64 and arm64, Windows x64, and Apple silicon macOS. Windows on Arm, Intel Macs, and Alpine Linux are not tested.

The software is licensed under Business Source License 1.1 with an internal-use grant. It permits internal use, including commercial development on an organization’s code, but prohibits offering the software as a hosted search service or shipping it inside a supplied product. The license changes to Apache-2.0 on 15 September 2030; the encoder has its own license with similar terms.

_Full upstream README: https://allmcps.com/mcp/sunstone-weave-local-semantic-code-search/readme_

