test(mcp): add image tool test and consolidate MCP test fixtures (#7019)

Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
Adrian Cole
2026-02-09 09:12:11 +08:00
committed by GitHub
parent 08b89ca66b
commit 1371f5df4a
26 changed files with 1129 additions and 1070 deletions
@@ -0,0 +1,19 @@
use goose_test_support::mcp::McpFixtureServer;
use rmcp::service::ServiceExt;
use rmcp::transport::streamable_http_server::{
session::local::LocalSessionManager, StreamableHttpServerConfig, StreamableHttpService,
};
#[tokio::main]
async fn main() {
let service = StreamableHttpService::new(
|| Ok(McpFixtureServer::new().into_dyn()),
LocalSessionManager::default().into(),
StreamableHttpServerConfig::default(),
);
let router = axum::Router::new().nest_service("/mcp", service);
let listener = tokio::net::TcpListener::bind("127.0.0.1:0").await.unwrap();
let addr = listener.local_addr().unwrap();
eprintln!("MCP fixture server running at http://{addr}/mcp");
axum::serve(listener, router).await.unwrap();
}