- Introduction
- Library Choice Is Critical
- Sharing data across AI Providers
- Integration into your system
- It’s REST, but for LLMs
- Why are they needed
- Environment Setup
- VS Code
- Installing Bun
- Initialize our first project
- Bun init
- Our First MCP Server
- Installing the official implementation
- Adding our first feature
- Testing with the official MCP Inspector
- MCP Deep Dive
- Resources
- Tools
- Sampling (Completions)
- Elicitation
- Choosing the right features to use
- Dynamic Prompts and Tools
- Upgrading to HTTP Streaming
- Other MCP Clients
- Security Concerns
- Deployment
- OAuth
- OAuth Server Setup
- Adding the OAuth Proxy to our MCP Server
- Checking if users are paying before tool use
- Optional Logins
- Introduction
MCP Servers with OAuth
An 80 page introduction to MCP, from zero to deployment in one weekend
Master the Model Context Protocol—the complete guide to seamless AI integration
This definitive guide covers every MCP feature, including the latest June 18th updates, with TypeScript examples that carry over to any language.
Early access available—50% off while in development.
This book is available in multiple packages!
Buying multiple copies for your team? See below for a discount!
Master the Model Context Protocol—the complete guide to seamless AI integration
This definitive guide covers every MCP feature, including the latest June 18th updates, with TypeScript examples that carry over to any language.
Early access available—50% off while in development.
About
About the Book
A subscription to my newsletter unlocks all future books including this one for free.
This book provides the fastest way to get up to speed using the latest Model Context Protocol authentication specification that was finalized in May 2025. I am in progress, with some sections completed for the June 18, 2025 specification update as well. I'll do my best to keep this as the most update to date, all in one MCP source as the specification isn't even one year old yet.
We cover advanced ideas like dynamic tool registration and meta programming uses.
I provide a realistic and unique example of each feature of the server spec, helping you think of creative ways to build AI integrations.
We take advantage of VS Code MCP support that was added in June 2025, allowing us to write our MCP Server, fully use, and test it, without requiring other applications. This lets me teach faster, and for you to learn faster than other courses. Others may have you manually install separate MCP clients along the way, because this support was only added on June 12th.
You can pay $200+ for a course session, or $15 for this book and dedicate the next few hours and be just as competent.
I’ve already built MCP servers that connect directly to Claude’s Integrations section. Using OAuth specifically.
This revealed a few quirks that are not mentioned in the official remote specification in order to connect via OAuth to Claude, which is well covered in this book.
My motto has always been to ship fast. While others are debating decisions, we are already releasing.
That’s a theme in this book as well. The goal is to provide a solid and fast foundation to creating a production ready MCP service. Without derailing into tangential information.
You will learn how to setup Streaming HTTP MCP servers using TypeScript.
Everything we learn will apply to Python, Go, C# and other languages that have an official model context protocol binding.
We will cover integration of REST and GraphQL APIs inside of MCP tool definitions.
Upon completion you will know how to add your server directly inside Claude Desktop, Cursor, other MCP clients, and have access to the currently logged in user from inside any MCP tool calls.
Please bring a foundational understand of REST APIs, TypeScript, and OAuth to get the most out of this book.
Packages
Pick Your Package
All packages include the ebook in the following formats: PDF, EPUB, and Web
The Book (Early bird)
Minimum price
Suggested price$14.99Early bird pricing while the book is in progress. Estimated completion by mid July.
$3.99
Buying multiple copies for your team? See below for a discount!
The Book + Source Code (Early bird)
Minimum price
Suggested price$24.99Early bird book pricing plus source code. Source code is in progress.
$9.99
- Source CodeEach chapter has its own source code file that is immediately usable. This will be completed by the end of the book, some chapters are here already.
Team Discounts
Team Discounts
Get a team discount on this package: The Book (Early bird)
Up to 3 members
- Minimum price
- $12.00
- Suggested price
- $37.00
Up to 5 members
- Minimum price
- $19.00
- Suggested price
- $59.00
Up to 10 members
- Minimum price
- $34.00
- Suggested price
- $104.00
Up to 15 members
- Minimum price
- $49.00
- Suggested price
- $149.00
Up to 25 members
- Minimum price
- $74.00
- Suggested price
- $224.00
Author
About the Author
Contents
Table of Contents
Contributor
About the Contributors
Chris Scott
Chris is an ambitious web developer with a creative technical background who possesses a self-motivated attitude to work under minimal supervision. He is a great team player that thrives on engaging and collaborate among others to formulate creative solutions. Chris is a quick learner with the ability to communicate effectively in a team environment.
Get the free Community Edition
Enter your name and email address and click the buttons to the right to get the free Community Edition in PDF or EPUB, or just click this link to read a shorter sample online here
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.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
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.)
In fact, authors have earned over $14 million writing, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
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
Write and Publish on Leanpub
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.