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
@@ -160,7 +160,12 @@ async fn main() -> anyhow::Result<()> {
160
160
. start ( ) ;
161
161
162
162
match config. transport {
163
- Transport :: StreamableHttp { proxy, proxy_url, address, port } => {
163
+ Transport :: StreamableHttp {
164
+ proxy,
165
+ proxy_url,
166
+ address,
167
+ port,
168
+ } => {
164
169
if proxy {
165
170
let url = Transport :: proxy_url ( & proxy_url, & address, & port) ;
166
171
let proxy_client = async {
@@ -177,7 +182,9 @@ async fn main() -> anyhow::Result<()> {
177
182
mcp_server. await ?;
178
183
}
179
184
}
180
- _ => { mcp_server. await ?; }
185
+ _ => {
186
+ mcp_server. await ?;
187
+ }
181
188
}
182
189
183
190
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 ;
@@ -91,14 +91,13 @@ impl Transport {
91
91
92
92
pub fn proxy_url ( proxy_url : & Option < Url > , address : & IpAddr , port : & u16 ) -> Url {
93
93
match proxy_url {
94
- Some ( proxy_url) => { proxy_url. clone ( ) }
94
+ Some ( proxy_url) => proxy_url. clone ( ) ,
95
95
None => {
96
96
let address = format ! ( "http://{address}:{port}/mcp" ) ;
97
97
#[ allow( clippy:: unwrap_used) ]
98
98
Url :: parse ( address. as_str ( ) ) . unwrap ( )
99
99
}
100
100
}
101
-
102
101
}
103
102
}
104
103
You can’t perform that action at this time.
0 commit comments