BASE

FastMCP

FastMCP

Tool / library · Free

A Python framework for custom MCP servers, clients, and apps. Turn a Python function into a tool with automatic schema generation and validation, and reuse backend logic in agent tools.

Resource illustration: FastMCP

Open resource ↗

What you can use for free

The local open-source framework is free.

Paid features and costs

The Prefect Horizon enterprise gateway is a separate offering and is not required to create a local MCP. Hosting and APIs called by your custom tools are billed under their own terms.

Access and limitations

The local open-source framework is free. The Prefect Horizon enterprise gateway is a separate offering and is not required to create a local MCP. Hosting and APIs called by your custom tools are billed under their own terms. The framework does not add useful business tools itself: functions, access rights, tests, and deployment must be developed. FastMCP 1.0 inside the official MCP Python SDK and current standalone FastMCP are different development lines; examples must match the chosen version. Not every client automatically supports all MCP apps and framework capabilities.

Use cases

  • Wrap an internal Python API in MCP tools
  • Give an agent access to your database or service through narrowly scoped functions
  • Create and test MCP integrations as ordinary software code

Example workflow

A possible workflow; this is not a report of hands-on testing.

Example workflow with FastMCP: Wrap an internal Python API in MCP tools.

Before you start

  • One Python function or internal API, and a sample valid request.
  • The result schema, access rules, and a compatible MCP client.

Steps

  1. Wrap one complete workflow in a tool and check the input schema.
  2. Call the tool from a client with successful and invalid requests.
  3. Separate data access from actions with side effects, then expand the set of tools.

Check your result

  • Inputs are validated, errors are clear, and the result matches the declared schema.
  • The tool grants only the required permissions; agent calls are subject to access-boundary checks.

Choosing FastMCP

Wrap an internal Python API in MCP tools

Choose this when

  • Wrap an internal Python API in MCP tools
  • Give an agent access to your database or service through narrowly scoped functions
  • Create and test MCP integrations as ordinary software code

Requirements

  • Choose the Python framework or separate TypeScript counterpart for the project stack.

Things to consider

  • Costs and limits of free use: The Prefect Horizon enterprise gateway is a separate offering and is not required to create a local MCP. Hosting and APIs called by your custom tools are billed under their own terms.
  • Terms of use: Apache-2.0 in the current official PrefectHQ/fastmcp repository.
  • Horizon enterprise features must not automatically be attributed to the free FastMCP framework.

Frequently asked questions

What can you use for free in FastMCP?

The local open-source framework is free.

What additional costs might arise with FastMCP?

The Prefect Horizon enterprise gateway is a separate offering and is not required to create a local MCP. Hosting and APIs called by your custom tools are billed under their own terms.

How does FastMCP fit into an AI agent workflow?

Creates MCP-compliant servers; it is a tool for developing custom integrations. A separate Codex connection instruction is not confirmed; verify connection setup and tool operation in your chosen client.

Which environment can you use FastMCP in?

Tech stack: Python.

How do you get started with FastMCP?

Wrap one complete workflow in a tool and check the input schema. Call the tool from a client with successful and invalid requests. Separate data access from actions with side effects, then expand the set of tools.

What does FastMCP provide for a server, client, and interactive application?

The Python framework helps declare tools, resources, and prompts with schema generation and function validation. The client handles local and remote servers, protocol, and authentication; MCP Apps add an interactive interface. The official TypeScript counterpart is the separate @prefecthq/fastmcp-ts package. Horizon with governance, SSO/RBAC, and a gateway is described separately from the framework.

Tech stack

  • Python

Agent compatibility

Creates MCP-compliant servers; it is a tool for developing custom integrations. A separate Codex connection instruction is not confirmed; verify connection setup and tool operation in your chosen client.

License

Apache-2.0 in the current official PrefectHQ/fastmcp repository.

Apache 2.0 — permissive license with patent terms

You can use and modify the code in commercial and closed-source projects. When distributing it, retain the license and relevant notices, identify modified files, and include NOTICE if provided. Authors grant a limited patent license for their contributions; it does not grant permission to use trademarks.

License terms

Technologies and topics

  • Python
  • MCP

Sources

Other resources