File tree Expand file tree Collapse file tree 4 files changed +17
-9
lines changed Expand file tree Collapse file tree 4 files changed +17
-9
lines changed Original file line number Diff line number Diff line change 1
- use clap:: Parser ;
2
1
use apollo_mcp_proxy:: client:: start_proxy_client;
2
+ use clap:: Parser ;
3
3
use std:: error:: Error ;
4
4
use tracing_appender:: rolling:: { RollingFileAppender , Rotation } ;
5
5
use tracing_subscriber:: layer:: SubscriberExt ;
Original file line number Diff line number Diff line change @@ -262,7 +262,9 @@ impl ServerHandler for ProxyServer {
262
262
}
263
263
Err ( err) => {
264
264
error ! ( "[Proxy] Error calling tool: {:?}" , err) ;
265
- Ok ( CallToolResult :: error ( vec ! [ Content :: text( format!( "Error: {err}" ) ) ] ) )
265
+ Ok ( CallToolResult :: error ( vec ! [ Content :: text( format!(
266
+ "Error: {err}"
267
+ ) ) ] ) )
266
268
}
267
269
}
268
270
}
Original file line number Diff line number Diff line change 1
1
use std:: path:: PathBuf ;
2
2
3
+ use apollo_mcp_proxy:: client:: start_proxy_client;
3
4
use apollo_mcp_registry:: platform_api:: operation_collections:: collection_poller:: CollectionSource ;
4
5
use apollo_mcp_registry:: uplink:: persisted_queries:: ManifestSource ;
5
6
use apollo_mcp_registry:: uplink:: schema:: SchemaSource ;
@@ -11,11 +12,10 @@ use apollo_mcp_server::server::Transport;
11
12
use clap:: Parser ;
12
13
use clap:: builder:: Styles ;
13
14
use clap:: builder:: styling:: { AnsiColor , Effects } ;
14
- use tokio:: signal;
15
15
use runtime:: IdOrDefault ;
16
+ use tokio:: signal;
16
17
use tracing:: { Level , info, warn} ;
17
18
use tracing_subscriber:: EnvFilter ;
18
- use apollo_mcp_proxy:: client:: start_proxy_client;
19
19
20
20
mod runtime;
21
21
@@ -162,7 +162,12 @@ async fn main() -> anyhow::Result<()> {
162
162
. start ( ) ;
163
163
164
164
match config. transport {
165
- Transport :: StreamableHttp { proxy, proxy_url, address, port } => {
165
+ Transport :: StreamableHttp {
166
+ proxy,
167
+ proxy_url,
168
+ address,
169
+ port,
170
+ } => {
166
171
if proxy {
167
172
let url = Transport :: proxy_url ( & proxy_url, & address, & port) ;
168
173
let proxy_client = async {
@@ -179,7 +184,9 @@ async fn main() -> anyhow::Result<()> {
179
184
mcp_server. await ?;
180
185
}
181
186
}
182
- _ => { mcp_server. await ?; }
187
+ _ => {
188
+ mcp_server. await ?;
189
+ }
183
190
}
184
191
185
192
Ok ( ( ) )
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ use bon::bon;
5
5
use reqwest:: header:: { CONTENT_TYPE , HeaderMap , HeaderValue } ;
6
6
use schemars:: JsonSchema ;
7
7
use serde:: Deserialize ;
8
- use url:: { Url } ;
8
+ use url:: Url ;
9
9
10
10
use crate :: custom_scalar_map:: CustomScalarMap ;
11
11
use crate :: errors:: ServerError ;
@@ -93,14 +93,13 @@ impl Transport {
93
93
94
94
pub fn proxy_url ( proxy_url : & Option < Url > , address : & IpAddr , port : & u16 ) -> Url {
95
95
match proxy_url {
96
- Some ( proxy_url) => { proxy_url. clone ( ) }
96
+ Some ( proxy_url) => proxy_url. clone ( ) ,
97
97
None => {
98
98
let address = format ! ( "http://{address}:{port}/mcp" ) ;
99
99
#[ allow( clippy:: unwrap_used) ]
100
100
Url :: parse ( address. as_str ( ) ) . unwrap ( )
101
101
}
102
102
}
103
-
104
103
}
105
104
}
106
105
You can’t perform that action at this time.
0 commit comments