Skip to content

Feature: FastMCP Skill — Build, Test, and Deploy MCP Servers #343

@teknium1

Description

@teknium1

Overview

FastMCP (v3.1.0, Apache-2.0, 23.3k stars) is the standard Python framework for building MCP servers. It transforms Python functions into MCP-compliant tools with automatic schema generation, validation, and transport negotiation. With ~1M daily downloads and ~70% market share of MCP servers, it is the de facto standard.

A Hermes Agent skill that teaches the agent how to build, test, inspect, and deploy MCP servers using FastMCP would enable users to quickly create custom tool servers for their specific needs — wrapping APIs, databases, CLI tools, or business logic into MCP-compatible servers that any AI client can use.

This is the companion to #342 (exposing Hermes's own tools as an MCP server). While #342 is about Hermes serving its built-in tools, this skill is about helping users build their own MCP servers for arbitrary use cases.

Research source: FastMCP Documentation and GitHub repo


Research Findings

What FastMCP Enables

FastMCP lets you turn any Python function into an MCP tool in 4 lines:

from fastmcp import FastMCP
mcp = FastMCP("My Server")

@mcp.tool
def analyze_data(csv_path: str, column: str) -> dict:
    """Analyze a column in a CSV file"""
    import pandas as pd
    df = pd.read_csv(csv_path)
    return {"mean": df[column].mean(), "std": df[column].std()}

if __name__ == "__main__":
    mcp.run()

Key Capabilities for Users

Capability What It Enables
@mcp.tool Expose any Python function as an MCP tool
@mcp.resource Expose data sources (files, DBs, APIs) as read-only resources
@mcp.prompt Create reusable prompt templates for LLMs
Transports stdio (local) or HTTP (remote, production)
Composition Combine multiple servers with mount() and namespacing
Proxy Bridge remote servers, add auth layers, aggregate backends
CLI fastmcp run, fastmcp inspect, fastmcp install
Deployment Free hosting via Prefect Horizon

FastMCP CLI Commands (Key for the Skill)

# Run a server from a file
fastmcp run server.py:mcp --transport http --port 8000

# Inspect tools available on a server
fastmcp inspect server.py --json

# List tools from a running server
fastmcp list http://localhost:8000/mcp

# Call a tool directly
fastmcp call http://localhost:8000/mcp analyze_data csv_path=data.csv column=revenue

# Install into Claude Desktop/Cursor
fastmcp install server.py --name "My Server"

# Discover MCP servers configured on this machine
fastmcp discover

Real-World Use Cases

  1. Wrap an API — Turn a REST API into MCP tools (e.g., internal company API, SaaS service)
  2. Database access — Expose query capabilities from PostgreSQL, SQLite, etc.
  3. File processing — Build tools for PDF parsing, image analysis, data transformation
  4. Business logic — Wrap domain-specific calculations or workflows
  5. CLI tool wrappers — Make CLI tools accessible as MCP tools

Current State in Hermes Agent

Existing MCP Skills/Tools

  • tools/mcp_tool.py — MCP client for consuming external servers (native)
  • mcporter skill — CLI-based MCP tool calling (discovery, auth, calling)
  • docs/mcp.md — MCP client documentation

The Gap

  • No skill for building MCP servers
  • No guidance on using FastMCP's decorator-based API
  • No templates for common server patterns
  • No integration with fastmcp CLI for testing/deployment

Implementation Plan

Skill vs. Tool Classification

This should be a skill (bundled, not Skills Hub) because:

  • It wraps the fastmcp CLI and Python API, which the agent uses via terminal and write_file
  • No custom Python integration needed in the agent harness
  • It is broadly useful — building MCP servers is a mainstream development task
  • The agent already has MCP client support; server-building is the natural complement

What We'd Need

  1. SKILL.md — Procedures for building, testing, and deploying FastMCP servers
  2. Templates — Starter templates for common server patterns (API wrapper, database, file processor)
  3. Scripts — Helper scripts for scaffolding and testing

Phased Rollout

Phase 1: Core skill with templates

  • SKILL.md with FastMCP basics (tools, resources, prompts)
  • Templates for common patterns:
    • templates/api_wrapper.py — REST API → MCP server
    • templates/database_server.py — Database query tools
    • templates/file_processor.py — File analysis tools
  • Testing workflow: fastmcp inspect, fastmcp call, fastmcp list
  • Installation into clients: fastmcp install

Phase 2: Composition and deployment

  • Server composition (mounting, namespacing)
  • Proxy patterns (transport bridging, aggregation)
  • Deployment to Prefect Horizon
  • OAuth/auth setup for HTTP servers
  • Advanced: tool transformations, custom routes

Phase 3: Integration with Hermes MCP client


Pros & Cons

Pros

  • High demand — MCP server building is one of the most requested developer tasks in the AI ecosystem
  • Low friction — FastMCP's API is Python-native and intuitive; the skill mostly teaches patterns
  • Ecosystem multiplier — Every MCP server built can be used by Claude, Cursor, Hermes, and any MCP client
  • Complements existing infra — Pairs with mcporter skill (consume) and Feature: Hermes Agent as MCP Server — Expose Tools to the MCP Ecosystem #342 (serve Hermes tools)
  • Broadly useful — Bundled skill, useful to many users

Cons / Risks

  • Requires FastMCP installed — Users need pip install fastmcp (not a Hermes dependency)
  • API churn — FastMCP v3 is relatively new; API may change
  • Overlap with mcporter — Some discovery/calling functionality overlaps; need clear scope boundaries
  • Complexity depth — FastMCP has many features (transforms, providers, apps); the skill must stay focused on the common paths

Open Questions

  • Should the skill be bundled or Skills Hub? (I recommend bundled — MCP is mainstream enough)
  • How much should the skill overlap with the mcporter skill? (mcporter = consume, fastmcp = build?)
  • Should templates include LLM-specific patterns (structured output, Pydantic models)?
  • Should the skill cover deploying to Prefect Horizon, or keep deployment generic?

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions