Skip to main content
Redop is a Bun-native TypeScript framework for building MCP servers with typed tools, schema inference, middleware, lifecycle hooks, and reusable plugins. Use it when you want to:
  • 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 input
  • middleware(...) handles request flow control
  • global hooks observe every tool invocation
  • tool-local before / after hooks keep per-tool logic close to the tool
  • definePlugin(...) turns reusable patterns into sharable plugins

What the API feels like

import { Redop } from "redop";
import { z } from "zod";

new Redop({
  name: "my-mcp-server",
  title: "My MCP Server",
  version: "1.0.0",
  description: "Searches and retrieves docs.",
  instructions: "Call search before fetch. Prefer narrow queries.",
  websiteUrl: "https://example.com/docs",
})
  .tool("search", {
    description: "Search docs",
    input: z.object({
      query: z.string().min(1),
    }),
    handler: ({ input }) => {
      return { query: input.query, results: [] };
    },
  })
  .listen({ port: 3000 });

The mental model

  • input is parsed tool input
  • ctx is shared mutable per-request state
  • request is 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

Start here