Free module
Writing an MCP server
Learn to write an MCP server hands on: messages, the handshake, validated tools, resources and prompts, scopes and testing.
The lessons
Each lesson is free to read in full. Create a free account to run its commands in a live lab and to sit its quizzes and tasks.
1 · Container lab
Reading and writing MCP messages
I can read and write the JSON messages a server and a client swap.
Read the lesson2 · Container lab
The MCP initialize handshake
I can answer an initialize request and say what my server can do.
Read the lesson3 · Container lab
MCP tools with input validation
I can offer a tool whose input is checked before it runs.
Read the lesson4 · Container lab
MCP resources and prompts
I can offer read-only data and a stored prompt.
Read the lesson5 · Container lab
Limiting MCP tools by scope
I can limit a server's tools by who is asking.
Read the lesson6 · Container lab
Testing an MCP server
I can test a server with scripted clients.
Read the lesson
Worked in a real lab
Every lesson of this module is worked in a lab started for you alone. The labs it uses:
Teaching a class? Set this module for your students with a teacher guide, marked assignments and a lab for every student.