FastAPI Modern Web Development

FastAPI Modern Web Development is a skill for Claude Code, Codex from bobmatnyc/mcp-skillset. It costs 41 tokens per session (4,401 once invoked), scanned A, original, MIT.

A guide for building FastAPI web services in Python using asynchronous code, data validation, dependency injection, and automatic API documentation. FastAPI is a Python framework for creating REST APIs, which let programs communicate over HTTP.

In plain words
What is it for?
Use it to build REST APIs, asynchronous services, microservices, machine-learning endpoints, and APIs for language-model workflows.
Why use it?
It helps structure reliable, type-checked APIs that can handle concurrent requests and connect to databases, machine-learning services, or other systems.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to build REST APIs, asynchronous services, microservices, machine-learning endpoints, and APIs for language-model workflows.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bobmatnyc/mcp-skillset/fastapi-web-development
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add bobmatnyc/mcp-skillset --skill fastapi-web-development
Clone the repo
git clone --depth 1 https://github.com/bobmatnyc/mcp-skillset

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for FastAPI Modern Web Development

README.md
[![agentmods](https://agentmods.dev/badge/skills/bobmatnyc/mcp-skillset/fastapi-web-development.svg)](https://agentmods.dev/skills/bobmatnyc/mcp-skillset/fastapi-web-development)
Your own site
<a href="https://agentmods.dev/skills/bobmatnyc/mcp-skillset/fastapi-web-development"><img src="https://agentmods.dev/badge/skills/bobmatnyc/mcp-skillset/fastapi-web-development.svg" alt="Measured on agentmods" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,401 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00041 $0.04401
Opus 5 $0.00020 $0.02201
Sonnet 5 $0.00008 $0.00880
Haiku 4.5 $0.00004 $0.00440

Measured 8d ago against content hash ff1ded7e21b4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

FastAPI Modern Web Development scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/skill-templates/fastapi-web-development/SKILL.md · 636 lines

How it starts

The opening of the file, as written. The whole thing — 636 lines — stays where its author put it; the contents beside it link to each section on GitHub.

FastAPI Modern Web Development

Overview

This skill provides comprehensive guidance for building production-grade FastAPI applications with modern Python patterns (2024-2025 best practices). FastAPI is the #1 framework for AI/ML APIs, combining high performance, automatic OpenAPI documentation, and intuitive async/await patterns.

When to Use This Skill

Use this skill when:

  • Building RESTful APIs for ML/AI services
  • Creating high-performance async Python web services
  • Developing data-intensive applications requiring concurrent request handling
  • Implementing microservices with automatic API documentation
  • Building APIs that require strong type safety and validation
  • Designing endpoints for LLM integration and AI workflows

Core Principles

1. Async-First Architecture

Always prefer async/await for I/O-bound operations

from fastapi import FastAPI, Depends
from sqlalchemy.ext.asyncio import AsyncSession
import httpx

app = FastAPI()

# CORRECT: Async database operations
@app.get("/users/{user_id}")
async def get_user(user_id: int, db: AsyncSession = Depends(get_db)):
    result = await db.execute(select(User).where(User.id == user_id))
    return result.scalar_one_or_none()

# CORRECT: Async external API calls
@app.get("/external-data")
async def fetch_external():
    async with httpx.AsyncClient() as client:
        response = await client.get("https://api.example.com/data")
        return response.json()

# WRONG: Blocking synchronous calls in async context
@app.get("/bad-example")
async def bad_handler():
    time.sleep(5)  # Blocks entire event loop!
    return {"status": "done"}

Why: FastAPI runs on ASGI (asyncio). Blocking calls prevent other requests from processing, degrading performance under load.

2. Pydantic v2 Models for Type Safety

Use Pydantic models for all request/response validation

from pydantic import BaseModel, Field, field_validator, ConfigDict
from datetime import datetime
from typing import Optional

class UserCreate(BaseModel):
    """Request model for user creation"""
    model_config = ConfigDict(str_strip_whitespace=True)

    username: str = Field(..., min_length=3, max_length=50)
    email: str = Field(..., pattern=r'^[\w\.-]+@[\w\.-]+\.\w+$')
    age: Optional[int] = Field(None, ge=13, le=120)

    @field_validator('username')
    @classmethod
    def username_alphanumeric(cls, v: str) -> str:
        if not v.isalnum():
            raise ValueError('Username must be alphanumeric')
        return v.lower()

class UserResponse(BaseModel):
    """Response model - never expose internal fields"""
    model_config = ConfigDict(from_attributes=True)  # Pydantic v2

    id: int
    username: str
    email: str
    created_at: datetime
    # DON'T expose: password_hash, internal_flags, etc.

@app.post("/users", response_model=UserResponse, status_code=201)
async def create_user(user: UserCreate, db: AsyncSession = Depends(get_db)):
    db_user = User(**user.model_dump())  # Pydantic v2 syntax
    db.add(db_user)
    await db.commit()
    await db.refresh(db_user)
    return db_user

Read the full file on GitHub · 636 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 636 lines · 41 tokens per session scan A ff1ded7e21b4

Subscribe to this mod's changes

FastAPI Modern Web Development is a skill published in the GitHub repository bobmatnyc/mcp-skillset (20 stars, last pushed 6mo ago), licensed MIT. It adds 41 tokens to every session and 4,401 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.