mcp-execution-skill
Skill generation for MCP progressive loading. Generates Claude Code skill files (SKILL.md) from TypeScript tool files.
Installation
Or add to your Cargo.toml:
[]
= "0.6"
[!IMPORTANT] Requires Rust 1.89 or later.
Usage
use ;
use Path;
async
[!TIP] For optimal results, use the MCP server (
mcp-execution-server) for skill generation. It leverages LLM capabilities to summarize tool descriptions, resulting in more concise skill files.
Features
- JSDoc Parsing - Extract metadata (
@tool,@server,@category,@keywords) from TypeScript files - Context Building - Structure tool information into categories for skill generation
- Template Rendering - Generate prompts using pre-compiled Handlebars templates
- Async Directory Scanning - Non-blocking file operations via
tokio::fs
Architecture
TypeScript Files → Parser → Context Builder → Template Renderer → SKILL.md Prompt
- Parser (
parser.rs) - Extracts JSDoc metadata using pre-compiled regexes - Context Builder (
context.rs) - Groups tools by category, generates examples - Template Renderer (
template.rs) - Renders Handlebars prompt template
Examples
Parse a Single Tool File
use parse_tool_file;
let content = r#"
/**
* @tool create_issue
* @server github
* @category issues
* @keywords create,issue,new
* @description Create a new GitHub issue
*/
"#;
let parsed = parse_tool_file?;
assert_eq!;
assert_eq!;
Build Context with Hints
use build_skill_context;
// Add use-case hints for better context
let hints = vec!;
let context = build_skill_context;
println!;
Types
| Type | Description |
|---|---|
ParsedToolFile |
Metadata extracted from TypeScript file |
ParsedParameter |
TypeScript parameter information |
SkillCategory |
Tools grouped by category |
SkillTool |
Tool metadata for skill generation |
GenerateSkillResult |
Complete context for SKILL.md generation |
Error Handling
use ;
// ParseError - JSDoc parsing failures
// ScanError - Directory scanning issues (permissions, limits)
Security
[!NOTE] Built-in DoS protection for untrusted input.
- File Size Limit - Max 1MB per file
- File Count Limit - Max 500 files per directory
- Path Validation - Only scans
.tsfiles, excludes_runtime/
Related Crates
This crate is part of the mcp-execution workspace:
mcp-execution-core- Foundation types and traitsmcp-execution-codegen- TypeScript code generationmcp-execution-files- Virtual filesystemmcp-execution-cli- CLI withskillcommand
MSRV Policy
Minimum Supported Rust Version: 1.89
MSRV increases are considered minor version bumps.
License
Licensed under either of Apache License 2.0 or MIT license at your option.