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 modules
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 modules
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 production-grade AI agents in Java using Spring AI's first-class MCP support. Connect to any MCP server, expose Spring Beans as tools, test without burning API credits, and ship to production.

8 modules
Spring Boot 3.4+ required
  • Why Spring AI transforms MCP development
  • Connecting to MCP servers (stdio and SSE)
  • ChatClient with automatic tool-use loop
  • Multi-server agents with tool aggregation
  • Exposing Spring Beans as MCP tools with @Tool
  • Testing, production config, and observability
Start Spring AI Course
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 modules
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 · HTTP · OAuth · ProductionComing soon

Remote MCP Servers

Take MCP beyond stdio. Streamable HTTP transport, OAuth 2.1 with PKCE, permission models, rate limiting, Kubernetes deployment, and the operational rhythms of running a production HTTP MCP server.

8 modules
Production focus
  • Why remote MCP (and when stdio still wins)
  • Streamable HTTP and legacy HTTP+SSE transports
  • OAuth 2.0 fundamentals for MCP
  • Implementing OAuth-protected servers
  • RBAC / ABAC permission models
  • Rate limiting for AI workloads
  • Deployment patterns on Kubernetes
  • 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 modules
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 modules
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
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 modules
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.

7 modules
Java + jtokkit
  • The hidden cost of tools (measured)
  • Tool definitions vs. tool results
  • Code execution: tools as a filesystem API
  • Progressive disclosure
  • Measuring token savings honestly
  • Sandboxing executed code
  • Client-side vs. server-side fixes
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 modules
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. UI resources, the sandboxed-iframe model, the postMessage bridge, and the consent path — Java server, web widget, built end-to-end.

8 modules
Java server + web widget
  • Why MCP Apps (SEP-1865)
  • UI resources and _meta.ui.resourceUri
  • The sandboxed-iframe security model
  • JSON-RPC over postMessage and the App SDK
  • UI-triggered tool calls and consent
  • Build a widget end-to-end
  • Cross-host portability
  • Versioning, testing, and shipping
In preparation
OAuth 2.1 · OIDC · Spring SecurityComing soon

Authorization for MCP

The 2025-11-25 authorization overhaul in depth: OIDC Discovery, Protected Resource Metadata, Client ID Metadata Documents, and incremental scope consent — implemented and compiled with Spring Security.

7 modules
Spring Security 6.4
  • The 2025-11-25 auth overhaul
  • OIDC Discovery 1.0
  • Protected Resource Metadata (RFC 9728)
  • Client ID Metadata Documents (SEP-991)
  • Incremental scope consent (SEP-835)
  • Integrating an enterprise IdP with Spring
  • Authorization in a stateless deployment
In preparation
Stateless · Scaling · OperationsComing soon

MCP at Scale

Run remote MCP behind a load balancer without the session pain. Stateless transport, explicit state handles, horizontal scaling, Streamable HTTP, and enterprise operations — built on the GA stateless transport.

8 modules
Stateless · Spring Boot
  • Why stateless? The case against sticky sessions
  • Life without Mcp-Session-Id (RC)
  • Explicit state handles
  • Routing requests across instances
  • Horizontal scaling patterns
  • Migrating a session-bound server
  • Streamable HTTP: the one transport
  • Enterprise-scale operations
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.