@@ -28,7 +28,6 @@ use is_container::is_container;
2828use rmcp:: transport:: stdio;
2929use rmcp:: transport:: streamable_http_server:: session:: never:: NeverSessionManager ;
3030use rmcp:: { RoleServer , Service , ServiceExt } ;
31- use std:: io:: ErrorKind ;
3231use std:: net:: { IpAddr , Ipv4Addr , SocketAddr } ;
3332use std:: path:: PathBuf ;
3433use std:: sync:: Arc ;
@@ -45,6 +44,7 @@ impl Cli {
4544}
4645
4746pub async fn run_stdio ( cmd : StdioCommand ) -> anyhow:: Result < ( ) > {
47+ tracing:: info!( "Starting stdio server" ) ;
4848 let handler = setup_services ( & cmd. config ) . await ?;
4949 let service = handler. serve ( stdio ( ) ) . await . inspect_err ( |e| {
5050 tracing:: error!( "serving error: {:?}" , e) ;
@@ -64,9 +64,9 @@ pub async fn run_http(cmd: HttpCommand) -> anyhow::Result<()> {
6464 let address: SocketAddr = if let Some ( addr) = cmd. address {
6565 addr
6666 } else if is_container ( ) {
67- SocketAddr :: new ( IpAddr :: V4 ( Ipv4Addr :: UNSPECIFIED ) , 8000 )
67+ SocketAddr :: new ( IpAddr :: V4 ( Ipv4Addr :: UNSPECIFIED ) , 8080 )
6868 } else {
69- SocketAddr :: new ( IpAddr :: V4 ( Ipv4Addr :: LOCALHOST ) , 8000 )
69+ SocketAddr :: new ( IpAddr :: V4 ( Ipv4Addr :: LOCALHOST ) , 8080 )
7070 } ;
7171
7272 let ct = HttpProtocol :: serve_with_config (
@@ -82,18 +82,15 @@ pub async fn run_http(cmd: HttpCommand) -> anyhow::Result<()> {
8282 )
8383 . await ?;
8484
85+ tracing:: info!( "Starting http server at address {}" , address) ;
86+
8587 tokio:: signal:: ctrl_c ( ) . await ?;
8688 ct. cancel ( ) ;
8789 Ok ( ( ) )
8890}
8991
9092pub async fn setup_services ( config : & Option < PathBuf > ) -> anyhow:: Result < impl Service < RoleServer > + Clone > {
91- // Read config file and expand variables, also accepting .env files
92- match dotenvy:: dotenv ( ) {
93- Err ( dotenvy:: Error :: Io ( io_err) ) if io_err. kind ( ) == ErrorKind :: NotFound => { }
94- Err ( err) => return Err ( err) ?,
95- Ok ( _) => { }
96- }
93+ // Read config file and expand variables
9794
9895 let config = if let Some ( path) = config {
9996 std:: fs:: read_to_string ( path) ?
0 commit comments