MCP Server Development

Time to BUILD: a production MCP server — typed tools, exposed resources, tests, an Inspector, deployment with auth, and observability. FastMCP makes the first 80% minutes, not weeks.

▶ Watch this reel

What you'll learn

  1. FastMCP: first server
  2. Resources & typed design
  3. Testing with the Inspector
  4. Deployment: HTTP, auth, observability

Remember this

FastMCP

Design

Testing

Deployment

Code: The same server, deployed: HTTP + logging + auth hook

from mcp.server.fastmcp import FastMCP
import logging, structlog

log = structlog.get_logger("mcp.orders")
mcp = FastMCP("orders")

@mcp.tool()
def search_orders(customer: str, limit: int = 5) -> list[dict]:
    """Search orders by customer name fragment … (same docstring!)"""
    log.info("tool.call", tool="search_orders",
             arg_hash=hash((customer, limit)),      # not raw args
             user=current_user_id())               # auth context from hook
    ...

# Local:   mcp.run()                          # stdio
# Remote:  mcp.run(transport="http",
#                  host="0.0.0.0", port=8080,
#                  auth=oauth_provider)       # spec-aligned OAuth
#
# Ops:  per-call logs · latency histograms · error-rate alerts ·
#       cost-per-tool dashboards · pinned spec revision in CI