DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to turn your Python functions into MCP tools with Fastmcp

Wrap existing functions with FastMCP so any AI assistant that speaks MCP can call them.

Short answer: Run uv add fastmcp in your project; then create an instance with mcp = FastMCP("Demo 🚀") and decorate each function with @mcp.tool; give each function type hints and a docstring; FastMCP builds the schema, validation and documentation from them. All steps.

Who it is forA developer with internal scripts who wants Claude or a coding agent to use them directly.

The problemWriting an MCP server by hand means schemas, validation and protocol handling before any real logic.

The outcomeA working MCP server whose tools are plain Python functions, with schemas and docs generated for you.

What you need first

  • Python and uv (recommended) for installation
  • An MCP client to connect your server to, such as an AI assistant or coding agent
  • For TypeScript projects: the separate fastmcp-ts package

Steps

  1. Run uv add fastmcp in your project
  2. Create an instance with mcp = FastMCP("Demo 🚀") and decorate each function with @mcp.tool
  3. Give each function type hints and a docstring; FastMCP builds the schema, validation and documentation from them
  4. Call mcp.run() under the main guard, as in the README example, and start the script
  5. Connect the server to your MCP client following the quickstart

Prompt for your agent

Using PrefectHQ/fastmcp, turn these Python functions into an MCP server: <list functions>. Add type hints and docstrings so the schemas are generated automatically, then connect it to my <MCP client> and test each tool.

Caveat. A tool runs with your machine's permissions, so only expose functions you would be comfortable letting an AI call.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for PrefectHQ/fastmcp and "Turn your Python functions into MCP tools"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer