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.1.tar.gz (63.0 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.1-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for thealgorithms_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 07e8bb525e5971855ba998f1ff7cf12d5e1e37ee99e8630df86f0434504b896d
MD5 25ca075603881d8d9a5ca4480fef25e5
BLAKE2b-256 f2477c778569d8f931e47aaeea017aff9ca72e28271cc02e4e6a3786cb6e86f5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for thealgorithms_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1f43cf50c12dfad1816b26b526bda35fbe4ce8f5ede57d12f4aff6d2cf32d402
MD5 e5adb7477267e63d413365e70240d246
BLAKE2b-256 7e4537b93b7ed8e9f79407866b08bd9ef4c9fc9069c7c8e858fc5dcc9552bf04

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