Model Context Protocol

The Protocol That Puts
AI to Work

MCP is the open standard connecting AI models to your tools, databases, APIs, and code. Stop reinventing integration, build MCP servers instead. This is THE place to learn it.

10K+
MCP Servers
97M+
Monthly SDK Downloads
1
Protocol to Learn

What is MCP?

Your AI Is Brilliant.
But It Can't Know Everything.

Large language models are extraordinarily capable, but they're isolated. They know things, but they can't do things. They can't read your files, query your database, call your API, or run your code, at least not without you wiring everything up by hand, every single time.

Model Context Protocol (MCP) is Anthropic's open standard that fixes this. It defines a universal, structured way for AI models to connect to external tools and data sources. Build an MCP server for your database once, and every MCP-compatible AI client can query it.

  • Open standard, not locked to Anthropic or Claude
  • Adopted by GitHub Copilot, Cursor, Zed, and more
  • Works with any AI model that supports tool use
  • Server SDKs available in Java, Python, TypeScript, and Kotlin
MCP Architecture
AI Model (Claude, GPT-4, Gemini…)
MCP Host
MCP Client (Cursor, Claude Desktop…)
JSON-RPC over stdio / Streamable HTTP
MCP Server (your code!)
native calls
Tools · Resources · Data Sources

The Three Primitives

Everything MCP Can Do Fits in Three Concepts

Tools let the AI act. Resources let the AI read. Prompts let you template. Master all three and you've mastered MCP.

The "Do" Primitive

Tools

Tools let the AI execute actions: call an API, run a query, write a file, send a message. The AI decides when to call a tool based on context. You define what it can do.

search_web()run_sql()create_issue()send_email()
The "Read" Primitive

Resources

Resources expose data the AI can read: files, database records, API responses, live metrics. Unlike tools, resources are non-destructive: they provide context, not side effects.

file://config.yamldb://users/42logs://app/today
The "Template" Primitive

Prompts

Prompts are reusable, parameterised instruction templates that surface in the AI client's UI. Think of them as slash commands: structured workflows your team can invoke consistently.

code_reviewwrite_testsummarize_prexplain_error

Protocol Walkthrough

How an MCP Session Actually Works

From the initial handshake to the AI's final answer: five steps that happen in milliseconds.

1

Client connects to your MCP server

Claude Desktop, Cursor, or your own app establishes a connection over stdio for local servers, or HTTP/SSE for remote ones.

{"jsonrpc":"2.0","method":"initialize","params":{...}}
2

Capability negotiation

Client and server shake hands: the server declares which tools, resources, and prompts it exposes. The client registers them with the AI.

{"tools":[{"name":"search_web","inputSchema":{...}}]}
3

AI decides to call a tool

When the user asks something the AI can't answer alone, it reasons about which tool to use and constructs a structured call with validated parameters.

{"method":"tools/call","params":{"name":"search_web","arguments":{"q":"MCP Java SDK"}}}
4

Your server executes and returns

Your MCP server runs the logic: hits an API, queries a DB, reads a file, and returns structured content back through the protocol.

{"content":[{"type":"text","text":"Results: ..."}]}
5

AI incorporates the result

The tool result becomes part of the conversation context. The AI uses it to produce a grounded, accurate answer. No hallucination about what your code actually does.

Courses

Learn MCP the Right Way

Start with theory. Then build. We cover the WHY before the HOW so nothing is magic.

Theory · Technology Agnostic

MCP Fundamentals

Everything you need to understand MCP from first principles. No code required. Covers the protocol spec, architecture, primitives, transports, security model, and the ecosystem landscape.

8 classes
~3 hours
No prerequisites
  • Why MCP exists and what problem it solves
  • Hosts, Clients, Servers (the full architecture)
  • Tools, Resources, and Prompts in depth
  • JSON-RPC, stdio, Streamable HTTP transports
  • Security model and trust boundaries
  • The MCP ecosystem today
Start MCP Fundamentals
Java · Spring Boot · Hands-On

Building MCP Servers in Java

A ground-up, hands-on course for Java developers. Build production-quality MCP servers using the official Java SDK. From your first server to deployment, testing, and security.

9 classes
~8 hours
Java 21+ required
  • Development environment and SDK setup
  • Your first MCP server (stdio transport)
  • Implementing Tools (the AI's hands)
  • Implementing Resources (the AI's eyes)
  • Implementing Prompts (reusable workflows)
  • Error handling, testing, and production deployment
Start Java Course
Spring AI · Agents · Integration

Spring AI + MCP Integration

Build one application across the whole course. Turn an existing Spring Boot order service into an MCP server, connect an agent to it alongside servers you did not write, and handle progress and confirmations coming back the other way. Classes 1 to 6 do not need an API key; after that, use a free local model, or bring your own key to follow along with Claude.

17 classes
~13 hours
Spring Boot 4.1+ required
  • Turning an existing REST service into an MCP server
  • All three primitives: tools, resources and prompts
  • ChatClient and the automatic tool-use loop
  • Several servers at once, with filtering and naming
  • Progress notifications and asking a person to confirm
  • Testing, async and stateless, guardrails and budgets, Claude Desktop
Start Spring AI Course
Agents · Multi-Agent · CostComing soon

MCP in Agentic Workflows

Build genuine agents on top of MCP. Planning and decomposition, memory architecture, tool composition, human-in-the-loop approval, multi-agent orchestration, agent evaluation, and the cost levers that make agents affordable.

8 classes
~16 hours
Spring AI + MCP required
  • From chatbot to agent
  • Planning and decomposition
  • Memory and state
  • Tool composition and dispatch
  • Human-in-the-loop patterns
  • Multi-agent systems
  • Evaluating agents
  • Cost and latency optimisation
In preparation
Tokens · Context · PerformanceComing soon

Context Engineering for MCP

Stop your agent drowning in tool definitions. Token economics, code execution as a filesystem API, progressive disclosure, and measuring savings honestly, backed by a runnable Java project.

10 classes
~6 hours
Java + jtokkit
  • Where the tokens go, measured
  • What the tool surface costs
  • What one answer costs
  • Making results lean
  • Fewer tools, tighter descriptions
  • Progressive disclosure
  • Tools as a code API
  • Sandboxing executed code
  • Trusting your numbers
  • What you own, and what the host owns
In preparation
Architecture · Advanced · DesignComing soon

MCP Architecture Patterns

A design course for senior engineers. The difference between writing an MCP server and designing an MCP system. Server composition, tool granularity, multi-tenancy, caching, versioning, and resilience patterns.

8 classes
~6.5 hours
Senior-level
  • Thinking architecturally about MCP
  • Server composition: one server vs many
  • Tool granularity and API design
  • Choosing Tool, Resource, or Prompt
  • Multi-tenant server architecture
  • Caching patterns for AI workloads
  • Versioning and evolution without breaking
  • Resilience and graceful degradation
In preparation
Remote · Streamable HTTP · Stateless · ProductionComing soon

Building Remote MCP Servers

Take MCP beyond stdio. Streamable HTTP, explicit state handles in place of sessions, routing and horizontal scaling, rate limiting, Kubernetes deployment, and operating the result. Stateless-first, because the 2026-07-28 spec removed protocol-level sessions.

8 classes
~5 hours
Production focus
  • Why remote MCP (and when stdio still wins)
  • Streamable HTTP: the one remote transport
  • Explicit state handles
  • Routing and horizontal scaling
  • Rate limiting for AI workloads
  • Deployment patterns on Kubernetes
  • Migrating a session-bound server to stateless
  • Production operations and debugging
In preparation
Security · Threat Model · OAuthComing soon

Securing Production MCP

A security-first treatment of MCP. The threat model, authentication beyond OAuth, authorisation patterns, tool sandboxing, prompt injection defenses, supply chain controls, and audit/incident response.

8 classes
~4.5 hours
Security-focused
  • The MCP threat model
  • Authentication beyond OAuth (mTLS, API keys)
  • Authorisation patterns (RBAC, ABAC, ReBAC)
  • Tool sandboxing and least privilege
  • Prompt injection defenses
  • Rate limiting as a security control
  • Supply chain security
  • Audit, compliance, and incident response
In preparation
Testing · Observability · ProductionComing soon

Testing & Observability

Test MCP servers and AI agents reliably without burning API credits. Unit tests, Testcontainers, protocol-level testing, ChatModel mocking, contract testing, structured observability, and debugging production issues.

8 classes
~4 hours
JUnit 5 / Spring Boot Test
  • The MCP testing pyramid
  • Unit testing tool methods
  • Testcontainers for real backends
  • Protocol-level testing patterns
  • Mocking the ChatModel deterministically
  • Contract testing and schema drift
  • Observability instrumentation (logs, metrics, traces)
  • Debugging production issues
In preparation
Client · Host · Hands-OnComing soon

MCP Client & Host Development

Build the other half of MCP. Capability negotiation, driving sampling and elicitation, rendering MCP Apps, server discovery, and a runnable minimal host in Java that launches a real server over stdio.

8 classes
Java 21 · runnable host
  • Host, Client, Server: who does what
  • Capability negotiation from the client side
  • Driving sampling (now with tools)
  • Handling elicitation (incl. URL mode)
  • Rendering MCP Apps and the consent UI
  • Discovering and connecting to servers
  • Client lifecycle in a stateless world
  • Capstone: a minimal host in Java
In preparation
MCP Apps · UI · ExtensionComing soon

Building MCP Apps

MCP's first official extension renders interactive UI inside the chat. One project across thirteen classes: the Support Desk grows a refund confirmation card and a sortable orders table that render inside Claude. Spring AI on the server, vanilla JavaScript in the widget.

13 classes
Java server + web widget
  • What an MCP App is, and seeing one work
  • The two-primitive model
  • Serving a UI resource from Spring
  • Attaching the resource to a tool
  • The smallest widget that renders
  • Data in: rendering the tool result
  • Actions out: calling a tool
  • Actions out: talking to the model
  • The sandbox and CSP
  • The orders table and display modes
  • Looking like Claude
  • The sharp edges
  • Shipping it
In preparation
OAuth 2.1 · OIDC · Spring SecurityComing soon

Authorization for MCP

The whole OAuth story for MCP in one place: the resource-server model, grant flows and PKCE, Protected Resource Metadata, Client ID Metadata Documents in place of the deprecated Dynamic Client Registration, and the Spring Security 7 implementation.

9 classes
Spring Security 7
  • Why MCP servers are OAuth resource servers
  • Getting a token: flows, PKCE, resource indicators
  • Protected Resource Metadata (RFC 9728)
  • Discovering the authorization server
  • Client identity without pre-registration (CIMD)
  • Implementing the resource server
  • Scopes and incremental consent
  • Integrating an enterprise IdP
  • Authorization in a stateless deployment
In preparation

Blog

Sharp Takes on MCP and AI

Practical insights, protocol deep-dives, and the occasional opinion hot enough to warm your server rack.

Why Hardcoding Tool Calls Is the New Technical DebtTheory
2026-05-15 TheMCPGuy

Why Hardcoding Tool Calls Is the New Technical Debt

Every time you write a bespoke AI integration without a standard, you own it forever. MCP exists so you don't have to.

Read article
The Three Laws of MCP (Asimov Can Rest Easy)Architecture
2026-05-08 TheMCPGuy

The Three Laws of MCP (Asimov Can Rest Easy)

Tools, Resources, and Prompts aren't just API categories; they encode a philosophy about how AI should interact with the world.

Read article
MCP: The USB-C Port Your AI Has Been Waiting ForExplainer
2026-04-24 TheMCPGuy

MCP: The USB-C Port Your AI Has Been Waiting For

Remember the cable chaos before USB-C? AI tool integrations look exactly like that right now. MCP is the standardization moment.

Read article
Your AI Is Flying Blind: How MCP Finally Gives It EyesFundamentals
2026-04-10 TheMCPGuy

Your AI Is Flying Blind: How MCP Finally Gives It Eyes

AI models know a staggering amount. The problem is they're locked in a room with no windows. MCP breaks down the walls.

Read article

Ready to Build MCP Servers?

Start with the theory, then get your hands dirty. Everything you need is right here.