-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add instructions on testing a goose mcp server with inspector
- Loading branch information
1 parent
f8643cb
commit 03eb96e
Showing
2 changed files
with
40 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
### Test with MCP Inspector | ||
|
||
Update main.rs to use the appropriate the MCP server (eg. DeveloperRouter) | ||
|
||
```bash | ||
npx @modelcontextprotocol/inspector cargo run -p developer | ||
npx @modelcontextprotocol/inspector cargo run -p jetbrains | ||
npx @modelcontextprotocol/inspector cargo run -p goose-mcp | ||
``` | ||
|
||
Then visit the Inspector in the browser window and test the different endpoints. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
use anyhow::Result; | ||
use mcp_server::router::{RouterService}; | ||
use mcp_server::{ByteTransport, Server}; | ||
use tokio::{ | ||
io::{stdin, stdout}, | ||
}; | ||
use goose_mcp::DeveloperRouter; | ||
use tracing_appender::rolling::{RollingFileAppender, Rotation}; | ||
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"); | ||
|
||
// Initialize the tracing subscriber with file and stdout logging | ||
tracing_subscriber::fmt() | ||
.with_env_filter(EnvFilter::from_default_env().add_directive(tracing::Level::INFO.into())) | ||
.with_writer(file_appender) | ||
.with_target(false) | ||
.with_thread_ids(true) | ||
.with_file(true) | ||
.with_line_number(true) | ||
.init(); | ||
|
||
tracing::info!("Starting MCP server"); | ||
|
||
// Create an instance of our counter router | ||
let router = RouterService(DeveloperRouter::new()); | ||
|
||
// Create and run the server | ||
let server = Server::new(router); | ||
let transport = ByteTransport::new(stdin(), stdout()); | ||
|
||
tracing::info!("Server initialized and ready to handle requests"); | ||
Ok(server.run(transport).await?) | ||
} |