Building an MCP server
What you actually implement, and the decisions that shape the surface you expose.
5 min read · Lesson 7 of 10 in this domain
Building an MCP server means implementing a program that speaks JSON-RPC 2.0 over a transport and answers a small set of protocol methods. For tools that is tools/list for discovery and tools/call for execution; resources and prompts have their equivalent list and read operations. The interesting work is not the plumbing, which the SDKs handle, but the surface design: which capabilities become tools versus resources, how the input schemas constrain arguments, and what the descriptions say about when to call each thing. A server is a public interface to a model, and the same design rules that govern any tool apply with more force because you may not control the client.
- Implement the protocol methods for what you expose: discovery via
*/list, execution viatools/call, retrieval for resources and prompts. - Decide primitive by intent: an action the model performs is a tool; context the application reads is a resource; a reusable interaction template is a prompt.
- Descriptions are the routing mechanism — be prescriptive about when to call, and state what a tool is not for when siblings could be confused.
- Constrain inputs with enums and required fields so ambiguity is resolved before execution rather than after a failed call.
- Return machine-usable identifiers so results can chain into the next call without string parsing.
- Choose the transport for the deployment: stdio for a local process serving one client, Streamable HTTP for a networked server serving many.
Answers that add a discovery tool to every server reinvent tools/list and resources, both of which the protocol already provides.
A capability lets the model create a ticket. Which primitive?
Creating a ticket is an action the model performs, which is exactly what tools are for. Resources expose context, prompts are templates, and elicitation asks the user for input.
Which method does a client call to discover available tools?
tools/list is discovery and returns the available tools; tools/call executes a named one. Because discovery is a live call rather than a static file, the listing can change and servers can notify clients when it does.
Practise this domain with 18%%-weighted questions in the study app.
Open in study appSource: MCP — Architecture overview · Independent study aid, not affiliated with or endorsed by Anthropic.