プロトタイプ · プレビュー版:公式レジストリのすべてのサーバーを掲載し、30分ごとに同期しています。Google でログインするとレビューを書けます。プロトタイプ · 30分ごとに更新
PopNx MCPAIを使う人のためのMCPサーバー · やさしい言葉で解説

What it does

FastCRUD is a Python package for FastAPI, offering robust async CRUD operations and flexible endpoint creation utilities.

  • Connects Instruction files the AI reads
  • Account or key No key found in README or SKILL.md
  • Category コーディング
作者向け:README にバッジを付ける

作者の方は、このコードを README に貼れます。バッジはこのページにリンクします。

[![Featured on PopNx MCP](https://mcp.popnx.com/badge/skill/benavlabs-fastcrud.svg)](https://mcp.popnx.com/en/skills/benavlabs-fastcrud)

一緒に使える

同じ作業で AI をサービスにつなぐ MCP

REA

Reverse engineer anything from your terminal or agent with one CLI and MCP server.

作者:morluto広く使われている↓ 38.9万/週★ 46.6万6 日前更新

MCP · サービスにつなぐパソコンで動く

Fallow

Codebase intelligence for TypeScript and JavaScript, exposed as structured MCP analysis tools.

作者:fallow-rs広く使われている↓ 244.1万/週★ 5379昨日更新

MCP · サービスにつなぐパソコンで動く

似た Skill

同じ種類の作業。Skill 一覧と同じ並び

似たものと比べる
これ
fastcrud
reaandrej-karpathy-skillsgraphifyMoneyPrinterTurbo
作者benavlabsmorlutomultica-aiGraphify-Labsharry0703
Skill 数11111
GitHub スター1,602465,460233,910149,364144,149
最終コード更新2026年10月12日2026年11月17日2026年4月20日2026年11月17日2026年11月17日
ライセンスMITMIT–Apache-2.0MIT

benavlabs による 1 個の Skill(指示セット)。AI が読んでそのとおりに作業します · MCP server ではありません

Skill と MCP の違い

MCP = 手

AI を外部のサービスやデータにつなぎます(例:Notion を読む、請求書を作る)。プログラムやサーバーが動いている必要があります。

Skill = 手順書

作業のやり方を AI に教えるテキストファイル。どのサービスにもつながりません。

重なる部分もあります。ツールを呼ぶスクリプト付きの Skill や、知識だけを渡す MCP もあります。やりたい作業から選んでください。

使えるアプリ

Claude CodeCodexCursorGitHub CopilotOpenCode

提供元の README と repo のフォルダから判断

インストール

Is it safe?

  • Who made it

    GitHub account benavlabs (organization), 1 years old

  • Use and upkeep

    ★ 1,602 stars · code last changed 2026年10月12日

  • Any scripts?

    No, plain text files the AI reads and follows

  • Uses the internet?

    No scripts, so it does not go online by itself

  • Changes machine-wide settings?

    No hooks or writes to machine settings found

Checked automatically from the repo files at commit 27f2cba (read only, nothing was run). Not a safety guarantee: read it and decide for yourself

まず:どの AI を使っていますか

使っているアプリを選ぶと、そのアプリでのインストール方法だけが表示されます

Option 1Upload to claude.ai (web and app)

Uploading to claude.ai would fail: the description is over 200 characters (622). Use "Let the AI install it" instead

Option 1Claude Code にインストールしてもらう

この文をコピーして Claude Code のチャットに貼り付けます

Where to install
Please install the skill fastcrud from https://github.com/benavlabs/fastcrud folder fastcrud/.agents/skills/fastcrud (commit 27f2cba) for all my projects, at ~/.claude/skills/fastcrud. First show me every file and tell me whether it has scripts or changes machine settings, then tell me the full path you will install to and wait for me to agree.
Please install the skill fastcrud from https://github.com/benavlabs/fastcrud folder fastcrud/.agents/skills/fastcrud (commit 27f2cba) into the project this chat is open in (at .claude/skills/fastcrud). First show me every file and tell me whether it has scripts or changes machine settings, then tell me the project name and the full path you will install to and wait for me to agree.

For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing

The AI tells you what it will do first and asks your permission at every step

Claude Code を開き直し、/fastcrud と入力するか関連する作業を頼むと Claude が自動で使います

Checked against official docs 2026年11月12日 · Source: code.claude.com

For Terminal users

Skill は AI が従う指示です。入れる前にファイルを読み、信頼できる提供元のものだけを入れてください。

  1. ターミナルを開く

    Mac:Command+スペースで Terminal と入力 · Windows:下のコマンドは PowerShell では動きません。上の「AI にインストールしてもらう」を使ってください

  2. skill フォルダを ~/.claude/skills にコピー

    repo を一時フォルダにダウンロードし、SKILL.md のあるフォルダだけをコピーします

    git clone --depth 1 https://github.com/benavlabs/fastcrud.git /tmp/popnx-skill-benavlabs-fastcrud-27f2cba && mkdir -p ~/.claude/skills && cp -R '/tmp/popnx-skill-benavlabs-fastcrud-27f2cba/fastcrud/.agents/skills/fastcrud' ~/.claude/skills/fastcrud
  3. Claude Code を開き直し、/fastcrud と入力するか関連する作業を頼むと Claude が自動で使います

自分でインストールした Skill は ChatGPT デスクトップアプリ、Codex CLI、IDE の Codex 拡張機能で使えます · Web 版とモバイル版の ChatGPT では自分でインストールした Skill は使えず、ディレクトリのプラグインに含まれる Skill だけが使えます

ChatGPT デスクトップアプリ

ChatGPT デスクトップアプリには Codex が組み込まれていて、Codex は ~/.agents/skills フォルダから Skill を読み込みます

Option 1ChatGPT にインストールしてもらう

ChatGPT デスクトップアプリで Codex を開き、この文をチャットに貼り付けます

Where to install
Please install the skill fastcrud from https://github.com/benavlabs/fastcrud folder fastcrud/.agents/skills/fastcrud (commit 27f2cba) for all my projects, at ~/.agents/skills/fastcrud. First show me every file and tell me whether it has scripts or changes machine settings, then tell me the full path you will install to and wait for me to agree.
Please install the skill fastcrud from https://github.com/benavlabs/fastcrud folder fastcrud/.agents/skills/fastcrud (commit 27f2cba) into the project this chat is open in (at .agents/skills/fastcrud). First show me every file and tell me whether it has scripts or changes machine settings, then tell me the project name and the full path you will install to and wait for me to agree.

The AI always shows you the path before installing

The AI tells you what it will do first and asks your permission at every step

Option 2自分でフォルダを置く

fastcrud フォルダを ~/.agents/skills/fastcrud に置きます

~ はホームフォルダ($HOME)です

For Terminal users

Skill は AI が従う指示です。入れる前にファイルを読み、信頼できる提供元のものだけを入れてください。

  1. ターミナルを開く

    Mac:Command+スペースで Terminal と入力 · Windows:下のコマンドは PowerShell では動きません。上の「AI にインストールしてもらう」を使ってください

  2. skill フォルダを ~/.agents/skills にコピー

    repo を一時フォルダにダウンロードし、SKILL.md のあるフォルダだけをコピーします

    git clone --depth 1 https://github.com/benavlabs/fastcrud.git /tmp/popnx-skill-benavlabs-fastcrud-27f2cba && mkdir -p ~/.agents/skills && cp -R '/tmp/popnx-skill-benavlabs-fastcrud-27f2cba/fastcrud/.agents/skills/fastcrud' ~/.agents/skills/fastcrud

インストールしたあと

  • ChatGPT デスクトップアプリ:サイドバーの Skills を開いて Skill があるか確認します
  • 使い方:ChatGPT では @ を入力して Skill を選びます · Codex CLI や IDE 拡張機能では /skills を実行するか、$ に続けて Skill 名を入力します
  • Codex は新しくインストールした Skill を自動で見つけます。表示されない場合は Codex を再起動してください

Checked against official docs 2026年11月15日 · Source: learn.chatgpt.com

Web 版とモバイル版の ChatGPT

自分でインストールした Skill は使えません。ディレクトリのプラグインに含まれる Skill だけが使えます

この Skill を ChatGPT で使うには、上の方法で ChatGPT デスクトップアプリを使ってください

Checked against official docs 2026年11月15日 · Source: learn.chatgpt.com

Option 1Codex にインストールしてもらう

この文をコピーして Codex のチャットに貼り付けます · ChatGPT デスクトップアプリ内の Codex、Codex CLI、IDE 拡張機能で使えます

Where to install
Please install the skill fastcrud from https://github.com/benavlabs/fastcrud folder fastcrud/.agents/skills/fastcrud (commit 27f2cba) for all my projects, at ~/.agents/skills/fastcrud. First show me every file and tell me whether it has scripts or changes machine settings, then tell me the full path you will install to and wait for me to agree.
Please install the skill fastcrud from https://github.com/benavlabs/fastcrud folder fastcrud/.agents/skills/fastcrud (commit 27f2cba) into the project this chat is open in (at .agents/skills/fastcrud). First show me every file and tell me whether it has scripts or changes machine settings, then tell me the project name and the full path you will install to and wait for me to agree.

For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing

The AI tells you what it will do first and asks your permission at every step

Codex は新しくインストールした Skill を自動で見つけます。表示されない場合は Codex を再起動してください · 使い方:ChatGPT では @ を入力して Skill を選びます · Codex CLI や IDE 拡張機能では /skills を実行するか、$ に続けて Skill 名を入力します

Checked against official docs 2026年11月15日 · Source: learn.chatgpt.com

For Terminal users

Skill は AI が従う指示です。入れる前にファイルを読み、信頼できる提供元のものだけを入れてください。

  1. ターミナルを開く

    Mac:Command+スペースで Terminal と入力 · Windows:下のコマンドは PowerShell では動きません。上の「AI にインストールしてもらう」を使ってください

  2. skill フォルダを ~/.agents/skills にコピー

    repo を一時フォルダにダウンロードし、SKILL.md のあるフォルダだけをコピーします

    git clone --depth 1 https://github.com/benavlabs/fastcrud.git /tmp/popnx-skill-benavlabs-fastcrud-27f2cba && mkdir -p ~/.agents/skills && cp -R '/tmp/popnx-skill-benavlabs-fastcrud-27f2cba/fastcrud/.agents/skills/fastcrud' ~/.agents/skills/fastcrud
  3. Codex を開き直して関連する作業を頼むと、Codex が skill を一覧に出します

Option 1Cursor にインストールしてもらう

この文をコピーして Cursor のチャットに貼り付けます

Where to install
Please install the skill fastcrud from https://github.com/benavlabs/fastcrud folder fastcrud/.agents/skills/fastcrud (commit 27f2cba) for all my projects, at ~/.cursor/skills/fastcrud. First show me every file and tell me whether it has scripts or changes machine settings, then tell me the full path you will install to and wait for me to agree.
Please install the skill fastcrud from https://github.com/benavlabs/fastcrud folder fastcrud/.agents/skills/fastcrud (commit 27f2cba) into the project this chat is open in (at .cursor/skills/fastcrud). First show me every file and tell me whether it has scripts or changes machine settings, then tell me the project name and the full path you will install to and wait for me to agree.

For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing

The AI tells you what it will do first and asks your permission at every step

Cursor の Agent チャットで / を入力し fastcrud を選ぶ

Checked against official docs 2026年11月12日 · Source: cursor.com

For Terminal users

Skill は AI が従う指示です。入れる前にファイルを読み、信頼できる提供元のものだけを入れてください。

  1. ターミナルを開く

    Mac:Command+スペースで Terminal と入力 · Windows:下のコマンドは PowerShell では動きません。上の「AI にインストールしてもらう」を使ってください

  2. skill フォルダを ~/.cursor/skills にコピー

    repo を一時フォルダにダウンロードし、SKILL.md のあるフォルダだけをコピーします

    git clone --depth 1 https://github.com/benavlabs/fastcrud.git /tmp/popnx-skill-benavlabs-fastcrud-27f2cba && mkdir -p ~/.cursor/skills && cp -R '/tmp/popnx-skill-benavlabs-fastcrud-27f2cba/fastcrud/.agents/skills/fastcrud' ~/.cursor/skills/fastcrud
  3. Cursor の Agent チャットで / を入力し fastcrud を選ぶ

Option 1Let the AI install it

Skill を読めるほかのアプリ向けです。この文には Claude Code、Codex、Cursor のパスが入っていて、AI が使っているアプリに合わせて選びます · Copy this sentence into the app’s chat

Where to install
Please install the skill fastcrud from https://github.com/benavlabs/fastcrud folder fastcrud/.agents/skills/fastcrud (commit 27f2cba) for all my projects, at ~/.claude/skills/fastcrud (in Codex use ~/.agents/skills/fastcrud, in Cursor ~/.cursor/skills/fastcrud). First show me every file and tell me whether it has scripts or changes machine settings, then tell me the full path you will install to and wait for me to agree.
Please install the skill fastcrud from https://github.com/benavlabs/fastcrud folder fastcrud/.agents/skills/fastcrud (commit 27f2cba) into the project this chat is open in (at .claude/skills/fastcrud; in Codex use .agents/skills/fastcrud, in Cursor .cursor/skills/fastcrud). First show me every file and tell me whether it has scripts or changes machine settings, then tell me the project name and the full path you will install to and wait for me to agree.

For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing

The AI tells you what it will do first and asks your permission at every step

Checked against official docs 2026年11月12日 · Source: code.claude.com, learn.chatgpt.com, cursor.com

For Terminal users

Gemini CLI や GitHub Copilot など Agent Skills 対応の他のアプリはフォルダが違います。そのアプリのガイドを見て、SKILL.md のあるフォルダをコピーしてください。

GitHub で見る ↗

2026年11月11日 に Claude Code、Codex、Cursor の公式ガイドで skill フォルダを確認

✓ コマンド確認済み 2026年11月18日

元の SKILL.md を見る

以下は提供元の repo の文章で、PopNx MCP の指示ではありません

最初の 8,000 文字を表示 · GitHub で全文を開く

---
name: fastcrud
description: Use when building or modifying CRUD endpoints with FastCRUD (the `fastcrud` PyPI package) in a FastAPI project — covers `FastCRUD`, `crud_router`, `EndpointCreator`, `FilterConfig`, `JoinConfig`, auto-relationship detection, the filter operator syntax (`__gte`, `__in`, `__ilike`, etc.), cursor pagination, soft delete, and how to avoid N+1 queries when fetching related data. Activate when the user mentions FastCRUD, `crud_router`, `FastCRUD()`, `FilterConfig`, `JoinConfig`, or asks how to build CRUD endpoints / generate REST APIs from SQLAlchemy or SQLModel models, even if the user doesn't name the library directly.
license: MIT
metadata:
  author: benav-labs
  package: fastcrud
---

# FastCRUD

FastCRUD generates async CRUD methods (and optionally CRUD endpoints) for SQLAlchemy 2.0 models inside a FastAPI app. The two entry points are:

- **`FastCRUD(Model)`** — the data-access class. Use this for per-row CRUD operations (single-record get / create / update / delete, paginated lists, joins with relationships). Real codebases use this in services, workers, and custom endpoints.
- **`crud_router(...)`** — returns an `APIRouter` with create/read/update/delete endpoints auto-wired. Use this only when you want generated endpoints; many apps skip it and hand-roll FastAPI routes on top of `FastCRUD` instances.

This skill covers the public API across `fastcrud >= 0.22`; features marked (v0.23+) need `fastcrud >= 0.23`. SQLAlchemy is the default ORM in examples; SQLModel works the same way except where noted.

**Before reaching for FastCRUD, check the [When NOT to use FastCRUD](#when-not-to-use-fastcrud) section below.** Aggregate roll-ups, CTEs, `GROUP BY` projections, and bulk writes are SQLAlchemy's job — FastCRUD is for per-row CRUD.

---

## Canonical setup

The minimal viable pattern. Always start here, then add filters/joins/relationships as needed.

```python
# models.py
from sqlalchemy import Column, Integer, String, ForeignKey
from sqlalchemy.orm import DeclarativeBase, relationship

class Base(DeclarativeBase): pass

class Tier(Base):
    __tablename__ = "tier"
    id = Column(Integer, primary_key=True)
    name = Column(String, unique=True)

class User(Base):
    __tablename__ = "user"
    id = Column(Integer, primary_key=True)
    name = Column(String)
    email = Column(String, unique=True)
    tier_id = Column(Integer, ForeignKey("tier.id"))
    tier = relationship("Tier")
```

```python
# schemas.py
from pydantic import BaseModel, ConfigDict

class UserCreate(BaseModel):
    name: str
    email: str
    tier_id: int

class UserRead(BaseModel):
    model_config = ConfigDict(from_attributes=True)
    id: int
    name: str
    email: str
    tier_id: int

class UserUpdate(BaseModel):
    name: str | None = None
    email: str | None = None
```

```python
# main.py
from fastapi import FastAPI
from fastcrud import crud_router
from .db import get_async_session
from .models import User
from .schemas import UserCreate, UserRead, UserUpdate

app = FastAPI()

user_router = crud_router(
    session=get_async_session,    # callable returning AsyncSession (FastAPI dependency)
    model=User,
    create_schema=UserCreate,
    update_schema=UserUpdate,
    select_schema=UserRead,        # used for read responses
    path="/users",
    tags=["users"],
)
app.include_router(user_router)
```

This produces `POST /users`, `GET /users/{id}`, `PATCH /users/{id}`, `DELETE /users/{id}`, `DELETE /users/db_delete/{id}` (hard delete), and `GET /users` (paginated list).

---

## Choosing the right method

When using `FastCRUD(Model)` directly, pick the method that matches the data shape you actually need. **Do not loop over `get_multi()` and call `get_joined()` per row** — that's the canonical N+1.

| Need                                        | Use                          |
|---------------------------------------------|------------------------------|
| Single row, no joins                        | `get(db, id=...)`            |
| Single row with related data                | `get_joined(db, id=...)`     |
| Paginated list, no joins                    | `get_multi(db, offset, limit)` |
| **Paginated list with related data**       | **`get_multi_joined(db, ...)`** |
| Cursor-paginated list (infinite scroll)     | `get_multi_by_cursor(db, ...)` |
| Insert                                      | `create(db, schema)`         |
| Insert-or-update by unique constraint       | `upsert(db, schema)` / `upsert_multi(db, list)` |
| Patch by filters                            | `update(db, schema, **kwargs)` |
| Soft delete (if configured)                 | `delete(db, **kwargs)`       |
| Hard delete (always removes row)            | `db_delete(db, **kwargs)`    |
| Count                                       | `count(db, **kwargs)`        |
| Boolean existence check                     | `exists(db, **kwargs)`       |

---

## Avoiding N+1 — the most common mistake

FastCRUD has two mechanisms to prevent N+1 when fetching related data. **Use one of them — never iterate.**

### 1. Auto-detect relationships (zero config, default for v0.21+)

Set `include_relationships=True` on `crud_router` (or `auto_detect_relationships=True` on the FastCRUD method directly). FastCRUD inspects the SQLAlchemy mapper, builds the joins, and threads them through a single query.

```python
crud_router(
    session=get_async_session,
    model=User,
    create_schema=UserCreate,
    update_schema=UserUpdate,
    select_schema=UserWithTier,           # schema includes nested tier field
    include_relationships=True,           # auto-include all relationships
    path="/users",
)
```

Or pass a list to include only specific relationships:

```python
include_relationships=["tier", "department"]   # whitelist
```

**Gotcha:** **One-to-many relationships are excluded by default** because they can return unbounded data. Opt in explicitly:

```python
include_relationships=True,
include_one_to_many=True,
default_nested_limit=10,    # cap nested rows per parent (uses SQL window function)
```

`default_nested_limit` uses `row_number() OVER (PARTITION BY ...)` at the database level — it does **not** fetch everything and slice in Python.

### 2. Manual `JoinConfig` (when you need explicit control)

For self-joins, aliases, custom join conditions, or per-join schemas:

```python
from fastcrud import FastCRUD, JoinConfig

orders_with_user = await crud.get_multi_joined(
    db=session,
    joins_config=[
        JoinConfig(
            model=User,
            join_on=Order.user_id == User.id,
            join_prefix="user_",         # avoid column collisions
            schema_to_select=UserRead,
        ),
    ],
    offset=0,
    limit=20,
)
```

For one-to-many with per-parent capping:

```python
JoinConfig(
    model=Article,
    join_on=Article.author_id == Author.id,
    relationship_type="one-to-many",
    sort_columns="created_at",
    sort_orders="desc",
    nested_limit=5,         # 5 most recent articles per author, computed in SQL
)
```

See `references/joins.md` for the full `JoinConfig` spec, polymorphic inheritance, and the auto-detection rules.

---

## `limit=None` — the second biggest footgun

`get_multi(...)` / `get_multi_joined(...)` accept `limit=None` to fetch **every matching row**. This is the single biggest cause of latency cliffs and OOMs in real-world FastCRUD code.

**Rule:** `limit=None` is only safe when a `WHERE` clause domain-bounds the result to a known-small set. Otherwise, always pass an explicit numeric `limit`.

### Safe — scoped by a WHERE clause

```python
# OK: scoped to a single project → bounded by N(clips per project)
clips = await crud_clips.get_multi(db, limit=None, project_id=project.id)

# OK: scoped to a small known set of IDs
tiers = await crud_tiers.get_multi(db, limit=None, id__in=tier_ids)
```

### Unsafe — unbounded growth

```python
# BAD: grows linearly with the user table forever
users = await crud_users.get_multi(db, limit=No

話し合い

質問、コツの共有、使えないことの報告ができます。「役に立った」の多い順です。

まだ投稿はありません。最初の質問や共有をどうぞ。

ここの投稿は利用者によるもので、PopNx チームのものではありません。

ログインして投稿

GitHub の情報

GitHub スター
1,602
提供元
benavlabs
ライセンス
MIT
最終コード更新
2026年10月12日
repo 内の SKILL.md(翻訳版とテンプレートを含む)
1
トピック
async, backend, crud, fastapi, pydantic, pydantic-v2, python, sqlalchemy