0Pricing
MCP Academy · Lesson

Create a FastMCP Instance

Spin up a named server object in a few lines.

Create a FastMCP Instance is a free MCP Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the MCP Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Meet FastMCP

Time to build for real! The Python SDK gives you FastMCP, a friendly class that turns plain functions into a working MCP server. 🚀

Import It First

Everything starts with one import. You pull FastMCP from the official package so the rest of your file has it ready to use.

from mcp.server.fastmcp import FastMCP

Create the Instance

Now you make a server instance. Calling FastMCP(...) hands you back one object that will hold every tool you add later.

mcp = FastMCP("demo")

Give It a Name

That first string is your server's name. Clients show it to users, so pick something clear like "weather" or "notes" instead of "app1".

mcp = FastMCP("weather")

The mcp Object Is Your Hub

That mcp variable is the hub of your whole server. You attach tools, resources, and prompts to it, then ask it to run.

Why It's Called Fast

FastMCP is fast because it hides the protocol plumbing. You write normal Python, and it generates the JSON-RPC schemas behind the scenes.

Almost a Whole Server

Believe it or not, these two lines are already a valid server skeleton. It just has no tools yet, so it can't do anything useful so far.

from mcp.server.fastmcp import FastMCP
mcp = FastMCP("demo")

Add an Optional Description

You can pass extra hints too. Some setups accept an instructions string that tells clients what the server is for at a glance.

mcp = FastMCP("weather", instructions="Look up forecasts.")

One Server Per File

A common pattern is one module holding a single mcp instance. It keeps each server small, focused, and easy to reason about.

Naming Stays Stable

Try to keep your server name stable over time. Clients and configs reference it, so renaming later means updating every place that points at it.

Nothing Runs Yet

Creating the instance does not start a server. It just builds the object in memory; starting it is a separate step you'll meet soon.

Quick Check

Let's lock in what the constructor argument does.

Recap

You imported FastMCP, created an mcp instance, and gave it a clear name. That object is the hub every capability will hang off. Next: a real tool! 🎉

Frequently asked questions

Is the “Create a FastMCP Instance” lesson free?

Yes — the full text of “Create a FastMCP Instance” is free to read here on the web, and the MCP Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the MCP Academy course, upgrade to CoddyKit PRO.

What will I learn in “Create a FastMCP Instance”?

Spin up a named server object in a few lines. You practise MCP Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start MCP Academy?

No prior experience is required. MCP Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Create a FastMCP Instance” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this MCP Academy lesson?

Yes. Every MCP Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Create a FastMCP Instance
  2. Add a Hello Tool
  3. Run the Server with stdio
  4. Confirm It Loads & Lists Tools
← Back to MCP Academy