Skip to content

Commit db401dd

Browse files
authored
feat: support both /message and /messages endpoints in fast-time-server (#350)
- Add support for /message endpoint (singular) for MCP Gateway compatibility - Maintain backward compatibility with /messages endpoint (plural) - Update dual transport mode to register both endpoints - Update logging to reflect both endpoints are available Fixes compatibility issue where MCP Gateway expects /message but server only provided /messages
1 parent 7a31a25 commit db401dd

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

mcp-servers/go/fast-time-server/go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ toolchain go1.23.10
77
require github.com/mark3labs/mcp-go v0.32.0 // MCP server/runtime
88

99
require (
10-
github.com/google/uuid v1.6.0 // indirect
11-
github.com/spf13/cast v1.7.1 // indirect
12-
github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
10+
github.com/google/uuid v1.6.0 // indirect
11+
github.com/spf13/cast v1.7.1 // indirect
12+
github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
1313
)

mcp-servers/go/fast-time-server/main.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// Copyright 2025
55
// SPDX-License-Identifier: Apache-2.0
6-
// Authors: Mihai Criveti
6+
// Authors: Mihai Criveti, Manav Gupta
77
//
88
// This file implements an MCP (Model Context Protocol) server written in Go
99
// that provides time-related tools for LLM applications. The server exposes
@@ -76,7 +76,7 @@
7676
//
7777
// DUAL Transport:
7878
// 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
8080
// HTTP MCP: http://localhost:8080/http
8181
// Health: http://localhost:8080/health
8282
// Version: http://localhost:8080/version
@@ -609,15 +609,16 @@ func main() {
609609

610610
// Register handlers
611611
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)
613614
mux.Handle("/http", httpHandler)
614615

615616
// Register health and version endpoints
616617
registerHealthAndVersion(mux)
617618

618619
logAt(logInfo, "DUAL server ready on http://%s", addr)
619620
logAt(logInfo, " SSE events: /sse")
620-
logAt(logInfo, " SSE messages: /messages")
621+
logAt(logInfo, " SSE messages: /messages (plural) and /message (singular)")
621622
logAt(logInfo, " HTTP endpoint: /http")
622623
logAt(logInfo, " Health check: /health")
623624
logAt(logInfo, " Version info: /version")

0 commit comments

Comments
 (0)