- define MCP tools with strong TypeScript inference
- validate and coerce input with Zod v4 or plain JSON Schema
- add auth, analytics, rate limiting, caching, and logging without boilerplate
- ship over streamable HTTP or stdio without rebuilding MCP plumbing
Why redop
Most MCP servers start the same way: wire JSON-RPC, validate input, track request state, add auth, then slowly accumulate observability and plugin logic.redop gives you those pieces as framework primitives from the start.
tool(...)defines MCP tools with typed handler inputmiddleware(...)handles request flow control- global hooks observe every tool invocation
- tool-local
before/afterhooks keep per-tool logic close to the tool definePlugin(...)turns reusable patterns into sharable plugins
What the API feels like
The mental model
inputis parsed tool inputctxis shared mutable per-request staterequestis transport metadata like headers, IP, URL, and session id- middleware controls execution flow
- global hooks are for cross-cutting observability
- tool-local hooks are for tool-specific analytics or post-processing