Skip to main content

FastMCP Fundamentals

Your First MCP Server

0:00
LearnStep 1/4

Building the Server

Creating Your First MCP Server

Complete Example

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)