Write a server in Python with tools, resources and prompts, and see how Claude Code uses each.
1 / 4
Start with a tool
To offer your own service, write a server with the Python SDK: a decorator turns a function into a tool, and its name, docstring and type hints become the tool’s schema. Try each tool in the MCP Inspector, then connect it with claude mcp add.
2 / 4
Resources: data the app pulls in
A resource is read-only data with an address. In the server, @mcp.resource("docs://handbook") publishes what a function returns at that address. In Claude Code, type @ and pick it, @shop:docs://handbook, and it’s added to the conversation without a tool call.
3 / 4
Prompts: ready-made instructions
A prompt is a tested instruction for a common job. In the server, @mcp.prompt() turns a function into one: its arguments are the blanks, its return value the instruction. In Claude Code it appears in the / menu as /shop:format; fill in the blanks for the same result every time.
4 / 4
Recap: tools, resources and prompts
So the shop server offers three kinds of things: tools, resources and prompts. They differ in who uses them in Claude Code: Claude calls tools itself; you add resources by typing @; and you run prompts from the / menu. Each carries the server’s name as a prefix.