api

api is a skill for Claude Code, Codex from LuuOW/meridian-mcp. It costs 51 tokens per session (2,981 once invoked), scanned A, original, MIT.

A set of patterns for building and using web APIs with Python's FastAPI framework and TypeScript/React clients. It covers request handling, authentication, data validation, browser access, background work, and connections to multiple service providers.

In plain words
What is it for?
Use it when creating FastAPI routes, JWT login, Pydantic request and response models, CORS settings, background tasks, multi-provider routing, or typed frontend API clients.
Why use it?
It provides a consistent way to connect a frontend, backend, database, and outside services without designing each API integration from scratch.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/luuow/meridian-mcp/api
Any agent
npx skills add LuuOW/meridian-mcp --skill api
Clone the repo
git clone --depth 1 https://github.com/LuuOW/meridian-mcp

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 api

README.md
[![agentmods](https://agentmods.dev/badge/skills/luuow/meridian-mcp/api.svg)](https://agentmods.dev/skills/luuow/meridian-mcp/api)
Your own site
<a href="https://agentmods.dev/skills/luuow/meridian-mcp/api"><img src="https://agentmods.dev/badge/skills/luuow/meridian-mcp/api.svg" alt="Measured on agentmods" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,981 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
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 $0.00051 $0.02981
Opus 5 $0.00026 $0.01491
Sonnet 5 $0.00010 $0.00596
Haiku 4.5 $0.00005 $0.00298

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

Security

Grade A, and why

api scanned grade A with 1 finding 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 4d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

const api = axios.create({
skills/api/SKILL.md · 370 lines

How it starts

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

api

Production patterns for building and consuming APIs in the Python/FastAPI + TypeScript/React stack used across lead-gen-engine and seo-geo-aeo-engine.

1) FastAPI App Structure

# api/main.py
from contextlib import asynccontextmanager
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware

@asynccontextmanager
async def lifespan(app: FastAPI):
    # Startup: init DB pool, Redis, scheduler
    await db.connect()
    yield
    # Shutdown: close pool
    await db.disconnect()

app = FastAPI(lifespan=lifespan)

app.add_middleware(
    CORSMiddleware,
    allow_origins=["http://localhost:3000", "http://localhost:3002"],
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

# Register routers
from api.routes import auth, campaigns, prospects
app.include_router(auth.router, prefix="/api/auth")
app.include_router(campaigns.router, prefix="/api/campaigns")
app.include_router(prospects.router, prefix="/api")

2) Route Module Pattern

# api/routes/campaigns.py
from fastapi import APIRouter, Depends, HTTPException
from pydantic import BaseModel
from api.deps import get_db, get_current_user

router = APIRouter()

class OnboardRequest(BaseModel):
    name: str
    domain: str
    target_icp: str | None = None

class CampaignResponse(BaseModel):
    id: int
    name: str
    status: str

@router.post("/campaigns/onboard", response_model=CampaignResponse)
def onboard_campaign(body: OnboardRequest, db=Depends(get_db)):
    campaign = db.insert("campaigns", {"name": body.name, "domain": body.domain})
    return campaign

@router.get("/campaigns", response_model=list[CampaignResponse])
def list_campaigns(status: str | None = None, db=Depends(get_db)):
    filters = {"status": status} if status else {}
    return db.fetch_many("campaigns", filters)

3) JWT Auth Pattern

# shared/auth.py
import os
from datetime import datetime, timedelta
from jose import jwt, JWTError
from passlib.context import CryptContext
from fastapi import Depends, HTTPException, status
from fastapi.security import OAuth2PasswordBearer

SECRET_KEY = os.environ.get("JWT_SECRET_KEY", "change-me-in-production")
ALGORITHM = "HS256"
EXPIRE_MINUTES = int(os.environ.get("JWT_EXPIRE_MINUTES", "480"))

pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="/api/auth/login")

def create_access_token(data: dict) -> str:
    payload = data.copy()
    payload["exp"] = datetime.utcnow() + timedelta(minutes=EXPIRE_MINUTES)
    return jwt.encode(payload, SECRET_KEY, algorithm=ALGORITHM)

def get_current_user(token: str = Depends(oauth2_scheme)) -> dict:
    try:
        payload = jwt.decode(token, SECRET_KEY, algorithms=[ALGORITHM])
        return {"id": payload["sub"], "email": payload["email"], "role": payload["role"]}
    except JWTError:
        raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED, detail="Invalid token")

def verify_password(plain: str, hashed: str) -> bool:
    return pwd_context.verify(plain, hashed)

def hash_password(plain: str) -> str:
    return pwd_context.hash(plain)

Read the full file on GitHub · 370 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. 4d ago First seen · 370 lines · 51 tokens per session scan A e6ac2c00565e

Subscribe to this mod's changes

api is a skill published in the GitHub repository LuuOW/meridian-mcp (0 stars, last pushed 2d ago), licensed MIT. It adds 51 tokens to every session and 2,981 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.