Thealgorithms Mcp

io.github.mcande21Published by GitHub account mcande21v0.3.1Updated Oct 27, 2026

Search TheAlgorithms across 24 languages; fetch implementations with examples.

Overview

AI-generated overview

Searches TheAlgorithms repositories across 24 programming languages and fetches algorithm implementations with their in-file examples.

What you can do
  • List indexed languages with counts and aliases, plus excluded repos and reasons
  • List categories and their entry counts for a chosen language
  • Search algorithms by name and get ranked results with category and path
  • Retrieve every algorithm in a category, or fetch one file's source with extracted examples
  • Compare an algorithm across languages and see where it is missing
  • Autocomplete algorithm names from a prefix
When to use it
Useful when you want reference implementations of classic algorithms in a specific language, want to compare how the same algorithm is written across languages, or want example usage pulled from the source files.
Requirements
Runs locally over stdio, installed from PyPI with uvx (or from GitHub or a local checkout). Needs network access to GitHub and raw.githubusercontent.com. No token required; an optional GITHUB_TOKEN raises the GitHub API rate limit.
Before you install
Without GITHUB_TOKEN, GitHub API rate limits may throttle indexing and lookups. Directory indexes are cached locally with ETag and TTL, and the language manifest is cached for 7 days, so results can lag behind upstream changes. File contents are fetched from GitHub on demand.

Installation

In SourceWeft

  1. Open Thealgorithms Mcp in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

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().

Source: README.md at commit 3f22961

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v0.3.1LatestSep 16, 2026

Score

40% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts

    Declare a license in the repository or the registry entry.