0:00
0% complete
LearnStep 1 of 4
Building the Server
Learning Objectives
- •Create a working MCP server
- •Add tools to your server
- •Run and test the server
Lesson Outline
LearnStep 1/4
Building the Server
python
Understanding the Code
- FastMCP(name, version): Creates the server with metadata
- @mcp.tool: Registers a function as an MCP tool
- Type hints: Used to generate JSON schemas automatically
- Docstrings: Become the tool description for AI
- mcp.run(): Starts the server (default: STDIO transport)