# Redop ## Docs - [Middleware vs Hooks vs Plugins](https://redop.useagents.site/docs/concepts/composition.md): Choose the right composition primitive in Redop instead of forcing everything into handlers. - [Lifecycle and Execution Order](https://redop.useagents.site/docs/concepts/lifecycle.md): Understand the order Redop uses to derive context, transform input, run hooks, execute middleware, call handlers, and schedule post-response work. - [Mental Model](https://redop.useagents.site/docs/concepts/mental-model.md): Understand the core Redop building blocks before you dive into middleware, resources, or transports. - [Redop vs xmcp](https://redop.useagents.site/docs/concepts/redop-vs-xmcp.md): Compare Redop and xmcp so you can choose the MCP framework that fits your team, codebase structure, and deployment style. - [Resources and Prompts](https://redop.useagents.site/docs/concepts/resources-prompts.md): Understand when a problem should be modeled as a tool, a resource, or a prompt in Redop. - [Schemas and Adapters](https://redop.useagents.site/docs/concepts/schemas.md): Understand how Redop turns one input schema into both runtime parsing and MCP discovery metadata. - [Transport Model and Compatibility](https://redop.useagents.site/docs/concepts/transports.md): Understand how Redop chooses transports, what HTTP and stdio expose, and what the current HTTP transport optimizes for. - [Configuration](https://redop.useagents.site/docs/documentation/configuration.md): Configure a Redop instance with serverInfo, capabilities, icons, instructions, and the metadata returned during MCP initialize. - [Error Handling](https://redop.useagents.site/docs/documentation/error-handling.md): Learn how Redop resolves thrown errors for MCP clients, when to throw in middleware or handlers, and what `onError(...)` can observe. - [Listening and Transports](https://redop.useagents.site/docs/documentation/listening-and-transports.md): Choose between HTTP and stdio in Redop, understand how listen() picks a transport, and use the right startup shape for local or hosted servers. - [onAfterHandle](https://redop.useagents.site/docs/documentation/on-after-handle.md): Understand when to use onAfterHandle for shared post-handler logic in a Redop server. - [onAfterResponse](https://redop.useagents.site/docs/documentation/on-after-response.md): Use onAfterResponse for shared best-effort work that should run after Redop has already written the response. - [onBeforeHandle](https://redop.useagents.site/docs/documentation/on-before-handle.md): Understand when to use onBeforeHandle for shared pre-handler logic in a Redop server. - [Plugins](https://redop.useagents.site/docs/documentation/plugins.md): Understand how Redop plugins work, how they pass request data through context, and how to build reusable plugins with middleware, hooks, tools, resources, and prompts. - [Prompts](https://redop.useagents.site/docs/documentation/prompts.md): Understand when to use Redop prompts, how prompt arguments work, and how Redop resolves arguments and argumentsSchema. - [Resources](https://redop.useagents.site/docs/documentation/resources.md): Understand what Redop resources are, when to use them, and how static and template resources work. - [Tools](https://redop.useagents.site/docs/documentation/tools.md): Understand how to design Redop tools, including schemas, annotations, hooks, middleware, and when to use each tool hint. - [Validation](https://redop.useagents.site/docs/documentation/validation.md): Validate tool input and describe tool output in Redop with Zod, Standard Schema libraries, TypeBox, and plain JSON Schema. - [Basic Server Example](https://redop.useagents.site/docs/examples/basic.md): Start from the smallest Redop HTTP server with a health tool and a simple typed echo tool. - [Examples Overview](https://redop.useagents.site/docs/examples/index.md): Browse runnable Redop examples for a minimal server, feature-module composition, typed Zod tools, and plugin composition. - [Module Composition Example](https://redop.useagents.site/docs/examples/modules.md): See how to organize a Redop server into feature modules and compose them with use instead of relying on implicit grouping. - [Plugins and Middleware Example](https://redop.useagents.site/docs/examples/plugins.md): Learn how to compose Redop plugins, middleware, auth helpers, and request context in one server. - [Zod Example](https://redop.useagents.site/docs/examples/with-zod.md): See how Redop infers typed handler input from Zod schemas while exporting MCP tool schemas. - [Agent Skills](https://redop.useagents.site/docs/getting-started/agent-skills.md): Install the Redop Agent Skill so AI assistants can explain Redop, help design servers, and guide implementation with the framework's concepts and patterns. - [Connect over HTTP](https://redop.useagents.site/docs/getting-started/connect-http.md): Run a Redop server over HTTP and verify that your MCP endpoint responds at /mcp. - [Connect over stdio](https://redop.useagents.site/docs/getting-started/connect-stdio.md): Run a Redop server over stdio for local MCP host integrations. - [Create a Project with create-redop-app](https://redop.useagents.site/docs/getting-started/create-redop-app.md): Scaffold a Bun-first Redop app with transport, schema, component, and deploy presets. - [Your First Server](https://redop.useagents.site/docs/getting-started/first-server.md): Build and run a minimal Redop server before you add schemas, middleware, resources, prompts, or auth. - [Installation](https://redop.useagents.site/docs/getting-started/installation.md): Install Redop in an existing Bun project or scaffold a starter MCP server with create-redop-app. - [Verify with Local Clients](https://redop.useagents.site/docs/getting-started/verify-clients.md): Check that your Redop server is reachable from Inspector, Cursor, or other local MCP clients. - [Add Request Context with derive](https://redop.useagents.site/docs/guides/add-request-context.md): Use derive to attach reusable request data to ctx before hooks, middleware, and handlers run. - [API Key Authentication](https://redop.useagents.site/docs/guides/authentication/api-key.md): Protect a Redop HTTP server with the built-in apiKey plugin. - [JWT Authentication](https://redop.useagents.site/docs/guides/authentication/jwt.md): Validate bearer JWTs with the built-in jwt plugin. - [OAuth Authentication](https://redop.useagents.site/docs/guides/authentication/oauth.md): Validate OAuth bearer tokens with issuer discovery and JWKS support. - [Build a Plugin or Middleware](https://redop.useagents.site/docs/guides/build-plugin-or-middleware.md): Create your own middleware or package reusable Redop behavior as a plugin. - [Build Plugins](https://redop.useagents.site/docs/guides/build-plugins.md): Build reusable Redop plugins that package hooks, middleware, tools, resources, and prompts into one unit. - [Choose Between HTTP and stdio](https://redop.useagents.site/docs/guides/choose-transport.md): Decide whether your Redop server should run over HTTP or stdio. - [Compose Features with use](https://redop.useagents.site/docs/guides/compose-features-with-use.md): Organize a larger Redop server by giving each feature folder its own Redop module and composing them in the main server with use. - [Use create-redop-app Flags and Presets](https://redop.useagents.site/docs/guides/create-redop-app-presets.md): Choose the right transport and deploy presets when you generate a Redop starter app. - [Debug HTTP Connections and Sessions](https://redop.useagents.site/docs/guides/debug-http.md): Use the built-in debug logs and the current HTTP transport behavior to troubleshoot client connections. - [Deploy with Docker](https://redop.useagents.site/docs/guides/deploy/docker.md): Run Redop in Docker with either a standard single-project Dockerfile or an advanced monorepo production image. - [Deploy to Fly.io](https://redop.useagents.site/docs/guides/deploy/fly-io.md): Deploy a Docker-based Redop HTTP server to Fly.io and verify the MCP endpoint. - [Deploy to Production](https://redop.useagents.site/docs/guides/deploy/index.md): Choose the right production deployment shape for a Redop HTTP server and then follow a platform-specific guide. - [Deploy to Railway](https://redop.useagents.site/docs/guides/deploy/railway.md): Deploy a long-running Redop HTTP server to Railway with Bun and verify the MCP endpoint. - [Deploy to Unkey](https://redop.useagents.site/docs/guides/deploy/unkey.md): Deploy a Docker-based Redop HTTP server to Unkey Deploy, configure production and preview environments, and verify the MCP endpoint. - [Deploy to Vercel](https://redop.useagents.site/docs/guides/deploy/vercel.md): Understand the current Vercel caveat for Redop’s built-in HTTP transport and when a custom Vercel path might still make sense. - [Logger Plugin](https://redop.useagents.site/docs/guides/logger-plugin.md): Add structured lifecycle logs with the built-in logger plugin. - [Send Resource Update Notifications](https://redop.useagents.site/docs/guides/notify-resource-changes.md): Notify subscribed clients when a resource changes with notifyResourceChanged. - [Register Prompts](https://redop.useagents.site/docs/guides/register-prompts.md): Register Redop prompts with arguments or argumentsSchema and understand how both fields behave together. - [Register Resources](https://redop.useagents.site/docs/guides/register-resources.md): Add static and template resources to a Redop server with resource. - [Use Built-In Plugins](https://redop.useagents.site/docs/guides/use-built-in-plugins.md): Start with Redop's built-in logger and auth plugins before building your own. - [Welcome to Redop](https://redop.useagents.site/docs/index.md): Redop is a Bun-first TypeScript framework for building production MCP servers with tools, resources, prompts, plugins, hooks, and HTTP or stdio transports. - [PostHog Error Capturing](https://redop.useagents.site/docs/plugins/error-capturing/posthog.md): Capture Redop server errors in PostHog with posthog-node, exception autocapture, and manual error reporting. - [Evlog](https://redop.useagents.site/docs/plugins/evlog.md): Use @redopjs/evlog to emit one wide event per Redop tool, resource, or prompt. - [Unkey Ratelimit](https://redop.useagents.site/docs/plugins/rate-limiting/unkey.md): Protect a Redop server with Unkey's global rate-limiting SDK using namespaces, per-identifier limits, and 429 responses. - [Upstash Ratelimit](https://redop.useagents.site/docs/plugins/rate-limiting/upstash.md): Protect a Redop server with Upstash Ratelimit using Redis-backed sliding-window limits and standard 429 responses. - [Sentry for Bun](https://redop.useagents.site/docs/plugins/sentry.md): Learn how to set up Sentry in a Bun-hosted Redop server and capture your first errors. - [Built-In Plugins](https://redop.useagents.site/docs/reference/built-in-plugins.md): Reference for the built-in plugins exported by @redopjs/redop. - [create-redop-app CLI Reference](https://redop.useagents.site/docs/reference/create-redop-app-cli.md): Reference for the create-redop-app command, flags, interactive prompts, and generated files. - [HTTP Transport Behavior](https://redop.useagents.site/docs/reference/http-transport.md): Reference for the current Redop HTTP transport routes, defaults, protocol support, and implementation details. - [listen() Options](https://redop.useagents.site/docs/reference/listen-options.md): Reference for the Redop listen() overloads and transport options for HTTP and stdio. - [Prompt Definition](https://redop.useagents.site/docs/reference/prompt-definition.md): Reference for Redop prompt fields, prompt argument behavior, argumentsSchema, and how both fields are resolved together. - [Redop API Reference](https://redop.useagents.site/docs/reference/redop.md): Reference for the Redop constructor, constructor options, chainable methods, and introspection helpers. - [Request, Context, and Handler Events](https://redop.useagents.site/docs/reference/request-context.md): Reference for ToolRequest, Context, and the event objects Redop passes to handlers, middleware, and hooks. - [Resource Definition](https://redop.useagents.site/docs/reference/resource-definition.md): Reference for resource definitions, resource contents, and template URI behavior in Redop. - [Schema Adapters](https://redop.useagents.site/docs/reference/schema-adapters.md): Reference for Redop schema auto-detection and the supported schema styles for tool input and output schemas. - [Tool Definition](https://redop.useagents.site/docs/reference/tool-definition.md): Reference for Redop tool definitions, including schemas, annotations, hooks, middleware, and task hints. - [Add Auth to an HTTP Server](https://redop.useagents.site/docs/tutorials/add-http-auth.md): Protect an HTTP Redop server with the built-in apiKey plugin. - [Add Middleware and Hooks](https://redop.useagents.site/docs/tutorials/add-middleware-hooks.md): Add request-aware middleware and lifecycle hooks to a Redop server without changing the tool API. - [Add Typed Input with Zod](https://redop.useagents.site/docs/tutorials/add-zod-tool.md): Add a Zod schema to a Redop tool so handler input is validated and inferred. - [Build a Minimal HTTP Server](https://redop.useagents.site/docs/tutorials/build-http-server.md): Learn Redop by building a small HTTP MCP server with two tools and verifying it over /mcp. - [Scaffold and Ship a Starter App](https://redop.useagents.site/docs/tutorials/scaffold-and-ship.md): Use create-redop-app to generate a starter, run it locally, and choose a deploy path. ## OpenAPI Specs - [openapi](https://redop.useagents.site/docs/api-reference/openapi.json)