Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

FastMCP Development

БесплатноЗапускает вложенные скриптыНе проверен

Use when creating or modifying Model Context Protocol (MCP) servers with FastMCP framework - guides through tools, resources, prompts, authentication, Claude…

enunoот enuno★ 17 звёзд на GitHub

Об этом скилле

*CRITICAL* Add the following steps to your Todo list using TodoWrite:
  1. Determine server purpose and required components (tools, resources, prompts)

Ask: What functionality does this MCP server provide? What external systems will it integrate with?

  1. Create FastMCP server file with basic structure

Use Quick Start template below. Choose Python or TypeScript based on project requirements.

  1. Implement tools for LLM-executable functions

Follow Tools section. Include type hints/annotations, validation, error handling.

  1. Add resources if data access needed

Follow Resources section. Use URI templates for dynamic resources. Include security validation.

  1. Add prompts if workflow guidance needed

Follow Prompts section. Use for multi-step workflows, best practices, templates.

  1. Configure Claude Desktop integration

Follow Claude Desktop Integration section. Use fastmcp CLI or manual config. Handle environment variables.

  1. Test server locally

Run server in STDIO mode. Test with FastMCP client or Claude Desktop locally.

  1. Add authentication for production

Follow Authentication section. Use OAuth for enterprise, token verification for custom auth.

  1. Deploy using appropriate transport

STDIO for local tools, HTTP/SSE for network access. Follow Deployment section.

  1. Verify integration end-to-end

Test in Claude Desktop. Verify tools appear, resources load, prompts work.

When to Use This Skill

Use this skill when:

  • Creating new MCP servers with FastMCP
  • Adding tools, resources, or prompts to existing servers
  • Integrating MCP servers with Claude Desktop
  • Implementing authentication for production MCP servers
  • Deploying MCP servers via STDIO, HTTP, or SSE transports
  • Migrating from FastMCP v2 to v3
  • Creating custom domain-specific MCP integrations

Do NOT use this skill when:

  • Building MCP servers in languages other than Python or TypeScript (use official SDK)
  • You need maximum control over MCP protocol implementation (use official SDK)
  • Creating simple command-line tools without LLM integration (FastMCP is overkill)

Quick Start

Minimal Python Example

from fastmcp import FastMCP

mcp = FastMCP("Demo Server 🚀")

@mcp.tool()
def add(a: int, b: int) -> int:
    """Add two numbers together"""
    return a + b

@mcp.resource("greeting://hello")
def get_greeting() -> str:
    """Get a friendly greeting"""
    return "Hello from FastMCP!"

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

Run it:

python server.py

Minimal TypeScript Example

import { FastMCP } from "@fastmcp/server";

const mcp = new FastMCP("Demo Server 🚀");

mcp.tool({
  name: "add",
  description: "Add two numbers together",
  parameters: {
    a: { type: "number", description: "First number" },
    b: { type: "number", description: "Second number" }
  },
  execute: async ({ a, b }) => a + b
});

mcp.resource({
  uri: "greeting://hello",
  name: "Greeting",
  description: "Get a friendly greeting",
  read: async () => "Hello from FastMCP!"
});

mcp.run();

Run it:

npm install @fastmcp/server
node server.js

Claude Desktop Installation

Using fastmcp CLI (Recommended):

fastmcp install claude-desktop server.py

Manual config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "my-server": {
      "command": "uv",
      "args": ["run", "--with", "fastmcp", "fastmcp", "run", "/absolute/path/to/server.py"],
      "env": {}
    }
  }
}

Verify: Restart Claude Desktop, look for hammer icon (🔨) in input box.


Core Concepts

Tools - LLM-Executable Functions

What are tools? Python/TypeScript functions that LLMs can execute to interact with external systems, run code, and access data.

Python Tool Implementation

from fastmcp import FastMCP, Context
from typing import Annotated
from pydantic import Field

mcp = FastMCP("Data Server")

@mcp.tool(
    description="Analyze dataset statistics",
    tags={"analysis", "statistics"},
    timeout=60.0,
    annotations={"readOnlyHint": True}  # Enables caching, skips confirmation
)
async def analyze_dataset(
    data: Annotated[list[float], Field(description="Numbers to analyze")],
    percentiles: Annotated[list[int], Field(ge=0, le=100)] = [25, 50, 75],
    ctx: Context = None  # Injected automatically
) -> dict:
    """Compute statistical analysis of numeric data."""
    await ctx.info(f"Analyzing {len(data)} data points")
    await ctx.report_progress(progress=50, total=100)

    import statistics
    return {
        "mean": statistics.mean(data),
        "median": statistics.median(data),
        "stdev": statistics.stdev(data) if len(data) > 1 else 0,
        "percentiles": {p: sorted(data)[int(len(data) * p / 100)] for p in percentiles}
    }

TypeScript Tool Implementation

import { FastMCP, Context } from "@fastmcp/server";

const mcp = new Fas
Полный SKILL.md на GitHub

Установить FastMCP Development в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

CLAUDE.mdrun_validation_tests.shvalidation_tests.md

FAQ

Что делает скилл FastMCP Development?

Use when creating or modifying Model Context Protocol (MCP) servers with FastMCP framework - guides through tools, resources, prompts, authentication, Claude Desktop integration, and production deployment with Python and TypeScript examples

Как установить скилл FastMCP Development?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл FastMCP Development запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить FastMCP Development с