Skip to content

feat: add bidirectional communication to relay#7

Merged
laughedelic merged 1 commit intomainfrom
feat/relay-bidirectional
Feb 1, 2026
Merged

feat: add bidirectional communication to relay#7
laughedelic merged 1 commit intomainfrom
feat/relay-bidirectional

Conversation

@laughedelic
Copy link
Copy Markdown
Owner

Add server-initiated message support to the cloud relay:

  • sendNotification(): send JSON-RPC notifications to client
  • sendRequest(): send JSON-RPC requests and handle responses
  • handleServerResponse(): process responses from client

This enables MCP features that require server→client communication:

  • Resource update notifications (notifications/resources/updated)
  • Logging notifications (notifications/message)
  • Sampling requests (sampling/createMessage)
  • Elicitation requests (elicitation/create)

The relay now handles 'server_response' messages in the poll loop and routes them to pending request callbacks.

Add server-initiated message support to the cloud relay:
- sendNotification(): send JSON-RPC notifications to client
- sendRequest(): send JSON-RPC requests and handle responses
- handleServerResponse(): process responses from client

This enables MCP features that require server→client communication:
- Resource update notifications (notifications/resources/updated)
- Logging notifications (notifications/message)
- Sampling requests (sampling/createMessage)
- Elicitation requests (elicitation/create)

The relay now handles 'server_response' messages in the poll loop
and routes them to pending request callbacks.
@laughedelic
Copy link
Copy Markdown
Owner Author

@copilot if it's possible to have the same features in the local server implementation, let's add it (with as little code duplication as possible, to keep it simple)

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 1, 2026

@laughedelic I've opened a new pull request, #8, to work on those changes. Once the pull request is ready, I'll request review from you.

@laughedelic laughedelic merged commit 3b2465b into main Feb 1, 2026
@laughedelic laughedelic deleted the feat/relay-bidirectional branch February 1, 2026 01:06
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.

2 participants