Skip to main content

Crate mcp_execution_skill

Crate mcp_execution_skill 

Source
Expand description

Skill generation for MCP progressive loading.

This crate provides functionality to generate Claude Code skill files (SKILL.md) from generated progressive loading TypeScript files.

§Architecture

The skill generation flow:

  1. parser - Reads the _meta.json sidecar emitted by codegen
  2. context - Builds structured context from parsed tools
  3. template - Renders Handlebars template with context

§Examples

use mcp_execution_skill::{scan_tools_directory, build_skill_context, ScanError};
use std::path::Path;

let result = scan_tools_directory(Path::new("~/.claude/servers/github")).await?;
let context = build_skill_context("github", &result.tools, None);

Re-exports§

pub use types::GenerateSkillParams;
pub use types::GenerateSkillResult;
pub use types::MAX_SERVER_ID_LENGTH;
pub use types::SaveSkillParams;
pub use types::SaveSkillResult;
pub use types::SkillCategory;
pub use types::SkillMetadata;
pub use types::SkillServerIdError;
pub use types::SkillTool;
pub use types::ToolExample;
pub use types::validate_server_id;

Modules§

types
Type definitions for skill generation.

Structs§

ParsedParameter
A parsed parameter from a tool’s metadata.
ParsedToolFile
Parsed metadata from a server’s generated tool set.
ScanResult
Result of scan_tools_directory: the parsed tools plus any non-fatal drift warnings.

Enums§

OutputPathError
Errors from resolving and confining a skill output path to its base directory.
ScanError
Errors that can occur while scanning a server directory for its _meta.json sidecar.
SkillMetadataError
Errors that can occur while extracting SkillMetadata from a SKILL.md’s YAML frontmatter.
TemplateError
Errors that can occur during template rendering.

Constants§

MAX_FILE_SIZE
Maximum sidecar file size to read in bytes (1MB).
MAX_FRONTMATTER_SIZE
Maximum size of a SKILL.md’s extracted YAML frontmatter block, in bytes.
MAX_TOOL_FILES
Maximum number of tools accepted from a single sidecar (denial-of-service protection).

Functions§

build_skill_context
Build skill generation context from parsed tools.
extract_skill_metadata
Extract skill metadata from SKILL.md content.
render_generation_prompt
Render the skill generation prompt.
render_skill_md
Render SKILL.md content directly from skill context.
resolve_skill_output_path
Resolves a save_skill output path, confining it to base_dir/server_id.
scan_tools_directory
Scan a server directory and read its _meta.json sidecar.