Install FastMCP from gofastmcp.com, expose one Python function as an MCP tool, and run it locally after work.
FastMCP is the high-level Python framework for building MCP servers (and clients)—ordinary functions become tools with schema generation handled for you. Official docs: gofastmcp.com (not an old GitHub README as your only source). Repo reference: github.com/PrefectHQ/fastmcp.
After work, FastMCP is the fastest path from “I understand MCP” to “I shipped one tool.”
Python learners who already skimmed MCP concepts and want to write a server tonight. If you have never written a typed function, do Intro first—decorators will feel less magical.
Overview: Top 10 AI agent tools for after-work Python.
Prefer the install line on gofastmcp.com/getting-started/installation:
# recommended in current docs:
uv add fastmcp
# or:
pip install -U fastmcp
fastmcp version
my_server.py with one toolFrom the quickstart:
from fastmcp import FastMCP
mcp = FastMCP("AfterWork Demo")
@mcp.tool
def add(a: int, b: int) -> int:
'''Add two numbers.'''
return a + b
if __name__ == "__main__":
mcp.run()
Adjust decorator/API details if the live quickstart differs—docs win.
python my_server.py
# or: fastmcp run my_server.py:mcp
Use MCP Inspector, a FastMCP client snippet from the docs, or your preferred host. Confirm add(2, 3) returns 5.
Do not deploy to Horizon/cloud or add OAuth tonight. Local green run is the win.
Add greet(name: str) -> str. Call both tools. If schemas look wrong, fix type hints and docstrings—do not paste a giant prompt into the tool body.
add is enough.You practice MCP as normal Python: functions, types, one process. That skill compounds in every agent host you use later.
When tools feel ordinary, deepen Python with Intro to Python Programming so larger FastMCP servers stay readable.