Build Your First MCP Server

Understand how the Model Context Protocol works, build a small server, and check its tools in your Claude client.

Design one tool before you code

Choose an input and a checkable result

The course uses two fictional meeting notes. The weekly-01 note is a confirmed planning meeting, and retro-02 is a draft retrospective. Your first tool, get_note, takes a single ID and returns the matching title and status. You can try it against the sample data on your machine.

The tool accepts IDs that follow the sample format. Decide which response a caller should receive for a well-formed ID with no record, and how the server should handle a malformed ID.

Draw the connection

Claude runs in a host application. The host’s MCP client connects to your server, discovers the tools it exposes, and can call one when the task needs it. The server validates the arguments and supplies the result. The host then presents the result to Claude or uses it in the application.

A local server with standard input and output keeps the first test on your machine. Some clients can use an HTTP endpoint for a remote server. Confirm the transport your client accepts before you design the connection.

Model Context Protocol architecture

Write the checks while the example is small

Try weekly-01 and verify that the result says Weekly planning and confirmed. Try missing-03 and check that the server reports an unknown note. Then send weekly alone to check that the input schema rejects it. Repeat the known-ID check through your chosen client and confirm it picked get_note.

Keep diagnostics on standard error when using stdio so protocol messages own standard output. Add a new capability only after the simple requests work from the client.