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.

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

概覽

AI 產生的概覽

一個本機 MCP 伺服器,唯一工具會把儲存庫檔案切塊並產生嵌入後寫入第三方線上語意程式碼搜尋服務的索引。

可以做什麼
索引程式碼:送出儲存庫識別碼以及檔案路徑與內容清單,由線上服務切塊、產生嵌入並寫入索引,回傳已索引的檔案數與區塊數,並提示搜尋需使用付費端點。
適用情境
當你希望助理免費把儲存庫檔案推送到該服務的語意搜尋索引,並接受之後檢索結果需自行呼叫付費 HTTP 介面時使用。
執行需求
透過 stdio 在本機執行,通常以 npx 搭配 Node.js 啟動。索引不需要 API 金鑰或帳號,但需要能連線到該服務的線上索引端點。
安裝前請注意
每次呼叫都會把檔案內容傳送到第三方的線上服務,且本機不做快取,重複索引會再次傳送並重新產生相同檔案的嵌入。此工具只負責索引,不提供語意搜尋;搜尋需透過另一個付費端點,每次查詢 0.01 USDC(Base 網路)。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 X402 Codesearch Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

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 a note field 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:

POST https://x402-codesearch-poc.theliminalguy.workers.dev/searchBody: { "repoId": "...", "query": "..." }Price: $0.01 USDC on Base, via the x402 protocol (e.g. x402-fetch / x402-axios)

An unpaid request to /search returns 402 Payment Required with real x402 payment instructions.

Install & run

bash
npx x402-codesearch-mcp

Or add it to an MCP client config (e.g. Claude Desktop's claude_desktop_config.json):

json
{  "mcpServers": {    "codesearch": {      "command": "npx",      "args": ["-y", "x402-codesearch-mcp"]    }  }}

Tool: index_code

Input:

jsonc
{  "repoId": "my-repo",  "files": [    { "path": "src/retry.py", "content": "def retry_with_backoff(...): ..." }  ]}

Output (MCP tool text content, JSON-stringified):

jsonc
{  "repoId": "my-repo",  "filesIndexed": 1,  "chunksIndexed": 2,  "note": "Indexing succeeded (free). To semantically search this repoId, call the x402-gated POST https://x402-codesearch-poc.theliminalguy.workers.dev/search directly ($0.01 USDC on Base per query) — not available through this free MCP tool."}

Local development

bash
npm installnpm run dev              # runs src/index.ts directly on stdio via tsxnpm run build             # compiles to dist/ for the published npm packagenpm run test:index        # calls indexCode() directly against the real live Worker, no MCP transport

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 /index call 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 /index requires no payment and no API key — confirmed live, not just documented.
  • Not free, and not exposed here by design: POST /search on 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_code call 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_code and 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_code tool shares the same free /index endpoint as every other caller, but /search is metered per call regardless of caller.

License

MIT

來源:README.md,提交 c155068

工具

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

版本歷史

1
  1. v0.1.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

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

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

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

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