.use(...) as the main composition primitive when your server grows past a single file.
The simplest mental model is:
- one feature folder owns one area of the server
- that folder exports one
Redopinstance - the root server imports those feature modules and attaches them with
.use(...)
Why this pattern works
This keeps composition obvious:- folder structure matches server structure
- each feature can register its own tools, resources, prompts, middleware, and hooks
- the root server stays small
- naming stays explicit instead of being rewritten by a grouping helper
Recommended folder shape
Feature module
Each feature folder builds oneRedop module and exports it.
Root server
The main server becomes a small composition layer.Naming guidance
Since Redop no longer rewrites names for you, make names explicit:- tools:
notes.list,notes.create,users.get - prompts:
notes.summarise - resources:
notes://{id},users://{id}/profile
When to use a plugin instead
Use a feature module when the registrations belong to one server. UsedefinePlugin(...) when the behavior should be packaged and reused across multiple servers or projects.