Skip to main content

Module generator

Module generator 

Source
Expand description

Progressive loading code generator.

Generates TypeScript files for progressive loading where each tool is in a separate file, enabling Claude Code to load only what it needs.

§Examples

use mcp_execution_codegen::progressive::ProgressiveGenerator;
use mcp_execution_introspector::{Introspector, ServerInfo};
use mcp_execution_core::{ServerId, ServerConfig};

let mut introspector = Introspector::new();
let server_id = ServerId::new("github").unwrap();
let config = ServerConfig::builder().command("/path/to/server".to_string()).build()?;
let info = introspector.discover_server(server_id, &config).await?;

let generator = ProgressiveGenerator::new()?;
let code = generator.generate(&info)?;

// Generated files:
// - index.ts (re-exports)
// - createIssue.ts
// - updateIssue.ts
// - ...
// - _runtime/mcp-bridge.ts
println!("Generated {} files", code.file_count());

Structs§

ProgressiveGenerator
Generator for progressive loading TypeScript files.

Constants§

MAX_GENERATED_BYTES
Maximum total bytes across every file in a single generate/generate_with_categories call’s output (denial-of-service protection, CWE-400).
MAX_GENERATED_FILES
Maximum number of files a single generate/generate_with_categories call will produce (denial-of-service protection, CWE-400).