Skip to main content

Module protocol

Module protocol 

Source
Expand description

MCP Protocol handlers

This module contains core MCP protocol handlers:

  • handle_initialize: Initialize request handler
  • handle_list_tools: List available tools
  • handle_shutdown: Shutdown the server

These handlers are used by both the library and binary crate.

Structs§

DescribeToolResult
MCP DescribeTool response (for on-demand schema loading)
DescribeToolsResult
MCP DescribeTools (batch) response
InitializeResult
MCP Initialize response payload
ListToolStubsResult
MCP ListTools response with stubs (for lazy loading)
ListToolsResult
MCP ListTools response
McpTool
MCP Tool structure for listing (full schema)
OAuthConfig
OAuth 2.1 Configuration
ProtectedResourceMetadata
Protected Resource Metadata (RFC 9728)
ToolStub
MCP Tool stub for lightweight listing (lazy loading optimization) This reduces token usage by 90-96% by omitting the large inputSchema field

Constants§

SUPPORTED_VERSIONS
Supported MCP protocol versions (in order of preference, latest first)

Functions§

handle_describe_tool
Handle tools/describe request (ADR-024)
handle_describe_tools
Handle tools/describe_batch request (ADR-024)
handle_initialize
Handle initialize request
handle_list_tools
Handle tools/list request
handle_list_tools_with_lazy
Handle tools/list request with lazy loading support (ADR-024)
handle_shutdown
Handle shutdown request