Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: memory server #601

Merged
merged 6 commits into from
Jan 16, 2025
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
6 changes: 4 additions & 2 deletions crates/goose-cli/src/commands/mcp.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use anyhow::Result;
use goose_mcp::NonDeveloperRouter;
use goose_mcp::{Developer2Router, DeveloperRouter, JetBrainsRouter};
use goose_mcp::{
Developer2Router, DeveloperRouter, JetBrainsRouter, MemoryRouter, NonDeveloperRouter,
};
use mcp_server::router::RouterService;
use mcp_server::{BoundedService, ByteTransport, Server};
use tokio::io::{stdin, stdout};
Expand All @@ -16,6 +17,7 @@ pub async fn run_server(name: &str) -> Result<()> {
"developer2" => Some(Box::new(RouterService(Developer2Router::new()))),
"nondeveloper" => Some(Box::new(RouterService(NonDeveloperRouter::new()))),
"jetbrains" => Some(Box::new(RouterService(JetBrainsRouter::new()))),
"memory" => Some(Box::new(RouterService(MemoryRouter::new()))),
_ => None,
};

Expand Down
6 changes: 3 additions & 3 deletions crates/goose-mcp/examples/mcp.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// An example script to run an MCP server
use anyhow::Result;
use goose_mcp::DeveloperRouter;
use goose_mcp::{DeveloperRouter, MemoryRouter};
use mcp_server::router::RouterService;
use mcp_server::{ByteTransport, Server};
use tokio::io::{stdin, stdout};
Expand All @@ -10,7 +10,7 @@ use tracing_subscriber::{self, EnvFilter};
#[tokio::main]
async fn main() -> Result<()> {
// Set up file appender for logging
let file_appender = RollingFileAppender::new(Rotation::DAILY, "logs", "mcp-server.log");
let file_appender = RollingFileAppender::new(Rotation::DAILY, "logs", "goose-mcp-example.log");

// Initialize the tracing subscriber with file and stdout logging
tracing_subscriber::fmt()
Expand All @@ -25,7 +25,7 @@ async fn main() -> Result<()> {
tracing::info!("Starting MCP server");

// Create an instance of our counter router
let router = RouterService(DeveloperRouter::new());
let router = RouterService(MemoryRouter::new());

// Create and run the server
let server = Server::new(router);
Expand Down
2 changes: 2 additions & 0 deletions crates/goose-mcp/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
mod developer;
mod developer2;
mod jetbrains;
mod memory;
mod nondeveloper;

pub use developer::DeveloperRouter;
pub use developer2::Developer2Router;
pub use jetbrains::JetBrainsRouter;
pub use memory::MemoryRouter;
pub use nondeveloper::NonDeveloperRouter;
Loading
Loading