feat(mcp): export NotifySession for raw JSON-RPC notifications
Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
parent
cbab302661
commit
65b686283f
1 changed files with 9 additions and 0 deletions
|
|
@ -275,6 +275,15 @@ func (s *Service) debugNotify(msg string, args ...any) {
|
|||
s.logger.Debug(msg, args...)
|
||||
}
|
||||
|
||||
// NotifySession sends a raw JSON-RPC notification to a specific MCP session.
|
||||
//
|
||||
// coremcp.NotifySession(ctx, session, "notifications/claude/channel", map[string]any{
|
||||
// "content": "build failed", "meta": map[string]string{"severity": "high"},
|
||||
// })
|
||||
func NotifySession(ctx context.Context, session *mcp.ServerSession, method string, payload any) error {
|
||||
return sendSessionNotification(ctx, session, method, payload)
|
||||
}
|
||||
|
||||
func sendSessionNotification(ctx context.Context, session *mcp.ServerSession, method string, payload any) error {
|
||||
if session == nil {
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue