use mixtape_cli::{run_cli, SqliteStore};
use mixtape_core::mcp::{McpServerConfig, McpTransport};
use mixtape_core::{Agent, BedrockProvider, ClaudeHaiku4_5, InferenceProfile};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
println!("🎵 Interactive MCP Agent");
println!("========================\n");
let gitmcp_server = McpServerConfig::new(
"gitmcp",
McpTransport::http("https://gitmcp.io/modelcontextprotocol/servers"),
);
let everything_server = McpServerConfig::new(
"everything",
McpTransport::stdio("npx").args(["-y", "@modelcontextprotocol/server-everything"]),
);
println!("Configuring agent with MCP servers...\n");
let provider = BedrockProvider::new(ClaudeHaiku4_5)
.await?
.with_inference_profile(InferenceProfile::US)
.with_retry_callback(|info| {
eprintln!(
" âš Throttled, retry {}/{} in {:?}...",
info.attempt, info.max_attempts, info.delay
);
});
let store = SqliteStore::default_location()?;
let mut agent = Agent::builder()
.provider(provider)
.with_system_prompt(
"You are a helpful assistant with access to MCP tools.\n\
- Use GitMCP tools to search the MCP servers repository\n\
- Use the 'everything' server tools for demos and testing",
)
.with_session_store(store)
.build()
.await?;
println!(" Adding 'gitmcp' server (HTTP)...");
agent.add_mcp_server(gitmcp_server).await?;
println!(" Adding 'everything' server (stdio)...");
agent.add_mcp_server(everything_server).await?;
let tools = agent.list_tools();
println!("\n Available tools ({}):", tools.len());
for tool in &tools {
println!(" - {}", tool.name);
}
println!("\nLaunching interactive REPL...");
println!("Type your messages and press Enter. Use /exit to quit.\n");
println!("Try: \"Search the MCP docs for how to create a stdio server\"");
println!("Try: \"Use the echo tool to say hello\"\n");
run_cli(agent).await?;
Ok(())
}