Sunstone Weave: Local Semantic Code Search

io.github.space-bacon由 GitHub 帳號 space-bacon 發布v0.1.2更新於 Oct 24, 2026

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

已驗證STDIO僅桌面知識與記憶開發者工具

概覽

AI 產生的概覽

一個本機 MCP 伺服器,在 CPU 上為程式碼與文件資料夾建立語意索引,讓助理用自然語言或程式碼查詢找到相關片段

可以做什麼
索引資料夾或增量更新其索引,耗時較久時在背景繼續執行。在已編織的資料夾中依自然語言或程式碼查詢檢索最相近的片段,回傳檔案路徑、行範圍與分數。列出已編織的資料夾及其檔案與片段數量,以及仍在執行的編織工作。刪除某個資料夾的索引,但不動其檔案。
適用情境
適合讓助理依語意而非精確文字在本機程式碼庫與文件中定位內容,例如回答某個值在哪裡被解析。由於檢索完全在本機 CPU 上執行,也適合離線或注重隱私的情境。
執行需求
透過 npx 以本機 stdio 程序執行,需要 Node 20 或更新版本,支援 macOS、Linux 與 Windows;應先從終端機安裝一次再加入用戶端。需傳入一個或多個 --folder 路徑,或讓模型呼叫 weave_folder。首次執行會從 huggingface.co 下載約 134 MB 的編碼器檔案到快取目錄,可用 BLACKWINDOW_WEAVE_CACHE 或 --cache 設定。在 Linux x64 上安裝時還可能下載並未使用的 CUDA 函式庫。
安裝前請注意
首次安裝可能超過用戶端的啟動逾時,並在 npm 快取中留下損壞的副本,因此應先從終端機安裝並固定版本。weave_folder 會將索引資料寫入快取目錄,weave_forget 會刪除某資料夾的索引,但不會刪除其檔案。首次執行會連線 huggingface.co,之後執行不再發出網路請求。索引以檔案形式保存在快取路徑下。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Sunstone Weave: Local Semantic Code Search,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

blackwindow-weave-mcp

Semantic search over the folders on your machine, for any MCP client. The server cuts source code and documentation into passages, embeds them with Motherlode, a 33M-parameter code-search encoder, on your CPU, and answers questions such as "where is a pairing line parsed into url, key and name" with file paths, line ranges and the passages themselves.

The only network requests are to huggingface.co on the first run: six requests, which leave five files, 133,752,819 bytes, in the cache. With the files cached, a run makes none.

This is the weave from Black Window and the Sunstone VS Code extension, packaged for clients that speak the Model Context Protocol. It runs on macOS, Linux and Windows with Node 20 or later.

Install

Install it once from a terminal, before adding it to a client. This installs the package and ONNX Runtime and prints the version once the runtime has loaded:

sh
npx -y [email protected] --version

On GitHub's hosted runners, from an empty npm cache, this first install took 7 to 13 s on Linux and macOS and 55 to 69 s on Windows. Clients wait a limited time for a server to start (the MCP SDK's default is 60 s), and a client that stops waiting in the middle of an install can leave a broken copy in npm's cache (see Troubleshooting). Once installed, the server starts in under 3 s.

Keep the version in the client's configuration the same as here. With a version given, npx starts the copy it installed; with the bare name, npx (npm 11) looks for a newer version on every start and installs it while the client waits.

On Linux x64, ONNX Runtime also downloads 236 MB of CUDA libraries during the install. This server runs on the CPU and never loads them, so you can skip them:

sh
ONNXRUNTIME_NODE_INSTALL=skip npx -y [email protected] --version

Add it to a client

macOS and Linux

Claude Code:

sh
claude mcp add weave -- npx -y [email protected] --folder /path/to/your/repo

VS Code, in .vscode/mcp.json:

json
{  "servers": {    "weave": { "type": "stdio", "command": "npx", "args": ["-y", "[email protected]", "--folder", "${workspaceFolder}"] }  }}

Cursor, Claude Desktop, Windsurf and most other clients:

json
{  "mcpServers": {    "weave": { "command": "npx", "args": ["-y", "[email protected]", "--folder", "/path/to/your/repo"] }  }}

Windows

On Windows npx is a batch file, which a client can only start through cmd /c. Claude Code:

sh
claude mcp add weave -- cmd /c npx -y [email protected] --folder C:\path\to\your\repo

Cursor, Claude Desktop, Windsurf and most other clients:

json
{  "mcpServers": {    "weave": { "command": "cmd", "args": ["/c", "npx", "-y", "[email protected]", "--folder", "C:/path/to/your/repo"] }  }}

In VS Code the same command and args go under servers in .vscode/mcp.json, with "type": "stdio".

Installed globally

npm install -g [email protected] installs a blackwindow-weave-mcp command, which a client can start directly (cmd /c blackwindow-weave-mcp on Windows). To run from this repository instead of npm, replace [email protected] in the arguments with github:space-bacon/blackwindow-weave-mcp.

optionmeaning
--folder <path>Weave this folder when the server starts. Repeatable. Optional: the model can call weave_folder itself.
--cache <dir>Where the encoder and the indexes live. Default ~/.cache/blackwindow-weave (on Windows %USERPROFILE%\.cache\blackwindow-weave), or BLACKWINDOW_WEAVE_CACHE.
--versionPrint the version and exit.

Platforms

Every push runs CI on Linux (x64 and arm64), Windows (x64) and macOS (Apple silicon), each with Node 20, 22 and 24. Each job runs the stdio smoke test below from a checkout. It then installs the packed package through npx from an empty npm cache, starts it the way a client does and weaves a folder. On Windows it also starts it through cmd /c. Last, it installs the package globally and starts it by its command. Other platforms, such as Windows on Arm, Intel Macs and Alpine Linux, are not tested.

Troubleshooting

The client times out when it first starts the server, or the server stops with Cannot find module ... transformers.node.mjs. A first install was interrupted, usually by a client that stopped waiting, and npm kept the half-installed copy. Delete npm's npx cache and install again from a terminal with the line under Install:

  • macOS and Linux: rm -rf ~/.npm/_npx
  • Windows (PowerShell): Remove-Item -Recurse -Force "$env:LOCALAPPDATA\npm-cache\_npx"

Updating. Install the new version from a terminal as above, then change the version in the client's configuration.

Tools

toolwhat it does
weave_folderIndex 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_searchThe 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_listThe woven folders with their file and passage counts, and any weave still running.
weave_forgetDelete a folder's index. The folder's files are not touched.

Measured

On an Apple M2 Ultra (24 CPU cores, Node 24.4.1), through the MCP SDK's own stdio client, in test/smoke.mjs:

folderfilespassagesfirst weavesecond weavesearch
this package's src/6423.8 s, with the encoder's download0.013 s5 to 6 ms
the Sunstone repository571,36720.2 s0.014 s6 ms

Embedding runs at about 68 passages a second on that machine, so a repository of 10,000 passages takes about two and a half minutes the first time. Those figures are one run each on one machine. The smoke test's three questions about this package's own source each return the expected file first; they are a check that the pieces are wired together, not a measure of retrieval quality. For retrieval quality see the model card.

How it works

  • Files. A git work tree is listed by git, so .gitignore holds. Any other folder is walked, skipping node_modules, build output, virtual environments, lock files and minified files. Files over 1 MB and files that read as binary are skipped. JSON and XML are left out: in the Sunstone repository, result files under bench/results/ took ranks 2 and 3 of the question above when they were included.
  • Passages. Code is cut at definitions into passages of about 700 characters, each labelled with the nearest definition. Prose is cut at paragraphs and sentences into passages of about 420 characters. The chunkers are Black Window's.
  • Encoder. onnx/model.onnx (fp32) through transformers.js and ONNX Runtime on the CPU, CLS pooling.
  • Centring. Every vector has the model's shipped mean (centring/mean_shipped.json) subtracted and is brought back to unit length, so a score is a cosine after centring.
  • Search. Exact: every passage is scored. Before answering, a folder not checked in the last 30 s is brought up to date if fewer than 200 of its files changed; otherwise the answer says the index is stale.
  • Index. One per folder under <cache>/index/: a Float32 matrix and a JSONL of passages, named by a manifest that is written to a temporary file and renamed into place, so an interrupted write leaves the previous index. An index that cannot be read is moved aside rather than overwritten.

Licence

Business Source License 1.1 with an internal-use grant. You may use it for any internal purpose, including commercial development on your own or your employer's code, with no limit on seats. You may not offer it to others as a hosted search service or ship it inside a product you supply. On 15 September 2030 it becomes Apache-2.0. The encoder is downloaded under its own licence, which has the same shape. For other terms, write to [email protected].

來源:README.md,提交 4acc79d

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

3
  1. v0.1.2最新Oct 1, 2026
  2. v0.1.1Sep 30, 2026
  3. v0.1.0Sep 30, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。