{
 "kind": "tool",
 "slug": "fastmcp-pypi",
 "path": "tools/fastmcp-pypi/",
 "name": "FastMCP (Python)",
 "maker": null,
 "density": "profile",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Agent, MCP and tool libraries",
   "tools/agent-libraries/"
  ]
 ],
 "lead": "Fast, Pythonic framework for building MCP servers and clients for AI tool integration.",
 "chips": [
  {
   "label": "Agent, MCP and tool libraries",
   "path": "tools/agent-libraries/"
  },
  {
   "label": "PYPI"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "pip install fastmcp"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/PrefectHQ/fastmcp"
  },
  {
   "label": "Website",
   "href": "https://gofastmcp.com"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "Apache-2.0",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": null,
   "note": "License from PyPI license expression.",
   "src": "https://github.com/PrefectHQ/fastmcp"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Nov 24, 2026",
   "note": "Latest GitHub release Nov 23, 2026. ",
   "src": "https://github.com/PrefectHQ/fastmcp"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "173 projects",
   "status": "info",
   "sub": "#3 of 192 in its category",
   "note": "Dependency in 173 public GitHub projects set up for AI coding agents that we scanned (2.8%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Docs for agents",
   "status": "yes",
   "sub": "llms.txt",
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": "https://gofastmcp.com/llms.txt"
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What FastMCP (Python) does",
   "parts": [
    {
     "t": "prose",
     "text": "The maintainers say FastMCP created the high-level Python API that went into the official MCP Python SDK in 2024. The standalone package is now one framework covering MCP servers, MCP clients, and tools that return interactive UIs."
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "FastMCP (Python) popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "75",
       "of": "/ 100",
       "l": "Gid Score, #197 overall"
      },
      {
       "n": "20.6M",
       "l": "downloads a week, pypi"
      },
      {
       "n": "28.7K",
       "l": "GitHub stars"
      },
      {
       "n": "173",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How FastMCP (Python) is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "FastMCP (Python) is a dependency in 173 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (10.7% of the 1,623 Python ones), #3 of 192 in agent, mcp and tool libraries.",
      "Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 401; those are left out of every share on this page.",
      "The most used alternative in our scan is Model Context Protocol SDK (Python) (499 projects).",
      "Projects that use it most often also use python-dotenv (46.2%), Pydantic (45.7%), Model Context Protocol SDK (Python) (31.2%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "114 projects, 3.8%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "68 projects, 2.1%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "41 projects, 1.7%",
       "v": "Cursor",
       "path": "agents/cursor/"
      },
      {
       "l": "8 projects, 1.7%",
       "v": "Gemini CLI",
       "path": "agents/gemini-cli/"
      },
      {
       "l": "6 projects, 1.7%",
       "v": "OpenCode",
       "path": "agents/opencode/"
      },
      {
       "l": "5 projects, 1.1%",
       "v": "OpenAI Codex",
       "path": "agents/openai-codex/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 46.2% of its projects",
       "v": "python-dotenv",
       "path": "tools/python-dotenv/"
      },
      {
       "l": "In 45.7% of its projects",
       "v": "Pydantic",
       "path": "tools/pydantic/"
      },
      {
       "l": "In 31.2% of its projects",
       "v": "Model Context Protocol SDK (Python)",
       "path": "tools/mcp/"
      },
      {
       "l": "In 29.5% of its projects",
       "v": "httpx",
       "path": "tools/httpx/"
      },
      {
       "l": "In 30.1% of its projects",
       "v": "Uvicorn",
       "path": "tools/uvicorn/"
      },
      {
       "l": "In 28.3% of its projects",
       "v": "Requests",
       "path": "tools/requests-py/"
      },
      {
       "l": "In 28.3% of its projects",
       "v": "FastAPI",
       "path": "tools/fastapi/"
      },
      {
       "l": "In 22.0% of its projects",
       "v": "Pydantic Settings",
       "path": "tools/pydantic-settings/"
      }
     ]
    }
   ]
  },
  {
   "id": "profile",
   "nav": "Profile",
   "h2": "FastMCP (Python) in practice",
   "parts": [
    {
     "t": "h3",
     "text": "Strengths"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "Schemas come from the function signature",
       "v": "You declare a tool as a typed Python function. The README says the schema, validation and documentation are generated from it, so you do not write them by hand."
      },
      {
       "l": "A client in the same package",
       "v": "FastMCP also covers the calling side. Its client connects to an MCP server from a URL. The README says it manages transport negotiation, authentication and protocol lifecycle for you."
      },
      {
       "l": "Tools can return UIs instead of text",
       "v": "Add <code>app=True</code> to a tool and return a Prefab component. The docs say the host then renders it as a chart, table or form inside the conversation."
      },
      {
       "l": "In-memory testing",
       "v": "The site shows a test that passes the server object straight to <code>Client(mcp)</code>, so no separate process is started. The CLI can also run, inspect and install the server."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Watch out for"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "Minor versions can break things",
       "v": "The versioning policy allows breaking changes in minor releases when they are needed to keep up with the protocol. The docs tell you to pin exact versions in production."
      },
      {
       "l": "Docs track main, not the release",
       "v": "The documentation describes the main branch, so a feature you read about may not be in the version you installed. The docs point to the version badges on each page."
      },
      {
       "l": "pip upgrades across 3.3 can half-remove the package",
       "v": "FastMCP 3.3 moved its code into a <code>fastmcp-slim</code> distribution. During a single-command pip upgrade from 3.2 or earlier, pip can install the new files and then delete them. The docs give a <code>pip install --force-reinstall fastmcp</code> fix. They say fresh installs and uv upgrades are unaffected."
      }
     ]
    },
    {
     "t": "h3",
     "text": "A one-tool server"
    },
    {
     "t": "tabs",
     "label": "Example",
     "items": [
      {
       "tab": "Python",
       "code": "from fastmcp import FastMCP\n\nmcp = FastMCP(\"Demo 🚀\")\n\n@mcp.tool\ndef add(a: int, b: int) -> int:\n    \"\"\"Add two numbers\"\"\"\n    return a + b\n\nif __name__ == \"__main__\":\n    mcp.run()"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "profile",
   "h2": "More about FastMCP (Python)",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Agent Skills for it",
       "path": "skills/",
       "items": [
        "fastmcp: Production patterns for FastMCP Python MCP servers. Use when writing, improving, or debugging FastMCP Python code — tool schema design, mult"
       ]
      },
      {
       "title": "Packages around it",
       "items": [
        "python-dotenv: Load .env files",
        "pydantic: Data validation",
        "mcp: Official MCP Python SDK",
        "uvicorn: ASGI server",
        "httpx: HTTP client",
        "requests: Sync HTTP client"
       ]
      },
      {
       "title": "More in Agent, MCP and tool libraries",
       "path": "tools/agent-libraries/",
       "items": [
        {
         "text": "Model Context Protocol SDK (JavaScript)",
         "path": "tools/modelcontextprotocol/"
        },
        {
         "text": "LangChain",
         "path": "tools/langchain-pypi/"
        },
        {
         "text": "LangGraph",
         "path": "tools/langgraph/"
        },
        {
         "text": "Agent Client Protocol SDK",
         "path": "tools/agentclientprotocol-sdk/"
        },
        {
         "text": "LangChain.js",
         "path": "tools/langchain-npm/"
        },
        {
         "text": "Mastra",
         "path": "tools/mastra/"
        },
        {
         "text": "MCP Inspector",
         "path": "tools/modelcontextprotocol-inspector/"
        },
        {
         "text": "fastMCP (JavaScript)",
         "path": "tools/fastmcp-npm/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "FastMCP (Python)",
       "me": true,
       "facts": [
        "Apache-2.0",
        "Gid 75",
        "20.6M/wk"
       ]
      },
      {
       "name": "Model Context Protocol SDK (Python)",
       "why": "Python SDK for building MCP servers and clients to extend AI agent capabilities.",
       "path": "tools/mcp/",
       "facts": [
        "MIT",
        "Gid 83",
        "82M/wk"
       ]
      },
      {
       "name": "Pydantic AI",
       "why": "AI agent framework built with Pydantic for structured, typed agent development.",
       "path": "tools/pydantic-ai/",
       "facts": [
        "MIT",
        "Gid 64",
        "1.8M/wk"
       ]
      },
      {
       "name": "smolagents",
       "why": "Barebones library for building agents that write Python code to call tools.",
       "path": "tools/smolagents/",
       "facts": [
        "Gid 50",
        "158K/wk"
       ]
      }
     ],
     "more": "Compare FastMCP (Python) with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "install",
     "intro": "Install it.",
     "code": "pip install fastmcp"
    },
    {
     "t": "h3",
     "text": "Rules for your agent"
    },
    {
     "t": "rules",
     "label": "Paste into AGENTS.md or CLAUDE.md",
     "text": "## FastMCP\n- Install with `uv add fastmcp` (or `pip install fastmcp`). Pin an exact version, because minor releases may contain breaking changes. Use the current release, for example `fastmcp==4.1.8`, rather than a range like `fastmcp>=4.0.0`.\n- Register tools by decorating typed functions with `@mcp.tool`. FastMCP derives the schema from the function.\n- Keep the `if __name__ == \"__main__\": mcp.run()` block. Note that `fastmcp run my_server.py:mcp` imports the server object and does not execute that block.\n- Use `mcp.run(transport=\"http\", port=8000)` for remote access. Use the default stdio transport for local clients.\n- The client is async. Open it with `async with Client(...)`, then call `await client.call_tool(...)` inside the block. For in-memory tests, pass the server object as `Client(mcp)`.\n- For `@mcp.tool(app=True)` UI tools, install the `fastmcp[apps]` extra. Preview them locally with `fastmcp dev apps my_server.py`.\n- Read the docs through `https://gofastmcp.com/llms.txt`, or append `.md` to a docs URL. The docs follow the main branch, so confirm a feature exists in your pinned version.\n"
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "pypi fastmcp"
  ],
  [
   "Category",
   "Agent, MCP and tool libraries"
  ],
  [
   "License",
   "Apache-2.0"
  ],
  [
   "Latest version",
   "v4.1.8, November 10, 2026"
  ],
  [
   "On GitHub since",
   "November 2024"
  ],
  [
   "Gid Score",
   "75.3"
  ],
  [
   "Rank in category",
   "#3 of 192"
  ],
  [
   "GitHub",
   "PrefectHQ/fastmcp"
  ],
  [
   "Last change",
   "Nov 24, 2026"
  ]
 ],
 "good": [
  "Used by AWS, NVIDIA, Snowflake, SAP, as listed by the source; we have not checked each one."
 ],
 "checked_line": "From the package registry, GitHub and our scan of public agent projects; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/prefecthq.png"
}