What does a minimal MCP server require and how do official SDKs simplify it?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Describe what a minimal MCP server must implement and how the official TypeScript and Python SDKs reduce that implementation burden.
A minimal MCP server handles initialize, tools/list, and tools/call over JSON-RPC; the official SDKs collapse that to a few decorated functions plus a one-line transport.
Think of opening a food stall at a market. The market has a fixed rulebook: you must put up a sign listing what you sell, show prices, and hand over an order when someone pays. Writing all that paperwork by hand for every stall is tedious. The official SDK is like a stall-starter kit: you just write 'I sell coffee, it costs three dollars, here is how I make it', and the kit prints the sign, takes the orders, and counts the money for you. You declare your tools as plain functions, and the SDK builds the catalog, validates the orders, and talks to the customer (the host) in the exact format the market rulebook demands. You pick stdio for a local stall, or Streamable HTTP for a remote one, in a single line.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
5 min: the three mandatory handlers + the initialize handshake + how SDKs generate schema from types and own JSON-RPC plumbing + stdio vs Streamable HTTP + testing with the Inspector.
from mcp.server.fastmcp import FastMCP
mcp = FastMCP("weather")
@mcp.tool()
def get_weather(city: str) -> str:
"""Return the current weather for a city."""
return f"Sunny in {city}, 22C"
if __name__ == "__main__":
# stdio for local; swap to transport="streamable-http" for remote
mcp.run(transport="stdio")| Concern | stdio transport | Streamable HTTP transport |
|---|---|---|
| Where it runs | Local subprocess of the host | Remote server over the network |
| Lifecycle | Tied to host process | Independent, long-lived service |
| Auth | None needed (local trust) | OAuth 2.1 bearer tokens |
| Best for | Filesystem, Git, local dev tools | Shared SaaS tools, hosted integrations |
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Thinking you must hand-write JSON Schema and JSON-RPC framing. The SDK generates the schema from your type hints and owns all the wire plumbing.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.