-
Notifications
You must be signed in to change notification settings - Fork 326
fix(examples/everything): add WithBaseURL #48
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
Conversation
WalkthroughThis pull request updates the SSE server initialization by adding a new configuration parameter. The change modifies the instantiation of the SSE server in the main function to include a base URL option. In tandem, the Changes
Possibly related PRs
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
examples/everything/main.go (1)
424-424
: Base URL parameter added correctlyThe change properly adds the base URL configuration to the SSE server creation, which aligns with the PR's objective of adding this missing parameter. The base URL value "http://localhost:8080" corresponds to the port used in the
Start
method call on line 426.Consider extracting the port/host values to a variable to avoid repetition and ensure consistency:
- sseServer := server.NewSSEServer(mcpServer, server.WithBaseURL("http://localhost:8080")) - log.Printf("SSE server listening on :8080") - if err := sseServer.Start(":8080"); err != nil { + const serverAddr = ":8080" + baseURL := fmt.Sprintf("http://localhost%s", serverAddr) + sseServer := server.NewSSEServer(mcpServer, server.WithBaseURL(baseURL)) + log.Printf("SSE server listening on %s", serverAddr) + if err := sseServer.Start(serverAddr); err != nil {
added missing baseURL parameter with the Options function
thanks for this great project!
Summary by CodeRabbit