
X402 Codesearch Mcp
io.github.liminalpepe由 GitHub 帳號 liminalpepe 發布v0.1.0更新於 Oct 24, 2026
Free MCP server: index a repo's files into the x402-codesearch Worker's search index.
概覽
一個本機 MCP 伺服器,唯一工具會把儲存庫檔案切塊並產生嵌入後寫入第三方線上語意程式碼搜尋服務的索引。
- 可以做什麼
- 索引程式碼:送出儲存庫識別碼以及檔案路徑與內容清單,由線上服務切塊、產生嵌入並寫入索引,回傳已索引的檔案數與區塊數,並提示搜尋需使用付費端點。
- 適用情境
- 當你希望助理免費把儲存庫檔案推送到該服務的語意搜尋索引,並接受之後檢索結果需自行呼叫付費 HTTP 介面時使用。
- 執行需求
- 透過 stdio 在本機執行,通常以 npx 搭配 Node.js 啟動。索引不需要 API 金鑰或帳號,但需要能連線到該服務的線上索引端點。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 X402 Codesearch Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
x402-codesearch-mcp
A free MCP (Model Context Protocol) server that indexes a repo's files —
chunked and embedded — into the live semantic code search Worker, for free,
via one MCP tool: index_code.
This is the open funnel twin of a paid, x402-gated HTTP API:
x402-codesearch-poc.theliminalguy.workers.dev
— POST /search, $0.01 USDC on Base per query via the
x402 payment protocol, for the actual semantic search
step over an indexed repo.
Why this one is different from the other free twins (read this first)
Sibling packages like x402-repohealth-mcp
fully reimplement their paid Worker's logic locally (pure functions, no
external account-bound dependency) and expose the entire feature for
free via MCP.
This package cannot do that. The paid Worker's semantic search depends on two Cloudflare-account-bound bindings with no free, local, or portable equivalent:
- Workers AI (
@cf/baai/bge-base-en-v1.5) — generates the embeddings - Vectorize — stores and queries those embeddings by cosine similarity
Both only exist inside the Worker's own Cloudflare account. There is no way to run them for free outside that account, so this MCP server does not try to fake or proxy them.
What genuinely is free is POST /index on the live Worker itself — the
step that chunks a file, embeds it, and upserts it into that Worker's own
Vectorize index. That's the one real, free, stateless capability this
package exposes as an MCP tool. The matching POST /search step stays
exactly where it already is: a real x402-gated HTTP call directly against
the live Worker.
What it does
One tool, index_code:
- Input:
{ repoId: string, files: [{ path: string, content: string }] } - Calls
POST https://x402-codesearch-poc.theliminalguy.workers.dev/index(free, no payment) with that exact body. - Output:
{ repoId, filesIndexed, chunksIndexed }plus anotefield reminding the caller that searching what was just indexed requires the paid endpoint.
It does not expose a search_code tool. Semantic search over data
indexed with this tool requires calling the x402-gated endpoint directly:
An unpaid request to /search returns 402 Payment Required with real
x402 payment instructions.
Install & run
Or add it to an MCP client config (e.g. Claude Desktop's
claude_desktop_config.json):
Tool: index_code
Input:
Output (MCP tool text content, JSON-stringified):
Local development
src/client.ts and src/types.ts hold the thin HTTP client against the
live Worker's /index endpoint — src/index.ts is a thin MCP wrapper
around indexCode().
What's real vs. limited
- Real: the
POST /indexcall this tool makes goes to the actual live Worker, which really chunks the given files, really calls Workers AI for embeddings, and really upserts into Vectorize — nothing here is mocked or hardcoded. Verified end-to-end against the live Worker (see below). - Genuinely free:
POST /indexrequires no payment and no API key — confirmed live, not just documented. - Not free, and not exposed here by design:
POST /searchon the same Worker. That's a deliberate scope boundary, not an oversight — see "Why this one is different" above. - No local caching/dedup: every
index_codecall re-POSTs to the live Worker; re-indexing the same file just re-chunks/re-embeds/re-upserts it.
When to use the paid HTTP twin directly
Use POST /search on the live Worker instead of (in addition to) this MCP
server when:
- You've indexed a repo with
index_codeand now want to actually search it semantically. - Your agent already speaks x402 (e.g. via
x402-fetch/x402-axios) and can pay $0.01 USDC on Base per query. - You need production/high-volume search — this MCP server's
index_codetool shares the same free/indexendpoint as every other caller, but/searchis metered per call regardless of caller.
License
MIT
來源:README.md,提交 c155068
工具
0版本歷史
1- v0.1.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分