Skip to main content
Redop is the main class for building MCP servers. Use the constructor for server metadata and top-level behavior, then register tools, resources, prompts, hooks, middleware, and plugins.

Constructor

Constructor options

serverInfo fields

Icon shape

icons accepts an array of objects with this shape:
Notes:
  • src is required and should usually be an https: URL or data: URI.
  • mimeType is optional, but common values are image/png, image/jpeg, image/jpg, image/svg+xml, and image/webp.
  • sizes supports values like ["48x48"], ["48x48", "96x96"], or ["any"] for scalable icons.
  • theme can be "light" or "dark".
  • Clients should treat icon URLs and bytes as untrusted input and apply normal fetch/render safety checks.

Deprecated top-level fields

Redop still accepts top-level name, title, version, description, icons, websiteUrl, and instructions, but they are deprecated. Put new docs and new app code under serverInfo.

Main methods

Introspection

  • toolNames returns registered tool names
  • resourceUris returns registered resource URIs
  • promptNames returns registered prompt names
  • getTool(name) returns the resolved tool metadata
  • getResource(uri) returns the resolved resource metadata
  • getPrompt(name) returns the resolved prompt metadata
  • serverInfo returns the MCP server identity used during initialize

Composition pattern

Use .use(...) as the main way to compose a larger server. In practice, that usually means:
  • create one Redop instance per feature folder
  • register that feature’s tools, resources, prompts, hooks, or middleware there
  • import those modules into the root server
  • attach them with .use(...)