|
3 | 3 | //
|
4 | 4 | // Copyright 2025
|
5 | 5 | // SPDX-License-Identifier: Apache-2.0
|
6 |
| -// Authors: Mihai Criveti |
| 6 | +// Authors: Mihai Criveti, Manav Gupta |
7 | 7 | //
|
8 | 8 | // This file implements an MCP (Model Context Protocol) server written in Go
|
9 | 9 | // that provides time-related tools for LLM applications. The server exposes
|
|
76 | 76 | //
|
77 | 77 | // DUAL Transport:
|
78 | 78 | // SSE Events: http://localhost:8080/sse
|
79 |
| -// SSE Messages: http://localhost:8080/messages |
| 79 | +// SSE Messages: http://localhost:8080/messages and http://localhost:8080/message |
80 | 80 | // HTTP MCP: http://localhost:8080/http
|
81 | 81 | // Health: http://localhost:8080/health
|
82 | 82 | // Version: http://localhost:8080/version
|
@@ -609,15 +609,16 @@ func main() {
|
609 | 609 |
|
610 | 610 | // Register handlers
|
611 | 611 | mux.Handle("/sse", sseHandler)
|
612 |
| - mux.Handle("/messages", sseHandler) |
| 612 | + mux.Handle("/messages", sseHandler) // Support plural (backward compatibility) |
| 613 | + mux.Handle("/message", sseHandler) // Support singular (MCP Gateway compatibility) |
613 | 614 | mux.Handle("/http", httpHandler)
|
614 | 615 |
|
615 | 616 | // Register health and version endpoints
|
616 | 617 | registerHealthAndVersion(mux)
|
617 | 618 |
|
618 | 619 | logAt(logInfo, "DUAL server ready on http://%s", addr)
|
619 | 620 | logAt(logInfo, " SSE events: /sse")
|
620 |
| - logAt(logInfo, " SSE messages: /messages") |
| 621 | + logAt(logInfo, " SSE messages: /messages (plural) and /message (singular)") |
621 | 622 | logAt(logInfo, " HTTP endpoint: /http")
|
622 | 623 | logAt(logInfo, " Health check: /health")
|
623 | 624 | logAt(logInfo, " Version info: /version")
|
|
0 commit comments