use claude_wrapper::{ClaudeCommand, McpConfigBuilder, QueryCommand};
#[tokio::main]
async fn main() -> claude_wrapper::Result<()> {
let dir = tempfile::tempdir().expect("failed to create temp dir");
let config_path = McpConfigBuilder::new()
.http_server("my-hub", "http://127.0.0.1:9090")
.stdio_server("my-tool", "npx", ["my-mcp-server"])
.write_to(dir.path().join(".mcp.json"))?;
println!("Wrote MCP config to: {}", config_path.display());
println!(
"Contents:\n{}",
std::fs::read_to_string(&config_path).unwrap()
);
let cmd = QueryCommand::new("list available tools")
.model("haiku")
.mcp_config(config_path.to_string_lossy())
.strict_mcp_config()
.allowed_tools(["mcp__my-hub__*"])
.max_turns(1)
.no_session_persistence();
println!(
"\nWould run: claude {}",
ClaudeCommand::args(&cmd).join(" ")
);
Ok(())
}