Skip to content
Agentic Levels

Everything starts here.

GuestLocal progress only
PreferencesSign in
01Start with one taskBest first move for beginners.02Check your LevelMeasure where you are.03Score an AI resultFind the habit to practice first.04Return to Your WorkScores, links, and checkpoints.
Start here

Begin

HomeThe main entry point.New to AIStart with one useful task.
Know where you are

Measure

Check your LevelUse this after you have tried AI.Fluency ScoreScore an AI result you can review.
Build the habit

Learn

LevelsLessonsTracks
Find the reference

Library

PromptsReferenceResourcesCompare Tools
Turn it into work

Apply

Your Next MoveChoose what AI should change next.Tool SetupGet the tools ready.
Come back later

Return

Your WorkScores, links, and checkpoints.My PathContinue from your level.Updates
Site

Site

PricingAboutFAQ & FeedbackPreferences

© 2026 Fuentes Studio

Privacy·Terms
yourCouncil
Ready to help
✦

What do you want to understand?

Ask anything about what you're learning.

← Resources

How to use FastMCP

Python framework for MCP servers, clients, and in-conversation apps, now incorporated into the official MCP Python SDK.

You want Claude to call a tool that doesn't have an MCP server yet, your internal API, a local script, a database query. FastMCP covers three use cases: Servers (expose Python functions as MCP tools with auto-generated schemas), Clients (connect to any MCP server with full protocol support), and Apps (interactive UIs within conversations). FastMCP 1.0 was incorporated into the official MCP Python SDK. It handles validation, documentation, transport negotiation, and authentication automatically.

L4L5L6
Before you startPython 3.10+ • pip install fastmcp

Steps

01

Write your first FastMCP server

FastMCP uses decorators. Annotate a Python function with @mcp.tool() and it becomes a callable MCP tool. The function signature becomes the schema, type hints are automatically converted.

Scaffold your tool
I want to expose this capability as an MCP tool for Claude Code: [TOOL_DESCRIPTION]. Write a FastMCP server that wraps it. Include the function, the decorator, type hints, and a docstring that Claude will use as the tool description.
[TOOL_DESCRIPTION]What the tool does e.g. takes a Notion page URL and returns all text content as plain markdown, inputs: url:str, outputs: content:str
02

Wire it into Claude Code and test

Run the server with `fastmcp run server.py` and add it to your Claude Code MCP config. Ask Claude to call the tool by name and verify the return value.

Add to Claude Code MCP config
I have a FastMCP server at [SERVER_PATH] that exposes these tools: [TOOL_NAMES]. Generate the Claude Code settings.json MCP config block to add this server. Then write a test message I can paste into Claude Code to verify each tool is callable and returns the expected shape.
[SERVER_PATH]Path to your server file e.g. ./tools/notion_server.py
[TOOL_NAMES]Tool names exposed by the server e.g. get_page_content, list_databases, create_page
03

Extend with Resources and Prompts

FastMCP supports three primitives: Tools (functions Claude calls), Resources (URI-addressable data Claude reads), and Prompts (reusable templates Claude invokes by name). Add a @mcp.resource() for any reference data and a @mcp.prompt() for any workflow you repeat across sessions.

Add a resource and a prompt
I have a FastMCP server for [DOMAIN]. Add: (1) a @mcp.resource() that exposes [RESOURCE_DESCRIPTION] at a sensible URI, (2) a @mcp.prompt() called [PROMPT_NAME] that [PROMPT_DOES]. Show the complete decorated functions with docstrings.
[DOMAIN]What your server is for e.g. reading and writing to our internal Notion workspace
[RESOURCE_DESCRIPTION]What the resource provides e.g. the current list of all database schemas as JSON
[PROMPT_NAME]Name for the reusable prompt e.g. summarize_page
[PROMPT_DOES]What the prompt template does e.g. fetches a Notion page by URL and returns a structured 3-bullet summary

How do you know it worked?

  • FastMCP server runs and Claude Code sees the tool
  • Claude successfully calls the tool and returns the expected output
  • You've tested with at least one edge case input

If something looks off

Python only
FastMCP is Python-only, for Node.js tools, use the official MCP TypeScript SDK instead.
Write clear docstrings
Claude uses your docstring to decide when to call the tool, write it as a clear one-line description of what the tool does and when to use it.

Skills & Commands Reference

FastMCP's three primitives, Tools, Resources, and Prompts, and the commands to run and install servers.

Command / SkillWhat it doesWhen to use it
@mcp.tool()Expose a Python function as an MCP tool, docstring becomes the description, type hints become the schemaWrapping any function or API you want Claude to call, the primary FastMCP building block
fastmcp run server.pyStart the FastMCP server locally for testing before adding to Claude Code MCP configEvery dev iteration, verify the tool appears in the session before declaring it working
fastmcp install server.py --name XInstall the server into Claude Desktop or Claude Code config automaticallyOne-command install instead of manually editing settings.json, faster for iteration
@mcp.resource(uri=...)advancedExpose URI-addressable data (files, API responses, live metrics) that agents read as contextData the agent should read for context, not call as a function, config, docs, dashboards
@mcp.prompt()advancedRegister a reusable prompt template callable by name from any MCP clientWorkflows you run the same way more than twice, make it a named prompt instead of re-pasting
Context objectadvancedInjected into tools for structured logging and progress reporting during long-running callsTools that take >1s to complete, clients can show progress instead of a blank wait

See also

  • MCP Reference Servers
  • Claude Code MCP integration

Was this helpful?

← Back to ResourcesView on GitHub