The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms...

Two hands-on books on the infrastructure side of practical AI engineering: building secure Model Context Protocol tool servers, and running, serving, and maintaining open-weight language models on your own hardware.
Bought separately
$59.98
Minimum price
$34.99
$44.99
About the Bundle
This bundle covers two pieces of AI infrastructure an engineer can own end to end. The Model Context Protocol (MCP) in Practice shows how to build the servers that connect language models to real tools, live data, and organizational systems. Running Local LLMs on Your Own Hardware shows how to run open-weight models yourself, privately, offline, and at a cost that does not grow with usage.
The Model Context Protocol (MCP) in Practice covers the server side of MCP from protocol to production. It starts with JSON-RPC 2.0 messages, the stdio and SSE transports, and the tool, resource, and prompt primitives, then builds the same server in Python and in TypeScript. Later chapters cover tool-surface design and defense-in-depth security, connecting servers to Claude Code, Claude Desktop, Cursor, and Zed, four reference servers for WordPress, GitLab, DevOps operations, and project memory, and layered testing, Docker packaging, and deployment behind a reverse proxy.
Running Local LLMs on Your Own Hardware builds a working model of local inference, showing how memory capacity and bandwidth determine what fits and how fast it runs. It applies that model to choosing hardware, models, and quantization levels, and compares Ollama, llama.cpp, and vLLM. It then covers serving an OpenAI-compatible API behind a proxy with authentication and monitoring, retrieval over your own documents, LoRA and QLoRA fine-tuning, benchmarking, multi-GPU scaling, and security, maintenance, and troubleshooting.
Readers come away able to design MCP tool surfaces a model uses correctly, secure them against manipulation, connect and test them against real clients, and decide whether and how to deploy them. They also learn to size, run, serve, and maintain open-weight models on Linux workstations with NVIDIA GPUs, with notes for Apple Silicon, AMD, WSL2, and CPU-only setups.
The bundle suits backend, platform, DevOps, and AI engineers who want to connect internal systems to AI tooling while keeping models and data under their own control. Neither book requires a machine-learning background. Both expect comfort with the command line, and both treat fast-moving versions, flags, and model names as snapshots to adapt.
About the Books
The Model Context Protocol (MCP) in Practice is a hands-on guide to building custom MCP servers: the programs that let a language model use real tools, read live data, and work with organizational systems through one open protocol instead of one bespoke integration per client. It has sixteen chapters in five parts, follows the real arc of building a server from protocol to production, and is written for engineers who build things. It covers the server side of MCP only, and it does not teach how to write a client or host.
The first part explains what crosses the wire: the JSON-RPC 2.0 message shapes, the stdio and SSE transports, the initialization handshake and capability negotiation, and the three primitives every server is built from, which are tools, resources, and prompt templates. The second part builds the same small server twice, once in Python and once in TypeScript, so readers can separate what belongs to the protocol from what belongs to one SDK. The code uses pinned versions of both SDKs, and fast-moving details are gathered into clearly marked version-sensitive callouts.
The third part is the craft of design and security. It shows how to name and describe tools, write schemas, and shape results so that a model uses them correctly, how to serve live data as bounded resources, and how to package workflows as prompts. It then treats security as defense in depth, with capability minimization, scoped credentials, path and subprocess safety, injection defenses, and dry-run gates, all built on the premise that a model can be steered by the content it reads. The fourth part connects servers to Claude Code, Claude Desktop, Cursor, and Zed, and builds four reference servers: a WordPress content server in Python that can draft but never publish, a GitLab server in TypeScript that previews before it acts, a DevOps server in Python that runs only allowlisted operations, and a project-scoped memory server in Python backed by SQLite.
The final part proves and ships the work. It covers layered testing with the MCP Inspector, pytest, and vitest, protocol probes and stdio integration tests, Docker packaging for both languages, deployment over SSE behind a reverse proxy with authentication and health checks, versioning, and a decision framework for when a server should stay local. The SSE transport it demonstrates is now a legacy option in the SDKs, and the book explains the Streamable HTTP direction. Each chapter includes a hands-on lab, and from the design chapters onward each provides a reusable checklist. The safety helpers and storage layers of the reference servers have tests that were executed, while running each full server against a live system is left to the reader in the labs and the release checklist.
Readers come away able to choose the right primitive for a capability, design tool surfaces a model can use, secure a server against manipulation, connect it to real clients, test it in layers, and decide whether and how to deploy it. It suits backend, platform, DevOps, and AI engineers who are comfortable with HTTP APIs, JSON, and the command line, and it requires no machine-learning background.
Open-weight models now run well on hardware you already own, whether that is a gaming laptop, a workstation with a single consumer GPU, an Apple Silicon Mac, or a capable CPU with enough memory. Running them yourself buys privacy, a cost that does not grow with usage, offline availability, and control over exactly what you depend on.
Running Local LLMs on Your Own Hardware is a practical, hands-on guide to downloading, running, serving, and maintaining those models. It is built around a durable mental model of local inference: how a model uses memory and compute, why memory capacity and bandwidth matter more than raw processor speed, and how that lets you predict what will fit and how fast it will run.
From there the book reads your hardware, chooses a model and quantization, sets up the environment, compares the major inference engines, and runs and diagnoses a first model. It then covers quantization, prompting and sampling, serving an OpenAI-compatible API, retrieval over your own documents, and fine-tuning with LoRA and QLoRA, before closing with benchmarking, scaling beyond one GPU, and security, privacy, maintenance, and troubleshooting.
Examples target Linux first (Debian and Ubuntu with NVIDIA GPUs), with call-outs for Apple Silicon, AMD, Windows through WSL2, and CPU-only setups. Because tools change quickly, the book teaches the principles behind the commands and treats specific flags and model names as snapshots to adapt.
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms...
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
Learn more about writing on Leanpub
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them
You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!
Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.
Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.