io.github.mcande21/thealgorithms-mcp

السجل الرسمي البحث والويب

Search TheAlgorithms across 24 languages; fetch implementations with examples.

التثبيت

أضف هذا إلى إعدادات MCP في عميلك (Claude Desktop: claude_desktop_config.json، وCursor: ‏.cursor/mcp.json، ويستخدم VS Code وغيره الصيغة نفسها «mcpServers»).

PYPI package thealgorithms-mcp
Claude Code
claude mcp add thealgorithms-mcp -- uvx thealgorithms-mcp==0.3.1
إعداد JSON (Claude Desktop وCursor وVS Code)
{
    "mcpServers": {
        "thealgorithms-mcp": {
            "command": "uvx",
            "args": [
                "thealgorithms-mcp==0.3.1"
            ]
        }
    }
}

التوثيق

مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.

المحتويات
  1. thealgorithms-mcp
  2. Tools
  3. Install
  4. Verify

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):

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

From GitHub:

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

From a local checkout (development):

uv sync
uv run thealgorithms-mcp          # serves over stdio

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

Verify

uv run python scripts/verify_stdio.py                 # multi-language contract over stdio
uv 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().

الأسئلة الشائعة

ما هو io.github.mcande21/thealgorithms-mcp؟

Search TheAlgorithms across 24 languages; fetch implementations with examples.

كيف أثبّت io.github.mcande21/thealgorithms-mcp؟

يعمل على جهازك. في Claude Code: claude mcp add thealgorithms-mcp -- uvx thealgorithms-mcp==0.3.1. وفي العملاء الآخرين، الصق إعداد JSON من هذه الصفحة في إعدادات MCP الخاصة بهم.

هل يحتاج io.github.mcande21/thealgorithms-mcp إلى مفتاح API؟

لا يذكر إدراجه في السجل أي مفتاح أو سر إلزامي. قد تتطلب بعض الميزات حسابًا لدى الخدمة التي يتصل بها.

هل io.github.mcande21/thealgorithms-mcp مفتوح المصدر؟

شيفرته علنية على GitHub، لكن المستودع لا يعلن ترخيصًا قياسيًا.

من يصون io.github.mcande21/thealgorithms-mcp؟

ينشره mcande21. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.

من سجل MCP الرسمي. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.