Skip to content

Repository files navigation

dataflowr — CLI, API & MCP server for the Deep Learning DIY course

LicensePython

The Deep Learning DIY course teaches PyTorch from scratch — tensors, autodiff, CNNs, RNNs, Transformers, VAEs, and diffusion models — through hands-on notebooks. Course resources:

This package exposes the course as a CLI, REST API, and MCP server so AI agents can navigate and teach it.

Demo

Quick start with Claude Code

Option 1 — Hosted server (no install needed): add a .mcp.json file at the root of your project pointing to the shared instance:

{
"mcpServers": {
"dataflowr": {
"type": "http",
"url": "https://dataflowr.paris.inria.fr/mcp"
}
}
}

Option 2 — Local server: run it yourself with uv (downloads on first use):

{
"mcpServers": {
"dataflowr": {
"type": "stdio",
"command": "uv",
"args": ["run", "--with", "dataflowr[mcp]", "python", "-m", "dataflowr.mcp_server"]
}
}
}

Claude Code picks this up automatically when you open the folder.

To pre-approve all dataflowr tools (no per-call prompts), also add .claude/settings.json:

{
"permissions": {
"allow": ["mcp__dataflowr"]
}
}

For a global allow (all projects), add the same to ~/.claude/settings.json.


Install

# with uv (recommended)
uv pip install dataflowr # CLI only
uv pip install dataflowr[api] # CLI + REST API
uv pip install dataflowr[mcp] # CLI + MCP server
uv pip install dataflowr[all] # everything# with pip
pip install dataflowr
pip install dataflowr[mcp]

Or from source:

git clone https://github.com/dataflowr/dataflowr-tools
cd dataflowr-tools
uv pip install -e ".[all]"

CLI

# Course overview
dataflowr info
# List all modules
dataflowr modules list
# Filter by session, tag, or GPU requirement
dataflowr modules list --session 7
dataflowr modules list --tag attention
dataflowr modules list --gpu
# Full module details (with notebook links)
dataflowr module 12
# Fetch notebook content from GitHub
dataflowr notebook 12 # practical (default)
dataflowr notebook 12 --kind intro
dataflowr notebook 12 --no-code # markdown only# Fetch course website page text (raw markdown from dataflowr/website)
dataflowr page 12
# Fetch lecture slides (from dataflowr/slides)
dataflowr slides 12
# Fetch quiz questions (from dataflowr/quiz)
dataflowr quiz 2a
dataflowr quiz 3
# Browse transcript knowledge base (318 concept notes from lectures)
dataflowr transcripts search "backprop"
dataflowr transcripts get "training loop"# Compare catalog against website + slides repos
dataflowr sync
# Search by keyword
dataflowr search "attention transformer"
dataflowr search "generative"# Sessions
dataflowr sessions list
dataflowr sessions get 7
# Homeworks
dataflowr homeworks list
dataflowr homeworks get 1
# JSON output (pipe-friendly)
dataflowr modules list --json | jq '.[] | select(.session == 9)'
dataflowr module 18b --json

REST API

uvicorn dataflowr.api:app --reload
# → http://localhost:8000# → http://localhost:8000/docs (Swagger UI)

Endpoints:

MethodPathDescription
GET/Course overview
GET/modulesList all modules (?session=, ?tag=, ?gpu=)
GET/modules/{id}Get module by ID
GET/modules/{id}/notebooksGet notebooks for a module (?kind=)
GET/modules/{id}/notebooks/{kind}/contentFetch notebook cells from GitHub (?include_code=)
GET/modules/{id}/slidesFetch lecture slide content from dataflowr/slides
GET/modules/{id}/quizFetch quiz questions from dataflowr/quiz
GET/modules/{id}/pageFetch module source markdown from dataflowr/website
GET/catalog/syncCompare catalog against website + slides repos
GET/sessionsList all sessions
GET/sessions/{n}Get session with modules
GET/homeworksList all homeworks
GET/homeworks/{id}Get homework by ID
GET/search?q=...Search modules
GET/transcripts/search?q=...Search transcript concept notes
GET/transcripts/{concept}Get a transcript concept note

Examples:

curl http://localhost:8000/modules/12
curl http://localhost:8000/sessions/7
curl http://localhost:8000/search?q=diffusion
curl "http://localhost:8000/modules?session=9&gpu=true"
curl "http://localhost:8000/modules?tag=attention"
curl "http://localhost:8000/modules/12/notebooks/practical/content?include_code=false"
curl http://localhost:8000/modules/12/page
curl http://localhost:8000/modules/2a/quiz
curl http://localhost:8000/modules/3/quiz
curl "http://localhost:8000/transcripts/search?q=backprop"
curl http://localhost:8000/transcripts/training%20loop

MCP Server (for AI agents)

Makes the course natively available to Claude, Cursor, VS Code, and other MCP-compatible agents. Built on the official MCP Python SDK (FastMCP).

Stdio transport (local — Claude Desktop, Cursor, VS Code, Claude Code)

python -m dataflowr.mcp_server

HTTP transport (remote / shared deployments)

python -m dataflowr.mcp_server --http
# → POST http://localhost:8001/mcp (or $PORT if set)

Client configuration

Claude Code (VSCode extension or CLI)

Add a .mcp.json file at the root of your project (homework repo, notebook folder, etc.):

{
"mcpServers": {
"dataflowr": {
"type": "stdio",
"command": "uv",
"args": ["run", "--with", "dataflowr[mcp]", "python", "-m", "dataflowr.mcp_server"]
}
}
}

Claude Code picks this up automatically when you open the folder. No global install needed — uv downloads dataflowr[mcp] on first use.

To pre-approve all dataflowr tools (no per-call prompts), also add .claude/settings.json:

{
"permissions": {
"allow": ["mcp__dataflowr"]
}
}

Or register globally (available in every project):

claude mcp add --scope user dataflowr -- uv run --with dataflowr[mcp] python -m dataflowr.mcp_server

Claude Desktop

Edit ~/.claude/claude_desktop_config.json (macOS/Linux) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
"mcpServers": {
"dataflowr": {
"command": "python",
"args": ["-m", "dataflowr.mcp_server"]
}
}
}

With uv (no global install needed):

{
"mcpServers": {
"dataflowr": {
"command": "uv",
"args": ["run", "--with", "dataflowr[mcp]", "python", "-m", "dataflowr.mcp_server"]
}
}
}

Cursor

Edit .cursor/mcp.json at the root of your project (or ~/.cursor/mcp.json globally):

{
"mcpServers": {
"dataflowr": {
"command": "python",
"args": ["-m", "dataflowr.mcp_server"]
}
}
}

VS Code

Edit .vscode/mcp.json at the root of your project:

{
"servers": {
"dataflowr": {
"type": "stdio",
"command": "python",
"args": ["-m", "dataflowr.mcp_server"]
}
}
}

Remote / HTTP (self-hosted)

If running your own instance with --http, point clients at the URL:

{
"mcpServers": {
"dataflowr": {
"type": "http",
"url": "http://localhost:8001/mcp"
}
}
}

Recommended workflow

1. search_modules "attention" → find relevant modules by keyword
2. get_module "12" → full details, notebook links, prerequisites
3. get_page_content "12" → read the lecture notes
4. get_notebook_content "12" → work through the exercises
5. get_quiz_content "12" → self-test your understanding
6. search_transcripts "attention" → find concept notes from lecture transcripts
7. get_transcript_note "training loop" → read timestamped quotes and cross-references

For a personalised study plan, use the learning_path prompt with a target module.


Tools exposed to the agent

ToolDescription
list_modulesList modules, filterable by session / tag / GPU
get_moduleFull details for a module
search_modulesKeyword search across titles, descriptions, and tags
list_sessionsList all sessions
get_sessionSession + all module content
get_notebook_urlGitHub/Colab links for a notebook
list_homeworksAll homeworks
get_homeworkFull details for a homework
get_slide_contentFetch lecture slides from dataflowr/slides
get_quiz_contentFetch quiz questions from dataflowr/quiz
check_quiz_answerValidate a student's quiz answer
get_notebook_contentFetch actual notebook cells from GitHub
get_notebook_exercisesFetch only exercise prompts + skeleton code
get_page_contentFetch module source markdown from dataflowr/website
get_course_overviewFull course structure as context
get_prerequisitesPrerequisite modules for a given module
suggest_nextWhat to study after completing a module
sync_catalogCompare catalog against website + slides repos
search_transcriptsFuzzy search 318 concept notes from lecture transcripts
get_transcript_noteFetch full content of a transcript concept note

Prompts exposed to the agent

PromptArgumentsDescription
explain_modulemodule_idTutoring session — Socratic explanation of a module
quiz_studentmodule_idInteractive quiz, one question at a time
debug_helpmodule_idGuided debugging help for a practical notebook
learning_pathtarget_module_id, known_modulesPersonalised prerequisite chain to a target module

Example questions

Once connected, an agent can answer questions like:

  • "What should I study before tackling diffusion models?"
  • "Give me the Colab link for the microGPT notebook."
  • "Which session covers attention mechanisms?"
  • "What are all the generative modeling modules?"
  • "Show me the Flash Attention homework tasks."
  • "Quiz me on Module 3 — loss functions."
  • "I'm stuck on the backprop exercise in Module 2b. Help me debug it."
  • "Build me a learning path to Module 18b (diffusion models) starting from scratch."
  • "What does the professor say about the training loop? Show me the transcript quotes."

Python API

fromdataflowrimportCOURSE# Get a modulemodule=COURSE.get_module("12")
print(module.title) # "Attention and Transformers"print(module.description)
print(module.notebooks)
# Searchresults=COURSE.search("attention")
# Get a sessionmodules=COURSE.get_session_modules(7)
# Navigate the full catalogformoduleinCOURSE.modules.values():
ifmodule.requires_gpu:
print(f"Module {module.id}: {module.title}")

Design principles

  • Content only, no execution. The package exposes the course structure and links. Running notebooks stays in the student's hands.
  • Agent-friendly. All outputs are text-first. The MCP server renders markdown so agents can use it directly in responses.
  • No external dependencies for core. The catalog, models, and CLI work with only pydantic, typer, and rich. The API needs fastapi; the MCP server needs mcp.
  • Single source of truth.catalog.py is the only place that needs updating when the course evolves.

About

Python CLI, REST API, and MCP server for the Deep Learning DIY course

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages