Skip to content

Commit 46a0cb6

Browse files
authored
Remove backend transport selection (#79)
Signed-off-by: lucarlig <luca.carlig@ibm.com>
1 parent 3f13387 commit 46a0cb6

12 files changed

Lines changed: 9 additions & 54 deletions

File tree

crates/contextforge-data-plane-apis/src/user_store.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,6 @@ use std::collections::HashMap;
33
use schemars::JsonSchema;
44
use serde::{Deserialize, Serialize};
55

6-
#[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, Default)]
7-
pub enum Transport {
8-
#[default]
9-
#[serde(rename = "STREAMABLEHTTP")]
10-
StreamableHttp,
11-
#[serde(rename = "SSE")]
12-
Sse,
13-
#[serde(rename = "STDIO")]
14-
Stdio,
15-
}
16-
176
#[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, Default)]
187
pub enum IntegrationType {
198
#[serde(rename = "REST")]
@@ -27,7 +16,6 @@ pub enum IntegrationType {
2716
pub struct BackendMCPGateway {
2817
pub name: String,
2918
pub url: url::Url,
30-
pub transport: Transport,
3119
/// Header names copied from the downstream request onto the upstream connection.
3220
pub passthrough_headers: Vec<String>,
3321
/// Static headers injected onto the upstream connection (override passthrough).

crates/contextforge-data-plane-lib/src/gateway/identifier_routing.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ mod tests {
182182
"79fabb70-2188-4de8-95ed-dc1e976e14d4": {
183183
"name": "compliance_reference",
184184
"url": "http://upstream:9000/mcp",
185-
"transport": "STREAMABLEHTTP",
186185
"passthrough_headers": [],
187186
"allowed_tool_names": ["get_stats", "echo"],
188187
"tool_name_aliases": {
@@ -214,7 +213,6 @@ mod tests {
214213
"compliance-reference": {
215214
"name": "compliance_reference",
216215
"url": "http://upstream:9000/mcp",
217-
"transport": "STREAMABLEHTTP",
218216
"passthrough_headers": [],
219217
"allowed_tool_names": ["get_stats"],
220218
"allowed_resource_names": [],
@@ -223,7 +221,6 @@ mod tests {
223221
"other": {
224222
"name": "other",
225223
"url": "http://other:9000/mcp",
226-
"transport": "STREAMABLEHTTP",
227224
"passthrough_headers": [],
228225
"allowed_tool_names": [],
229226
"allowed_resource_names": [],

crates/contextforge-data-plane-lib/src/gateway/list_aggregation.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@ mod tests {
266266
backend_id: {
267267
"name": "backend",
268268
"url": "http://upstream:9000/mcp",
269-
"transport": "STREAMABLEHTTP",
270269
"passthrough_headers": [],
271270
"allowed_tool_names": [],
272271
"allowed_resource_names": [],

crates/contextforge-data-plane-lib/src/gateway/mcp_service/initialization.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,6 @@ fn is_protected_header(name: &http::HeaderName) -> bool {
275275

276276
#[cfg(test)]
277277
mod tests {
278-
use contextforge_data_plane_apis::user_store::Transport;
279-
280278
use super::*;
281279

282280
#[test]
@@ -297,7 +295,6 @@ mod tests {
297295
BackendMCPGateway {
298296
name: "b".into(),
299297
url: "https://upstream.example/mcp".parse().unwrap(),
300-
transport: Transport::default(),
301298
passthrough_headers: passthrough.iter().map(|s| (*s).to_owned()).collect(),
302299
add_headers: add.iter().map(|(k, v)| ((*k).to_owned(), (*v).to_owned())).collect(),
303300
remove_headers: remove.iter().map(|s| (*s).to_owned()).collect(),

crates/contextforge-data-plane-lib/tests/gateway_pagination.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::{collections::HashMap, sync::Arc};
44

55
use contextforge_data_plane_apis::{
66
User,
7-
user_store::{BackendMCPGateway, Transport, UserConfig, VirtualHost},
7+
user_store::{BackendMCPGateway, UserConfig, VirtualHost},
88
};
99
use contextforge_data_plane_lib::{Config, Gateway, Result, UserConfigStore, UserConfigStoreType};
1010
use rmcp::{
@@ -24,7 +24,6 @@ fn paginating_backend(port: u16) -> BackendMCPGateway {
2424
BackendMCPGateway {
2525
name: format!("backend-{port}"),
2626
url: format!("http://127.0.0.1:{port}/mcp").parse().expect("valid url"),
27-
transport: Transport::default(),
2827
passthrough_headers: Vec::new(),
2928
add_headers: HashMap::new(),
3029
remove_headers: Vec::new(),

crates/contextforge-data-plane-lib/tests/support/list_tools_gateway.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::{collections::HashMap, net::SocketAddr, sync::Arc};
22

33
use contextforge_data_plane_apis::{
44
User,
5-
user_store::{BackendMCPGateway, Transport, UserConfig, VirtualHost},
5+
user_store::{BackendMCPGateway, UserConfig, VirtualHost},
66
};
77
use contextforge_data_plane_lib::{
88
Config, Gateway, Result, UpstreamConnectionMode, UserConfigStore, UserConfigStoreType,
@@ -215,7 +215,6 @@ fn create_backends(ports: &[u16], with_tls: bool) -> HashMap<String, BackendMCPG
215215
BackendMCPGateway {
216216
name: format!("backend-{port}"),
217217
url,
218-
transport: Transport::default(),
219218
passthrough_headers: Vec::new(),
220219
add_headers: HashMap::default(),
221220
remove_headers: Vec::new(),

crates/contextforge-data-plane-lib/tests/support/plugin_gateway.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::{
66

77
use contextforge_data_plane_apis::{
88
User,
9-
user_store::{BackendMCPGateway, Transport, UserConfig, VirtualHost},
9+
user_store::{BackendMCPGateway, UserConfig, VirtualHost},
1010
};
1111
use contextforge_data_plane_cpex::CpexRuntimeRegistry;
1212
use contextforge_data_plane_lib::{Config, Gateway, UpstreamConnectionMode, UserConfigStore, UserConfigStoreType};
@@ -268,7 +268,6 @@ async fn start_gateway_with_runtime(
268268
BackendMCPGateway {
269269
url: format!("http://127.0.0.1:{backend_port}/mcp").parse().expect("backend URL"),
270270
name: String::new(),
271-
transport: Transport::default(),
272271
passthrough_headers: Vec::new(),
273272
add_headers: HashMap::default(),
274273
remove_headers: Vec::new(),

crates/contextforge-data-plane/tests/secrets_detection_e2e.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use std::{
1616
use contextforge_data_plane_apis::{
1717
User,
1818
runtime_plugin_config::{RUNTIME_PLUGIN_CONFIG_KEY, RUNTIME_PLUGIN_CONFIG_VERSION},
19-
user_store::{BackendMCPGateway, Transport, UserConfig, VirtualHost},
19+
user_store::{BackendMCPGateway, UserConfig, VirtualHost},
2020
};
2121
use http::{HeaderMap, HeaderValue};
2222
use jsonwebtoken::{Algorithm, EncodingKey, Header, encode};
@@ -375,7 +375,6 @@ async fn write_redis_config(redis_port: u16, backend: &RunningBackend) {
375375
BackendMCPGateway {
376376
name: "backend".to_owned(),
377377
url: backend.url.parse().expect("backend URL parses"),
378-
transport: Transport::StreamableHttp,
379378
passthrough_headers: Vec::new(),
380379
add_headers: HashMap::new(),
381380
remove_headers: Vec::new(),

docs/book/src/backend-connections-and-transports.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ architecture roles.
1818
| Upstream backend | Shared `reqwest::Client` plus RMCP `StreamableHttpClientTransport`. | `common.rs`, `gateway/mcp_service/initialization.rs`, and `gateway/backend_transports.rs`. | Open MCP client sessions to configured backend MCP servers. |
1919
| Config store | Redis plain, TLS, or mTLS connection manager. | `common.rs` and `user_config_store/`. | Load `UserConfig` and plugin runtime config from control-plane authored storage. |
2020

21-
The current MCP dataplane only uses streamable HTTP for backend MCP traffic.
22-
`BackendMCPGateway.transport` already has `STREAMABLEHTTP`, `SSE`, and `STDIO`,
23-
but upstream routing does not branch on that field yet.
21+
The MCP dataplane always uses Streamable HTTP for backend MCP traffic.
22+
`BackendMCPGateway` has no transport selector, and upstream routing always
23+
builds `StreamableHttpClientTransport`.
2424

2525
## Downstream Listeners
2626

@@ -126,7 +126,6 @@ but it is not the final shape for every backend-specific decision.
126126
| Downstream TLS certificate | Process config. | Process config. It belongs to the gateway listener. |
127127
| Upstream trust bundle and mTLS identity | Process config. | Runtime config per backend or referenced secret material. |
128128
| Backend auth headers | Delegated to `passthrough_headers` / `add_headers` / `remove_headers` in `BackendMCPGateway`. ||
129-
| Backend transport type | Model field exists, not routed yet. | Runtime config per backend. |
130129
| Header pass-through policy | Implemented via `passthrough_headers`, `add_headers`, `remove_headers` on `BackendMCPGateway`. Headers are session-scoped (snapshotted at initialize); request-scoped propagation is future work. ||
131130

132131
The boundary to preserve is simple: listener code should not know Redis schema,

docs/book/src/running-the-gateway.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ curl --silent --show-error --request POST \
123123
"gateway-one": {
124124
"name": "gateway-one",
125125
"url": "http://127.0.0.1:5555/mcp",
126-
"transport": "STREAMABLEHTTP",
127126
"passthrough_headers": [],
128127
"allowed_tool_names": [],
129128
"allowed_resource_names": [],
@@ -132,7 +131,6 @@ curl --silent --show-error --request POST \
132131
"gateway-two": {
133132
"name": "gateway-two",
134133
"url": "http://127.0.0.1:5556/mcp",
135-
"transport": "STREAMABLEHTTP",
136134
"passthrough_headers": [],
137135
"allowed_tool_names": [],
138136
"allowed_resource_names": [],

0 commit comments

Comments
 (0)