Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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.

16 changes: 14 additions & 2 deletions crates/goose-cli/src/commands/mcp.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use anyhow::{anyhow, Result};
use goose_mcp::{
AutoVisualiserRouter, ComputerControllerRouter, DeveloperRouter, MemoryRouter, TutorialRouter,
AutoVisualiserRouter, ComputerControllerRouter, DeveloperServer, MemoryRouter, TutorialRouter,
};
use mcp_server::router::RouterService;
use mcp_server::{BoundedService, ByteTransport, Server};
use rmcp::{transport::stdio, ServiceExt};
use tokio::io::{stdin, stdout};

use std::sync::Arc;
Expand All @@ -27,8 +28,19 @@ pub async fn run_server(name: &str) -> Result<()> {

tracing::info!("Starting MCP server");

if name == "developer" {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems a lot uglier than before...

let service = DeveloperServer::new()
.serve(stdio())
.await
.inspect_err(|e| {
tracing::error!("serving error: {:?}", e);
})?;

service.waiting().await?;
return Ok(());
}

let router: Option<Box<dyn BoundedService>> = match name {
"developer" => Some(Box::new(RouterService(DeveloperRouter::new()))),
"computercontroller" => Some(Box::new(RouterService(ComputerControllerRouter::new()))),
"autovisualiser" => Some(Box::new(RouterService(AutoVisualiserRouter::new()))),
"memory" => Some(Box::new(RouterService(MemoryRouter::new()))),
Expand Down
3 changes: 2 additions & 1 deletion crates/goose-mcp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ workspace = true
[dependencies]
mcp-core = { path = "../mcp-core" }
mcp-server = { path = "../mcp-server" }
rmcp = { workspace = true }
rmcp = { version = "0.6.0", features = ["server", "client", "transport-io", "macros"] }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be set at parent, not here

anyhow = "1.0.94"
tokio = { version = "1", features = ["full"] }
tokio-stream = { version = "0.1", features = ["io-util"] }
Expand All @@ -25,6 +25,7 @@ base64 = "0.21"
thiserror = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
schemars = "1.0"
lazy_static = "1.5"
shellexpand = "3.1.0"
indoc = "2.0.5"
Expand Down
Loading
Loading