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
@@ -155,7 +155,12 @@ async fn main() -> anyhow::Result<()> {
155
155
. start ( ) ;
156
156
157
157
match config. transport {
158
- Transport :: StreamableHttp { proxy, proxy_url, address, port } => {
158
+ Transport :: StreamableHttp {
159
+ proxy,
160
+ proxy_url,
161
+ address,
162
+ port,
163
+ } => {
159
164
if proxy {
160
165
let url = Transport :: proxy_url ( & proxy_url, & address, & port) ;
161
166
let proxy_client = async {
@@ -172,7 +177,9 @@ async fn main() -> anyhow::Result<()> {
172
177
mcp_server. await ?;
173
178
}
174
179
}
175
- _ => { mcp_server. await ?; }
180
+ _ => {
181
+ mcp_server. await ?;
182
+ }
176
183
}
177
184
178
185
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 ;
@@ -86,14 +86,13 @@ impl Transport {
86
86
87
87
pub fn proxy_url ( proxy_url : & Option < Url > , address : & IpAddr , port : & u16 ) -> Url {
88
88
match proxy_url {
89
- Some ( proxy_url) => { proxy_url. clone ( ) }
89
+ Some ( proxy_url) => proxy_url. clone ( ) ,
90
90
None => {
91
91
let address = format ! ( "http://{address}:{port}/mcp" ) ;
92
92
#[ allow( clippy:: unwrap_used) ]
93
93
Url :: parse ( address. as_str ( ) ) . unwrap ( )
94
94
}
95
95
}
96
-
97
96
}
98
97
}
99
98
You can’t perform that action at this time.
0 commit comments