Skip to content

Introduces Server-Sent Events (SSE) support to the MCP server #9

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

Merged
merged 4 commits into from
Apr 29, 2025

Conversation

athapong
Copy link
Owner

This pull request introduces Server-Sent Events (SSE) support to the MCP server, updates dependencies, and refactors multiple tool handlers to use a context.Context parameter for better request handling. Key changes include enabling SSE functionality, modernizing the configuration and command-line interface, and improving code maintainability.

SSE Support and Configuration Enhancements:

  • Added SSE-related environment variables (ENABLE_SSE, SSE_ADDR, SSE_BASE_PATH) and described them in README.md and smithery.yaml. This includes instructions for enabling SSE mode via environment variables or command-line flags. [1] [2] [3]
  • Updated main.go to initialize and manage an SSE server with graceful shutdown handling. [1] [2]

Dependency Updates:

  • Upgraded github.com/mark3labs/mcp-go to version v0.21.1 in go.mod for compatibility with the new SSE features.
  • Added github.com/yosida95/uritemplate/v3 as an indirect dependency.

Tool Handlers Refactoring:

  • Refactored tool handlers (calendar.go, confluence.go, jira.go, etc.) to accept context.Context and updated their logic to use the provided context for better concurrency and cancellation support. [1] [2] [3]

Codebase Improvements:

  • Improved logging and error handling in main.go by replacing fmt.Printf with log.Printf for consistency and better log management.
  • Simplified and modernized the smithery.yaml configuration to dynamically include SSE-related arguments based on the configuration.

Documentation Updates:

  • Enhanced the README.md to include a detailed explanation of the newly introduced SSE mode and its configuration options.

ATHAPONG KAEWSALAPOOM and others added 4 commits April 18, 2025 13:58
- Updated `github.com/mark3labs/mcp-go` from v0.6.0 to v0.21.1 in go.mod and go.sum.
- Added `github.com/yosida95/uritemplate/v3` as an indirect dependency.
- Refactored various tool handlers to accept context and request parameters instead of legacy argument maps.
- Adapted legacy handlers using `AdaptLegacyHandler` utility to maintain compatibility.
- Improved error handling and context management across multiple tools including Jira, Gmail, Google Maps, and others.
- Introduced command-line flags and environment variables for enabling SSE mode.
- Updated main.go to handle SSE server initialization and graceful shutdown.
- Modified smithery.yaml to include configuration options for SSE.
@athapong athapong merged commit 5ecb0ad into main Apr 29, 2025
1 check passed
@athapong athapong deleted the sse_endpoint branch April 29, 2025 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant