FastMCP Development
БесплатноЗапускает вложенные скриптыНе проверенUse when creating or modifying Model Context Protocol (MCP) servers with FastMCP framework - guides through tools, resources, prompts, authentication, Claude…
от enuno★ 17 звёзд на GitHubОб этом скилле
- Determine server purpose and required components (tools, resources, prompts)
Ask: What functionality does this MCP server provide? What external systems will it integrate with?
- Create FastMCP server file with basic structure
Use Quick Start template below. Choose Python or TypeScript based on project requirements.
- Implement tools for LLM-executable functions
Follow Tools section. Include type hints/annotations, validation, error handling.
- Add resources if data access needed
Follow Resources section. Use URI templates for dynamic resources. Include security validation.
- Add prompts if workflow guidance needed
Follow Prompts section. Use for multi-step workflows, best practices, templates.
- Configure Claude Desktop integration
Follow Claude Desktop Integration section. Use fastmcp CLI or manual config. Handle environment variables.
- Test server locally
Run server in STDIO mode. Test with FastMCP client or Claude Desktop locally.
- Add authentication for production
Follow Authentication section. Use OAuth for enterprise, token verification for custom auth.
- Deploy using appropriate transport
STDIO for local tools, HTTP/SSE for network access. Follow Deployment section.
- 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
Установить FastMCP Development в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
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 запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic