Step 2 of 4
Create the Server
Define the smallest FastMCP application that can start cleanly over the local standard input and output transport.
Create server.py in the project root. Keep the first version deliberately small:
from mcp.server.fastmcp import FastMCP
mcp = FastMCP("mcp-server-demo")
if __name__ == "__main__":
mcp.run()Why this is enough to start
FastMCP owns the protocol server and its capability registry. Calling mcp.run() without a transport argument uses stdio, which is appropriate when a local host launches the server as a subprocess.
Keep the run call behind the __main__ guard. Development tools import the module to find the mcp object, and importing it must not start a second server process.
Check the file before continuing
uv run python -m py_compile server.pyNo output means Python parsed the file successfully.
Step 2
Ready to continue?
Mark this step complete when you have finished the checks above.
Checking saved progress…