Grokking the Model Context Protocol (MCP)
Vote

0% completed

​

Your First Server With the Python SDK

The server at the end of the previous lesson needed about 80 lines of Python to offer two tools. Most of those lines were not about expenses. They checked _meta on every request, answered server/discover, contained two schemas typed by hand, and chose the right kind of error for each failure.

Here is the same server written with the official Python SDK, in 15 lines of code.

from mcp.server import MCPServer mcp = MCPServer("Costbook")

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content