Skip to main content

Module handler

Module handler 

Source
Expand description

MCP request handler implementation

Provides MCP protocol request handling logic, including tool listing, tool invocation, and resource lists.

§Main Structs

  • HandlerCore: Shared core handling logic (internal use)
  • CratesDocsHandler: Standard MCP handler
  • CratesDocsHandlerCore: Core handler (provides more fine-grained control)

§Design Pattern

Uses composition pattern to eliminate code duplication:

  • HandlerCore encapsulates all shared handling logic
  • CratesDocsHandler and CratesDocsHandlerCore delegate to HandlerCore
  • Supports config merging and optional metrics integration

Structs§

CratesDocsHandler
MCP server handler
CratesDocsHandlerCore
Core handler implementation (provides more control)
HandlerConfig
Handler configuration (supports merging)
HandlerCore
Shared core handling logic
ToolExecutionResult
Tool execution result (supports different return type conversions)