Skip to main content
Use .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 Redop instance
  • 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

Feature module

Each feature folder builds one Redop 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
This keeps the public MCP surface easy to read and stable over time.

When to use a plugin instead

Use a feature module when the registrations belong to one server. Use definePlugin(...) when the behavior should be packaged and reused across multiple servers or projects.