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:

server.pyPython
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

TerminalShell
uv run python -m py_compile server.py

No 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…

Find it across ATM

Search All Things MCP

ESC

Search the practical layer around the protocol.

Browse Guides Read the Blog Follow Spec Watch

Your ATM account

Sign in or create an account

Continue with GitHub. If you’re new, your ATM account will be created automatically.