Programmatic Example: Custom MCP Server and Tool Export¶
This example shows how to use the CallPact Rust library (apexe) to:
- Scan CLI tools programmatically
- Convert scan results to apcore ScannedModules
- Build an MCP server from the generated bindings
- Export OpenAI-compatible tool definitions
Run¶
Key APIs demonstrated¶
ScanOrchestrator::new(config).scan(tools, no_cache, depth)CliToolConverter::new().convert_all(tools)YamlOutput::new().write(modules, dir, dry_run)McpServerBuilder::new().bindings_dir(...).build()McpServerBuilder::new().export_openai_tools()