mirror of
https://gitea.com/gitea/gitea-mcp.git
synced 2025-10-13 17:41:50 +00:00
refactor: remove SSE transport support from code and documentation (#97)
- Remove support and documentation for sse mode across all language README files - Update CLI flags and help text to exclude references to sse mode - Remove SSE server initialization in operation logic - Adjust error messages to only mention stdio and http transport types - Update logging setup to remove sse mode conditional logging See the latest documentation: https://modelcontextprotocol.io/specification/2025-06-18/basic/transports Signed-off-by: appleboy <appleboy.tw@gmail.com> Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/97 Co-authored-by: appleboy <appleboy.tw@gmail.com> Co-committed-by: appleboy <appleboy.tw@gmail.com>
This commit is contained in:
@@ -59,12 +59,12 @@ func parseBearerToken(authHeader string) (string, bool) {
|
||||
if len(authHeader) < len(bearerPrefix) || !strings.HasPrefix(authHeader, bearerPrefix) {
|
||||
return "", false
|
||||
}
|
||||
|
||||
|
||||
token := strings.TrimSpace(authHeader[len(bearerPrefix):])
|
||||
if token == "" {
|
||||
return "", false
|
||||
}
|
||||
|
||||
|
||||
return token, true
|
||||
}
|
||||
|
||||
@@ -92,15 +92,6 @@ func Run() error {
|
||||
); err != nil {
|
||||
return err
|
||||
}
|
||||
case "sse":
|
||||
sseServer := server.NewSSEServer(
|
||||
mcpServer,
|
||||
server.WithSSEContextFunc(getContextWithToken),
|
||||
)
|
||||
log.Infof("Gitea MCP SSE server listening on :%d", flag.Port)
|
||||
if err := sseServer.Start(fmt.Sprintf(":%d", flag.Port)); err != nil {
|
||||
return err
|
||||
}
|
||||
case "http":
|
||||
httpServer := server.NewStreamableHTTPServer(
|
||||
mcpServer,
|
||||
@@ -113,7 +104,7 @@ func Run() error {
|
||||
return err
|
||||
}
|
||||
default:
|
||||
return fmt.Errorf("invalid transport type: %s. Must be 'stdio', 'sse' or 'http'", flag.Mode)
|
||||
return fmt.Errorf("invalid transport type: %s. Must be 'stdio' or 'http'", flag.Mode)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -127,3 +118,4 @@ func newMCPServer(version string) *server.MCPServer {
|
||||
server.WithRecovery(),
|
||||
)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user