# LLMs for Science

A set of educational Jupyter notebooks that teach the core patterns behind tools like Claude Code and Cursor's agent mode by having the learner build an agentic harness, a small language model and an MCP server from first principles.

The notebooks progress from a basic agentic harness, covering the components of an agent's core state, a control loop that drives an LLM through multi-step tasks, typed tool definitions, schema validation of proposed actions, and inspectable execution traces, through building a small language model from scratch, to an advanced harness with production-grade patterns, an evaluation suite that turns a single successful run into measured pass rates, cost and failure-mode distributions, and finally a from-scratch MCP server that hands real data to an agent.

Every notebook runs offline end to end on a rule-based mock backend, so no API key is required, and the harness and MCP server built across the later notebooks are also kept as reusable modules and scripts rather than only inline code.

It is written mainly as Jupyter notebooks and released under the MIT license.

Website: https://github.com/DataForScience/LLMs
