Token导航 LogoToken导航TokenDH.com
研究检索external-servicegithub未标认证来源可访问许可证需确认审计提醒

fastmcp-server快速 MCP 服务器

Agent Skill

fastmcp-server 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

2,280

周安装

95

GitHub Stars

26,438

下载量

760
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:fastmcp-server(快速 MCP 服务器)
来源仓库:https://github.com/davila7/claude-code-templates
仓库路径:skills/fastmcp-server
安装命令:
npx skills add https://github.com/davila7/claude-code-templates --skill fastmcp-server
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/davila7/claude-code-templates --skill fastmcp-server

简介

fastmcp-server 提供基于 FastMCP 3.0 构建生产级 MCP 服务器的完整技术规范与升级指南。

  • 适用于在 Codex、Claude、Cursor、Gemini CLI 中实现工具注册、中间件与提供者配置。
  • 支持 OAuth、OIDC 等认证方式,并提供本地、文件系统等多种数据存储后端选项。
  • 使用前请确认项目已安装 FastMCP 3.0+,并检查 Python 环境满足依赖项要求。
  • 建议启用遥测与日志记录,便于监控服务器运行状态与 LLM 交互质量。

SKILL.md

FastMCP 3.0 Server Development

Complete reference for building production-ready MCP (Model Context Protocol) servers with FastMCP 3.0 - the fast, Pythonic framework for connecting LLMs to tools and data.

When to use this skill

Use FastMCP Server when:

  • Creating a new MCP server in Python
  • Adding tools, resources, or prompts to an MCP server
  • Implementing authentication (OAuth, OIDC, token verification)
  • Setting up middleware for logging, rate limiting, or authorization
  • Configuring providers (local, filesystem, skills, custom)
  • Building production MCP servers with telemetry and storage
  • Upgrading from FastMCP 2.x to 3.0

Key areas covered:

  • Tools & Resources (CORE): Decorators, validation, return types, templates
  • Context & DI (CORE): MCP context, dependency injection, background tasks
  • Authentication (SECURITY): OAuth, OIDC, token verification, proxy patterns
  • Authorization (SECURITY): Scope-based and role-based access control
  • Middleware (ADVANCED): Request/response pipeline, built-in middleware
  • Providers (ADVANCED): Local, filesystem, skills, and custom providers
  • Features (ADVANCED): Pagination, sampling, storage, OpenTelemetry, versioning

Quick reference

Core patterns

Create a server with tools:

from fastmcp import FastMCP

mcp = FastMCP("MyServer")

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

Create a resource:

@mcp.resource("data://config")
def get_config() -> dict:
    """Return server configuration"""
    return {"version": "1.0", "debug": False}

Create a resource template:

@mcp.resource("users://{user_id}/profile")
def get_user_profile(user_id: str) -> dict:
    """Get a user's profile by ID"""
    return fetch_user(user_id)

Create a prompt:

@mcp.prompt
def review_code(code: str, language: str = "python") -> str:
    """Review code for best practices"""
    return f"Review this {language} code:\n\n{code}"

Run the server:

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

# Or with transport options:
# mcp.run(transport="sse", host="0.0.0.0", port=8000)

Using context in tools

from fastmcp import FastMCP, Context

mcp = FastMCP("MyServer")

@mcp.tool
def process_data(uri: str, ctx: Context) -> str:
    """Process data with logging and progress"""
    ctx.info(f"Processing {uri}")
    ctx.report_progress(0, 100)
    data = ctx.read_resource(uri)
    ctx.report_progress(100, 100)
    return f"Processed: {data}"

Authentication setup

from fastmcp import FastMCP
from fastmcp.server.auth import BearerAuthProvider

auth = BearerAuthProvider(
    jwks_uri="https://your-provider/.well-known/jwks.json",
    audience="your-api",
    issuer="https://your-provider/"
)

mcp = FastMCP("SecureServer", auth=auth)

Key concepts

Tools

Functions exposed as executable capabilities for LLMs. Decorated with @mcp.tool. Support Pydantic validation, async, custom return types, and annotations (readOnlyHint, destructiveHint).

Resources & Templates

Static or dynamic data sources identified by URIs. Resources use fixed URIs (data://config), templates use parameterized URIs (users://{id}/profile). Support MIME types, annotations, and wildcard parameters.

Context

The Context object provides access to MCP features within tools/resources: logging, progress reporting, resource access, LLM sampling, user elicitation, and session state.

Dependency Injection

Inject values into tool/resource functions using Depends(). Supports HTTP requests, access tokens, custom dependencies, and generator-based cleanup patterns.

Providers

Control where components come from. LocalProvider (default, decorator-based), FileSystemProvider (load from Python files on disk), SkillsProvider (packaged bundles), or custom providers.

Authentication & Authorization

Multiple auth patterns: token verification (JWT, JWKS), OAuth proxy, OIDC proxy, remote OAuth, and full OAuth server. Authorization via scopes on components and middleware.

Middleware

Intercept and modify requests/responses. Built-in middleware for rate limiting, error handling, logging, and response size limits. Custom middleware via @mcp.middleware.

Using the references

Detailed documentation is organized in the references/ folder:

Getting Started

  • getting-started/installation.md - Install FastMCP, optional dependencies, verify setup
  • getting-started/upgrade-guide.md - Migrate from FastMCP 2.x to 3.0
  • getting-started/quickstart.md - First server, tools, resources, prompts, running

Server

  • server/server-class.md - FastMCP server configuration, transport options, tag filtering
  • server/tools.md - Tool decorator, parameters, validation, return types, annotations
  • server/resources-and-templates.md - Resources, templates, URIs, wildcards, MIME types

Context

  • context/mcp-context.md - Context object, logging, progress, resource access, sampling
  • context/background-tasks.md - Long-running operations with task support
  • context/dependency-injection.md - Depends(), custom deps, HTTP request, access tokens
  • context/user-elicitation.md - Request structured input from users during execution

Features

  • features/icons.md - Custom icons for tools, resources, prompts, and servers
  • features/lifespans.md - Server lifecycle management and startup/shutdown hooks
  • features/client-logging.md - Send log messages to MCP clients
  • features/middleware.md - Request/response pipeline, built-in and custom middleware
  • features/pagination.md - Paginate large component lists
  • features/progress-reporting.md - Report progress for long-running operations
  • features/sampling.md - Request LLM completions from the client
  • features/storage-backends.md - Memory, file, and Redis storage for caching and tokens
  • features/opentelemetry.md - Distributed tracing and observability
  • features/versioning.md - Version components and filter by version ranges

Authentication

  • authentication/token-verification.md - JWT, JWKS, introspection, static keys, custom
  • authentication/remote-oauth.md - Delegate auth to upstream OAuth provider
  • authentication/oauth-proxy.md - Full OAuth proxy with PKCE, client management
  • authentication/oidc-proxy.md - OpenID Connect proxy with auto-discovery
  • authentication/full-oauth-server.md - Complete built-in OAuth server

Authorization

  • authorization.md - Scope-based access control, middleware authorization, patterns

Providers

  • providers/local.md - Default provider, decorator-based component registration
  • providers/filesystem.md - Load components from Python files on disk
  • providers/skills.md - Package and distribute component bundles
  • providers/custom.md - Build custom providers for any component source

Version history

v1.0.0 (February 2026)

  • Initial release covering FastMCP 3.0 (release candidate)
  • 30 reference files across 7 categories
  • Complete coverage of tools, resources, context, auth, providers, and features

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.61%
按下载量换算271

Claude

29.54%
按下载量换算225

Cursor

17.32%
按下载量换算132

Gemini CLI

8.41%
按下载量换算64

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills