mcpField
S
serverpod-modules

serverpod-modules

github.com/serverpodDevelopment3.3k44 installsUpdated 1d ago
Repository

About serverpod-modules

A Serverpod skill for adding reusable modules that can include server, client, and optional Flutter packages in separate namespaces. It also explains creating custom modules and referencing their types in models.

Key features

  1. 01Add server and client packages
  2. 02Optional Flutter package support
  3. 03Configure module nicknames
  4. 04Reference module types in models
  5. 05Create custom module packages

Use cases

  1. 01Integrate a reusable Serverpod module
  2. 02Use module types in application models
  3. 03Scaffold a custom module

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/serverpod/serverpod --skill serverpod-modules

After installing, type/serverpod-modulesin Claude Code to confirm it loaded.

Details

From the project README

Serverpod Modules

Modules are reusable Serverpod packages with server, client, and optionally Flutter code in their own endpoint/model namespaces.

Adding a module

Server: Add module server package to pubspec.yaml (e.g. serverpod_auth_idp_server: <serverpod-version>). Optionally declare in config/generator.yaml:

modules:
  serverpod_auth_idp:
    nickname: auth

Then dart pub get, serverpod generate. If the module adds tables and database generation is enabled, follow ../serverpod-migrations/SKILL.md.

Client: Add module client package (e.g. serverpod_auth_idp_client: <serverpod-version>).

Flutter: Add module Flutter package if provided (e.g. serverpod_auth_idp_flutter: <serverpod-version>).

Keep Serverpod and module versions aligned.

Referencing module types in models

class: MyClass
fields:
  userInfo: module:serverpod_auth_core:AuthUser
  # Or with nickname:
  userInfo: module:auth:AuthUser

Run serverpod generate after changes.

Creating a custom module

serverpod create --template module my_module

Creates server + client packages. Add Flutter package if needed: flutter create --template package my_module_flutter. Set type: module in config/generator.yaml. Prefix table names (e.g. my_module_orders) to avoid clashes.

Comments

Markdown supported