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§
- Batch
Executor - Batch executor with parallel processing support.
- Call
Tool Params - Tool call request.
- Call
Tool Result - Tool call result.
- Client
Capabilities - Client capabilities.
- Client
Id - Client identifier for per-client resource tracking.
- Client
Info - Client info.
- Concurrency
Config - Concurrency limit configuration.
- Concurrency
Guard - Concurrency guard that automatically releases permits on drop.
- Concurrency
Limits - Concurrency limit enforcement using semaphores.
- Initialize
Params - Initialize request params.
- Initialize
Result - Initialize result.
- Json
RpcError - JSON-RPC error.
- Json
RpcRequest - JSON-RPC request.
- Json
RpcResponse - JSON-RPC response.
- Limit
Enforcer - Unified resource limit manager coordinating all limit types.
- List
Resources Result - List resources result.
- List
Tools Result - List tools result.
- McpServer
- HEDL MCP Server.
- McpServer
Config - MCP Server configuration.
- Memory
Aware Cache - Memory-aware cache that tracks actual memory usage.
- PerClient
Rate Limiter - Per-client rate limiter using token bucket algorithm.
- Prompts
Capability - Prompts capability configuration.
- Rate
Limit Config - Rate limit configuration for a client or client pattern.
- Rate
Limiter - Token bucket rate limiter with thread-safe interior mutability.
- Read
Resource Params - Read resource params.
- Read
Resource Result - Read resource result.
- Request
Size Limits - Request size validation limits.
- Resource
- Resource definition.
- Resource
Content - Resource content.
- Resource
Limit Config - Top-level configuration for resource limits.
- Resource
Metrics - Resource limit enforcement metrics.
- Resources
Capability - Resources capability configuration.
- Response
Size Limits - Response size validation limits.
- Roots
Capability - Root URI capability configuration.
- Server
Capabilities - Server capabilities.
- Server
Info - Server info.
- Timeout
Limits - Operation timeout limits.
- Tool
- Tool definition.
- Tools
Capability - Tools capability configuration.
Enums§
- Config
Error - Configuration error types.
- Content
- Content item.
- Error
Category - Error category for client/server/transient classification.
- Error
Severity - Error severity for logging and monitoring.
- McpError
- MCP server error type.
- Resource
Limit Error - Resource limit enforcement error.
Constants§
- SERVER_
NAME - Server name for MCP protocol
- VERSION
- MCP Server version
Type Aliases§
- McpResult
- Result type for MCP operations.