Use a plugin when you want one reusable unit that can be attached to multiple Redop servers.Documentation Index
Fetch the complete documentation index at: https://redop.useagents.site/docs/llms.txt
Use this file to discover all available pages before exploring further.
What a plugin should own
A good plugin owns one clear concern such as:- auth
- logging
- timing and analytics
- resource registration
- a domain-specific bundle of tools and prompts
onAfterResponse(...). Use onAfterHandle(...) only when the plugin still needs to inspect or replace a successful result before the client receives it.
Start with definePlugin(...)
definePlugin(...) returns a factory. Call that factory and pass the result to .use(...).
Use the plugin in a server
What a plugin can register
Insidesetup(), return a Redop instance that registers any combination of:
- middleware
- lifecycle hooks
- tools
- resources
- prompts
Build a plugin with tools and prompts
Add plugin options
Use plugin options when consumers need to configure behavior.Practical rules
- keep plugin ownership narrow
- avoid hidden side effects outside the concern the plugin owns
- use middleware for request flow control
- use hooks for observation and post-processing
- use tools, resources, and prompts only when the plugin should extend the MCP surface
Choose plugin vs middleware
Use middleware when:- the behavior only wraps execution
- you do not need packaging or reuse across servers
- the behavior should be reused across projects
- you need multiple registrations in one package
- you want a stable composition unit for teams or publishing