Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
59a9ec6
feat(context_server): Add HTTP and SSE transport implementations
ArturShirokov Sep 22, 2025
08c5949
feat(context_server): Add HTTP/SSE transports and settings
ArturShirokov Sep 23, 2025
c56ead4
wip
ArturShirokov Sep 23, 2025
551ef4b
Solving the errors from the new code.
ArturShirokov Sep 23, 2025
7523fb0
Removed the custom modal, checking if the rest is working.
ArturShirokov Sep 23, 2025
1e9689b
Added agent_ui support for remote server, ignore the fact that the ac…
ArturShirokov Sep 23, 2025
f9d1cc8
Improving the logging.
ArturShirokov Sep 23, 2025
3b2647f
Right now it at least shows connected but isn't recieving the tools.
ArturShirokov Sep 26, 2025
06b18ac
Added proper headers.
ArturShirokov Sep 26, 2025
4b895e7
Added more detailed loggin to client.rs.
ArturShirokov Sep 27, 2025
4e56e1b
First working version.
ArturShirokov Sep 27, 2025
55ddcba
Now using gpui executor instead smol::spawn.
ArturShirokov Sep 30, 2025
6526936
configure MCP modal now uses the same json editor for both local and …
ArturShirokov Oct 5, 2025
6a9a891
Bearer token support is done, tested with github mcp server.
ArturShirokov Oct 5, 2025
7211a67
Removed sse placeholder.
ArturShirokov Oct 5, 2025
411669f
Merge branch 'main' into feature/context-server-transports
ArturShirokov Oct 6, 2025
5ca2645
Merge branch 'main' into feature/context-server-transports
ConradIrwin Nov 11, 2025
977666f
Simplify header handling
ConradIrwin Nov 18, 2025
f766fa2
Merge branch 'main' into feature/context-server-transports
ConradIrwin Nov 18, 2025
46aaa03
tidy up
ConradIrwin Nov 18, 2025
b5cc703
de-de-bug
ConradIrwin Nov 18, 2025
5e0c9fa
Clipy
ConradIrwin Nov 18, 2025
932ed3e
Tidy up UI for creation
ConradIrwin Nov 18, 2025
72f0f16
Remove test
ConradIrwin Nov 18, 2025
987c741
Make test actually test the HTTP transport (a bit)
ConradIrwin Nov 18, 2025
16ce2e5
clippy
ConradIrwin Nov 18, 2025
bd3293b
docs (mvp mcp)
ConradIrwin Nov 18, 2025
180637e
clippy
ConradIrwin Nov 18, 2025
10deac1
is that really prettier?
ConradIrwin Nov 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

81 changes: 51 additions & 30 deletions crates/agent_servers/src/acp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,37 +247,58 @@ impl AgentConnection for AcpConnection {
let default_mode = self.default_mode.clone();
let cwd = cwd.to_path_buf();
let context_server_store = project.read(cx).context_server_store().read(cx);
let mcp_servers = if project.read(cx).is_local() {
context_server_store
.configured_server_ids()
.iter()
.filter_map(|id| {
let configuration = context_server_store.configuration_for_server(id)?;
let command = configuration.command();
Some(acp::McpServer::Stdio {
name: id.0.to_string(),
command: command.path.clone(),
args: command.args.clone(),
env: if let Some(env) = command.env.as_ref() {
env.iter()
.map(|(name, value)| acp::EnvVariable {
name: name.clone(),
value: value.clone(),
meta: None,
})
.collect()
} else {
vec![]
},
let mcp_servers =
if project.read(cx).is_local() {
context_server_store
.configured_server_ids()
.iter()
.filter_map(|id| {
let configuration = context_server_store.configuration_for_server(id)?;
match &*configuration {
project::context_server_store::ContextServerConfiguration::Custom {
command,
..
}
| project::context_server_store::ContextServerConfiguration::Extension {
command,
..
} => Some(acp::McpServer::Stdio {
name: id.0.to_string(),
command: command.path.clone(),
args: command.args.clone(),
env: if let Some(env) = command.env.as_ref() {
env.iter()
.map(|(name, value)| acp::EnvVariable {
name: name.clone(),
value: value.clone(),
meta: None,
})
.collect()
} else {
vec![]
},
}),
project::context_server_store::ContextServerConfiguration::Http {
url,
headers,
} => Some(acp::McpServer::Http {
name: id.0.to_string(),
url: url.to_string(),
headers: headers.iter().map(|(name, value)| acp::HttpHeader {
name: name.clone(),
value: value.clone(),
meta: None,
}).collect(),
}),
}
})
})
.collect()
} else {
// In SSH projects, the external agent is running on the remote
// machine, and currently we only run MCP servers on the local
// machine. So don't pass any MCP servers to the agent in that case.
Vec::new()
};
.collect()
} else {
// In SSH projects, the external agent is running on the remote
// machine, and currently we only run MCP servers on the local
// machine. So don't pass any MCP servers to the agent in that case.
Vec::new()
};

cx.spawn(async move |cx| {
let response = conn
Expand Down
45 changes: 30 additions & 15 deletions crates/agent_ui/src/agent_configuration.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mod add_llm_provider_modal;
mod configure_context_server_modal;
pub mod configure_context_server_modal;
mod configure_context_server_tools_modal;
mod manage_profiles_modal;
mod tool_picker;
Expand Down Expand Up @@ -46,9 +46,8 @@ pub(crate) use configure_context_server_modal::ConfigureContextServerModal;
pub(crate) use configure_context_server_tools_modal::ConfigureContextServerToolsModal;
pub(crate) use manage_profiles_modal::ManageProfilesModal;

use crate::{
AddContextServer,
agent_configuration::add_llm_provider_modal::{AddLlmProviderModal, LlmCompatibleProvider},
use crate::agent_configuration::add_llm_provider_modal::{
AddLlmProviderModal, LlmCompatibleProvider,
};

pub struct AgentConfiguration {
Expand Down Expand Up @@ -553,7 +552,9 @@ impl AgentConfiguration {
move |window, cx| {
Some(ContextMenu::build(window, cx, |menu, _window, _cx| {
menu.entry("Add Custom Server", None, {
|window, cx| window.dispatch_action(AddContextServer.boxed_clone(), cx)
|window, cx| {
window.dispatch_action(crate::AddContextServer.boxed_clone(), cx)
}
})
.entry("Install from Extensions", None, {
|window, cx| {
Expand Down Expand Up @@ -651,7 +652,7 @@ impl AgentConfiguration {
let is_running = matches!(server_status, ContextServerStatus::Running);
let item_id = SharedString::from(context_server_id.0.clone());
// Servers without a configuration can only be provided by extensions.
let provided_by_extension = server_configuration.is_none_or(|config| {
let provided_by_extension = server_configuration.as_ref().is_none_or(|config| {
matches!(
config.as_ref(),
ContextServerConfiguration::Extension { .. }
Expand Down Expand Up @@ -707,7 +708,10 @@ impl AgentConfiguration {
"Server is stopped.",
),
};

let is_remote = server_configuration
.as_ref()
.map(|config| matches!(config.as_ref(), ContextServerConfiguration::Http { .. }))
.unwrap_or(false);
let context_server_configuration_menu = PopoverMenu::new("context-server-config-menu")
.trigger_with_tooltip(
IconButton::new("context-server-config-menu", IconName::Settings)
Expand All @@ -730,14 +734,25 @@ impl AgentConfiguration {
let language_registry = language_registry.clone();
let workspace = workspace.clone();
move |window, cx| {
ConfigureContextServerModal::show_modal_for_existing_server(
context_server_id.clone(),
language_registry.clone(),
workspace.clone(),
window,
cx,
)
.detach_and_log_err(cx);
if is_remote {
crate::agent_configuration::configure_context_server_modal::ConfigureContextServerModal::show_modal_for_existing_server(
context_server_id.clone(),
language_registry.clone(),
workspace.clone(),
window,
cx,
)
.detach();
} else {
ConfigureContextServerModal::show_modal_for_existing_server(
context_server_id.clone(),
language_registry.clone(),
workspace.clone(),
window,
cx,
)
.detach();
}
}
}).when(tool_count > 0, |this| this.entry("View Tools", None, {
let context_server_id = context_server_id.clone();
Expand Down
Loading
Loading