Skip to main content

MCP server for querying TheAlgorithms/Python — search algorithms and fetch implementations with their doctests as examples.

Project description

thealgorithms-mcp

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

An MCP server for querying TheAlgorithms/Python — search ~1,160 algorithm implementations and fetch any one with its doctests as usage examples.

Hybrid design: the small DIRECTORY.md index is cached locally (ETag + 24h TTL) for instant fuzzy search; file contents are fetched on demand from raw.githubusercontent.com. No API token, no rate limits, tiny footprint. See DESIGN.md.

Tools

Tool Purpose
list_categories() Categories (sorts, graphs, dynamic_programming, …) with counts
search_algorithms(query, category?, limit=10) Ranked {name, category, path, score}
get_category(category) Every algorithm in a category
get_algorithm(path, include_source=True) Source + extracted doctests for one file

Typical flow: search_algorithms("dijkstra")get_algorithm("graphs/dijkstra.py").

Install

From PyPI (recommended):

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

From GitHub (no PyPI needed):

{ "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
{ "thealgorithms": {
    "command": "uv",
    "args": ["run", "--directory", "/path/to/thealgorithms-mcp", "thealgorithms-mcp"] } }

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

Verify

uv run python scripts/verify_stdio.py

Spawns the server over stdio and asserts every tool against the live repo.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

thealgorithms_mcp-0.1.0.tar.gz (61.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

thealgorithms_mcp-0.1.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file thealgorithms_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: thealgorithms_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 61.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.3

File hashes

Hashes for thealgorithms_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 afd676c93848f9621907c364297971bd8b9b7faf9db88a641e6bc772b649fbdf
MD5 1b427577627ce2cbf3daee141ef312b9
BLAKE2b-256 0bcc71024e56de508b8ef776bd38a6054e7bd6da4134e4c9527c947aaf3c6564

See more details on using hashes here.

File details

Details for the file thealgorithms_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for thealgorithms_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9fa0914be2848e894b80445b85c117b29069aab754abc6c09f8ebbfe82ad0c72
MD5 c49b83f92df78d170ff77a7f1b24064f
BLAKE2b-256 4d94856a0907b3802564336f4fafd7206df27ff5efa2b0715f7e8d1ba0b984af

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page