Skip to main content

Crate hedl_mcp

Crate hedl_mcp 

Source
Expand description

HEDL Model Context Protocol (MCP) Server

This crate provides an MCP server that allows AI/LLM systems to interact with HEDL files and the HEDL ecosystem. Key features:

  • Read HEDL files from a directory with graph-aware lookups
  • Query entities by type and ID via the reference registry
  • Validate HEDL input with detailed error reporting
  • Optimize JSON to HEDL for token-efficient context injection
  • Get token statistics comparing HEDL vs JSON representations

Re-exports§

pub use batch::BatchError;
pub use batch::BatchMode;
pub use batch::BatchOperation;
pub use batch::BatchOperationResult;
pub use batch::BatchRequest;
pub use batch::BatchResponse;
pub use batch::BatchSummary;
pub use cache::CacheStats;
pub use cache::OperationCache;
pub use tools::execute_tool;
pub use tools::get_tools;
pub use auth::*;

Modules§

auth
Authentication. Authentication and authorization module for HEDL MCP server.
batch
Batch operations. Batch operation types and execution for MCP server.
cache
Caching. Request-level caching for immutable MCP operations.
tools
MCP tools. HEDL tools for MCP server.

Macros§

convert_from_options
Generate schema for conversion options (from format).
convert_to_options
Generate schema for conversion options (to format).
ditto_arg
Generate schema for ditto optimization argument.
file_write_args
Generate schema for file operation arguments (validate, format, backup).
format_arg
Generate schema for format argument with enum values.
hedl_content_arg
Generate schema for HEDL content argument (with size validation).
pagination_args
Generate schema for pagination arguments (limit, offset).
path_arg
Generate schema for file path argument.
schema_array
Generate a JSON schema object with array type and custom items schema.
schema_bool
Generate a JSON schema object with type “boolean” and optional default.
schema_enum
Generate a JSON schema object with string enum constraints.
schema_integer
Generate a JSON schema object with type “integer” and optional constraints.
schema_options
Generate a JSON schema object for optional format-specific options.
schema_string
Generate a JSON schema object with type “string” and description.
schema_string_array
Generate a JSON schema object with string array type.
tool_schema
Generate a complete tool schema with properties and required fields.
validation_args
Generate schema for validation arguments (strict, lint).

Structs§

BatchExecutor
Batch executor with parallel processing support.
CallToolParams
Tool call request.
CallToolResult
Tool call result.
ClientCapabilities
Client capabilities.
ClientId
Client identifier for per-client resource tracking.
ClientInfo
Client info.
ConcurrencyConfig
Concurrency limit configuration.
ConcurrencyGuard
Concurrency guard that automatically releases permits on drop.
ConcurrencyLimits
Concurrency limit enforcement using semaphores.
InitializeParams
Initialize request params.
InitializeResult
Initialize result.
JsonRpcError
JSON-RPC error.
JsonRpcRequest
JSON-RPC request.
JsonRpcResponse
JSON-RPC response.
LimitEnforcer
Unified resource limit manager coordinating all limit types.
ListResourcesResult
List resources result.
ListToolsResult
List tools result.
McpServer
HEDL MCP Server.
McpServerConfig
MCP Server configuration.
MemoryAwareCache
Memory-aware cache that tracks actual memory usage.
PerClientRateLimiter
Per-client rate limiter using token bucket algorithm.
PromptsCapability
Prompts capability configuration.
RateLimitConfig
Rate limit configuration for a client or client pattern.
RateLimiter
Token bucket rate limiter with thread-safe interior mutability.
ReadResourceParams
Read resource params.
ReadResourceResult
Read resource result.
RequestSizeLimits
Request size validation limits.
Resource
Resource definition.
ResourceContent
Resource content.
ResourceLimitConfig
Top-level configuration for resource limits.
ResourceMetrics
Resource limit enforcement metrics.
ResourcesCapability
Resources capability configuration.
ResponseSizeLimits
Response size validation limits.
RootsCapability
Root URI capability configuration.
ServerCapabilities
Server capabilities.
ServerInfo
Server info.
TimeoutLimits
Operation timeout limits.
Tool
Tool definition.
ToolsCapability
Tools capability configuration.

Enums§

ConfigError
Configuration error types.
Content
Content item.
ErrorCategory
Error category for client/server/transient classification.
ErrorSeverity
Error severity for logging and monitoring.
McpError
MCP server error type.
ResourceLimitError
Resource limit enforcement error.

Constants§

SERVER_NAME
Server name for MCP protocol
VERSION
MCP Server version

Type Aliases§

McpResult
Result type for MCP operations.