Putting it together: migrating one server
The whole revision as a to-do list, in the order you'd actually do it. If you can explain each line without scrolling back, you're ready.
Listen to this lessonAudio overview in Gemini Notebook · about 15–25 min · opens in a new tab
- Find all per-session state. Turn each item into a handle passed as a tool argument, or remove it.
- Find every place the server talks first (elicitation, sampling, roots) and turn it into
input_requiredwith a protectedrequestState. - Make handlers re-entrant, so a retry carrying
inputResponsesresumes instead of restarting. - Implement
server/discover. It's mandatory. - Read version and capabilities from each request's
_meta. Return-32602,-32021or-32022correctly. - Add
resultTypeto every result, andttlMspluscacheScopeto lists, reads and discovery. - Validate HTTP headers against the body:
400with-32020on mismatch. - Replace GET and subscribe with
subscriptions/listen, tagging notifications withsubscriptionId. - Treat a closed stream as cancellation, and delete replay and
Last-Event-IDcode. - Remove
pingandsetLevel, log only whenlogLevelis present, and switch not-found to-32602. - Move long-running work to the Tasks extension where it fits.
- Decide: dual-era or modern-only. If modern-only, make the error to
initializename your supported versions.
Error codes to know
-32020 header mismatch · -32021 missing client capability · -32022 unsupported version · -32602 invalid params and resource not found · -32601 method not found (HTTP 404)
The one-line summary
Every request stands alone, the server never initiates, and state is an explicit handle.
Next
Read the official changelog once more, then move on to security best practices: Security & Governance is 24% of the MCPA exam.
Answer all 2 correctly and this lesson is marked as learned.
Q1A legacy client sends initialize to a modern-only HTTP server. What is the most useful thing the server can do?
Q2Which of these is still allowed in 2026-07-28?
Feedback or a correction? Email diego [at] diegozuluaga [dot] dev or open an issue on GitHub.
Tip: ← and → move between lessons. Hover any heading and press # to copy a link to it.