Skip to content
Agentic Levels
Start hereLevelsTracksPromptsAbout
Get my levelGet my level

  • Start hereYour first useful task with AI.
  • Level quiz8 questions. No AI needed.
  • Fluency ScoreYour Level and a score, from your own AI.

  • LevelsThe 11 levels, in order.
  • LessonsShort lessons, filter by level.
  • TracksGuided paths by tool, role or goal.
  • Set up your AI tool
  • Starter packFree files that help AI remember.

  • PromptsReady prompts to copy and adapt.
  • ChatGPT vs Claude vs GeminiPick the right one for the job.
  • How-tos
  • ReferenceCommands for Claude Code, Codex, Antigravity.
  • ResourcesHand-picked reading and tools.

  • Your progress
  • Your next moveAn interview that picks your next skill.
  • Your next lessonsThe next lessons at your level.
  • Updates

  • Pricing
  • About
  • FAQ & Feedback
  • Work with us
  • How we handle your data
Sign inPreferences
AboutPricingHow-tosPromptsStarter packMy stackHow we handle your data

© 2026 Fuentes Studio

PrivacyTermsRefundsAccessibilityAI content policyCredits
yourCouncil
Ready to help
✦

What do you want to understand?

Ask anything about what you're learning.

←How-to guides
  1. Resources
  2. ›How-to guides

How to use FastMCP

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

Levels 4 to 6On GitHub

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.

Before you start

Python 3.10+ • pip install fastmcp

  1. 1Write your first FastMCP server
  2. 2Wire it into Claude Code and test
  3. 3Extend with Resources and Prompts

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

What you'll do, 3 steps

  1. 1Write your first FastMCP server
  2. 2Wire it into Claude Code and test
  3. 3Extend with Resources and Prompts

Was this helpful?