diff --git a/Cargo.toml b/Cargo.toml index ef7d38c..2d9c6c6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,12 +45,3 @@ clap = { version = "4.4", features = ["derive"] } [[bin]] name = "cratedocs" path = "src/bin/cratedocs.rs" - -# Keep existing binaries for backward compatibility -[[bin]] -name = "stdio-server" -path = "src/bin/stdio_server.rs" - -[[bin]] -name = "http-sse-server" -path = "src/bin/sse_server.rs" diff --git a/src/bin/sse_server.rs b/src/bin/sse_server.rs deleted file mode 100644 index 366179a..0000000 --- a/src/bin/sse_server.rs +++ /dev/null @@ -1,31 +0,0 @@ -use anyhow::Result; -use std::net::SocketAddr; -use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt}; -use cratedocs_mcp::transport::http_sse_server::App; - -const BIND_ADDRESS: &str = "127.0.0.1:8080"; - -#[tokio::main] -async fn main() -> Result<()> { - // Setup tracing - tracing_subscriber::registry() - .with( - tracing_subscriber::EnvFilter::try_from_default_env() - .unwrap_or_else(|_| format!("info,{}=debug", env!("CARGO_CRATE_NAME")).into()), - ) - .with(tracing_subscriber::fmt::layer()) - .init(); - - // Parse socket address - let addr: SocketAddr = BIND_ADDRESS.parse()?; - let listener = tokio::net::TcpListener::bind(addr).await?; - - tracing::debug!("Rust Documentation Server listening on {}", listener.local_addr()?); - tracing::info!("Access the Rust Documentation Server at http://{}/sse", BIND_ADDRESS); - - // Create app and run server - let app = App::new(); - axum::serve(listener, app.router()).await?; - - Ok(()) -} \ No newline at end of file diff --git a/src/bin/stdio_server.rs b/src/bin/stdio_server.rs deleted file mode 100644 index a82da50..0000000 --- a/src/bin/stdio_server.rs +++ /dev/null @@ -1,35 +0,0 @@ -use anyhow::Result; -use mcp_server::router::RouterService; -use mcp_server::{ByteTransport, Server}; -use cratedocs_mcp::tools::DocRouter; -use tokio::io::{stdin, stdout}; -use tracing_appender::rolling::{RollingFileAppender, Rotation}; -use tracing_subscriber::{self, EnvFilter}; - -#[tokio::main] -async fn main() -> Result<()> { - // Set up file appender for logging - let file_appender = RollingFileAppender::new(Rotation::DAILY, "logs", "doc-server.log"); - - // Initialize the tracing subscriber with file and stdout logging - tracing_subscriber::fmt() - .with_env_filter(EnvFilter::from_default_env().add_directive(tracing::Level::INFO.into())) - .with_writer(file_appender) - .with_target(false) - .with_thread_ids(true) - .with_file(true) - .with_line_number(true) - .init(); - - tracing::info!("Starting MCP documentation server"); - - // Create an instance of our documentation router - let router = RouterService(DocRouter::new()); - - // Create and run the server - let server = Server::new(router); - let transport = ByteTransport::new(stdin(), stdout()); - - tracing::info!("Documentation server initialized and ready to handle requests"); - Ok(server.run(transport).await?) -} \ No newline at end of file