io.github.mcande21/thealgorithms-mcp
Provides tools for searching and retrieving algorithm implementations from the TheAlgorithms organization on GitHub across multiple programming languages.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@io.github.mcande21/thealgorithms-mcp search dijkstra algorithm in python"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
Tool | Purpose |
| Indexed languages (+ counts, aliases) and excluded repos with reasons |
| Categories with entry counts for a language |
| Ranked |
| Every algorithm in a category |
| Source + extracted examples |
| Real matches across languages + |
| Trie-backed name autocomplete ( |
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.
Related MCP server: Zoekt MCP Server
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 stdioAdd 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-endThe 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().
Available Tools
7 toolscompareA
Find the same algorithm across languages — returns only REAL matches.
A per-language search scores 100-200 for a genuine match and well below for "nearest unrelated
thing", so results are filtered to score >= min_score (default 90). Languages with no real
match are listed in missing_in, so you can see at a glance which languages implement an
algorithm and which don't. languages defaults to all indexed; pass a subset to narrow.
Inputs: name (required), languages, min_score, limit_per_language.
get_algorithmA
Fetch one algorithm by language + repo-relative path (e.g. path='sorts/merge_sort.py').
Returns {language, path, github_url, description, examples, line_count, source?}. Examples are
extracted where the language has an in-file convention (Python doctests, Rust doc-tests),
otherwise empty with a note. Set include_source=False for a cheap peek.
Inputs: path (required), language, include_source.
get_categoryA
List every algorithm in one category (for a language) as {name, path}.
Inputs: category (required), language. Returns: result
list_categoriesA
List the algorithm categories with entry counts for a language (default: python).
Inputs: language. Returns: result
list_languagesA
List indexed languages (auto-discovered from the TheAlgorithms org) and excluded repos.
Returns {languages: [{language, repo, count, aliases}], excluded: [{repo, reason}]}.
Use a returned language (or any alias) with the other tools.
Inputs: no named parameters.
search_algorithmsA
Search one language's algorithms by name/topic. Returns ranked {name, category, path, score}.
Feed a returned path (with the same language) to get_algorithm. language defaults to
python and accepts aliases (cpp, js, ts, c++, ...). See list_languages.
Inputs: query (required), limit, category, language. Returns: result
suggestA
Autocomplete algorithm names by prefix (Trie-backed typeahead).
Matches the start of the name or any word: 'dij' -> Dijkstra, 'search' -> Binary Search.
Returns up to limit {name, category, path}. Fast O(prefix-length) lookup.
Inputs: prefix (required), limit, language. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool serves a distinct purpose: listing languages, listing categories, searching algorithms, getting category contents, fetching algorithm details, cross-language comparison, and autocomplete. No functional overlap.
Most tools follow a verb_noun pattern (list_languages, get_algorithm, etc.). 'compare' is a single verb without a noun, creating a minor inconsistency, but the meaning is clear.
Seven tools is well-scoped for an algorithms exploration server. Each tool adds distinct value without redundancy or bloat.
The toolset covers browsing (languages, categories), searching, fetching details, and cross-language comparison. Missing an endpoint to list all algorithms across languages, but the existing tools enable a coherent workflow.
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
A MCP server built for developers enabling Git based project management with project and personal…
An MCP server that provides congressional transcripts
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides semantic search over local git repositories, enabling users to clone repositories, process branches, and search code through vectorized code chunks.26MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides code search capabilities for AI tools and LLMs using Zoekt, allowing for searching across codebases with advanced query syntax and content fetching.23MIT
- AlicenseNot gradedqualityDmaintenanceA generic MCP server that exposes local repository checkouts, allowing users to search and read code and documentation through natural language. It supports multiple instances, enabling seamless interaction with various codebases via configurable tool prefixes and URI schemes.MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for local-first lexical code search, providing tools for searching code, finding symbols, and reading chunks from indexed repositories.MIT