Thealgorithms Mcp

io.github.mcande21由 GitHub 帳號 mcande21 發布v0.3.1更新於 Oct 27, 2026

Search TheAlgorithms across 24 languages; fetch implementations with examples.

概覽

AI 產生的概覽

搜尋 TheAlgorithms 組織下 24 種程式語言的演算法實作,並取得原始碼與檔案內範例。

可以做什麼
  • 列出已建立索引的語言、數量與別名,並說明被排除的儲存庫及原因
  • 列出指定語言的分類與各分類的條目數
  • 依名稱搜尋演算法,回傳含分類與路徑的排序結果
  • 取得某分類下的所有演算法,或讀取單一檔案的原始碼與擷取出的範例
  • 跨語言比較同一演算法,並列出缺少的語言
  • 依前綴自動補完演算法名稱
適用情境
需要某種語言的經典演算法參考實作、想比較同一演算法在不同語言中的寫法,或想直接取得原始碼檔案中的範例用法時適用。
執行需求
以 stdio 方式在本機執行,可透過 uvx 從 PyPI 安裝(也可從 GitHub 或本機程式碼取出執行)。需要連線至 GitHub 與 raw.githubusercontent.com。不需權杖;可選擇設定 GITHUB_TOKEN 以提高 GitHub API 速率上限。
安裝前請注意
未設定 GITHUB_TOKEN 時可能受 GitHub API 速率限制影響。目錄索引會在本機依 ETag 與 TTL 快取,語言清單快取 7 天,結果可能落後於上游更新。檔案內容依需求從 GitHub 取得。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

thealgorithms-mcp

mcp-name: io.github.mcande21/thealgorithms-mcp

An MCP server for querying the TheAlgorithms org across every language repo — search algorithm implementations and fetch any one with its in-file examples.

Languages are auto-discovered from the org (not a hardcoded list): a repo is indexed when it publishes a parseable DIRECTORY.md — currently 24 languages (Python, Java, C++, JavaScript, Rust, C, TypeScript, PHP, Dart, Kotlin, Ruby, R, Scala, Swift, Julia, Haskell, MATLAB, Zig, Fortran, Nim, Clojure, F#, Jule, aarch64-assembly). Repos without a DIRECTORY.md (Go, C#, Lua, Solidity, …) are reported by list_languages with their exclusion reason — no silent gaps.

Hybrid design: each repo's DIRECTORY.md index is cached locally (ETag + TTL); file contents are fetched on demand from raw.githubusercontent.com. The org/language manifest is auto-discovered via the GitHub API and cached 7 days. No token required (set GITHUB_TOKEN to raise the rate limit). See DESIGN.md.

Tools

ToolPurpose
list_languages()Indexed languages (+ counts, aliases) and excluded repos with reasons
list_categories(language='python')Categories with entry counts for a language
search_algorithms(query, language='python', category?, limit=10)Ranked {name, category, path, score}
get_category(category, language='python')Every algorithm in a category
get_algorithm(path, language='python', include_source=True)Source + extracted examples
compare(name, languages?, min_score=90, limit_per_language=1)Real matches across languages + missing_in
suggest(prefix, language='python', limit=10)Trie-backed name autocomplete (dij → Dijkstra)

language accepts names or aliases (cpp/c++, js, ts, …). Typical flow: search_algorithms("dijkstra", language="rust") → get_algorithm("src/graph/dijkstra.rs", language="rust"). Examples are extracted where the language has an in-file convention (Python doctests, Rust doc-tests); other languages return source plus a note.

Install

From PyPI (recommended):

json
{ "thealgorithms": { "command": "uvx", "args": ["thealgorithms-mcp"] } }

From GitHub:

json
{ "thealgorithms": {    "command": "uvx",    "args": ["--from", "git+https://github.com/mcande21/thealgorithms-mcp", "thealgorithms-mcp"] } }

From a local checkout (development):

bash
uv syncuv run thealgorithms-mcp          # serves over stdio

Add any of the above to ~/.normandy-generic/mcp.json (or your MCP client config).

Verify

bash
uv run python scripts/verify_stdio.py                 # multi-language contract over stdiouv run python scripts/verify_language.py rust         # one language, end-to-end

The harness spawns the server over stdio and asserts every tool against the live org, including binary-search fetch across ≥8 languages and cross-language compare().

來源:README.md,提交 3f22961

工具

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

版本歷史

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

評分

已滿足適用檢查項的 40%

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

  • 近 30 天內可連通25 分

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

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

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

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

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