@@ -109,7 +109,7 @@ func NewServer(manager *logtail.Manager, cfg *config.Config) *Server {
109109 // Open MCP activity log file
110110 home , _ := os .UserHomeDir ()
111111 logDir := filepath .Join (home , ".local" , "share" , "logdump" , "logs" )
112- os .MkdirAll (logDir , 0755 )
112+ _ = os .MkdirAll (logDir , 0755 )
113113
114114 logFile , err := os .OpenFile (
115115 filepath .Join (logDir , "mcp-activity.log" ),
@@ -141,8 +141,8 @@ func (s *Server) logActivity(message string) {
141141 }
142142
143143 line := fmt .Sprintf ("[%s] [AGENT: %s] %s\n " , timestamp , agent , message )
144- s .logFile .WriteString (line )
145- s .logFile .Sync ()
144+ _ , _ = s .logFile .WriteString (line )
145+ _ = s .logFile .Sync ()
146146}
147147
148148func (s * Server ) logToolCall (toolName string , args map [string ]interface {}, resultCount int ) {
@@ -166,8 +166,8 @@ func (s *Server) logToolCall(toolName string, args map[string]interface{}, resul
166166 }
167167
168168 line := fmt .Sprintf ("[%s] [AGENT: %s] TOOL: %s(args: %s)%s\n " , timestamp , agent , toolName , string (argsJSON ), resultInfo )
169- s .logFile .WriteString (line )
170- s .logFile .Sync ()
169+ _ , _ = s .logFile .WriteString (line )
170+ _ = s .logFile .Sync ()
171171}
172172
173173func (s * Server ) RunStdio (ctx context.Context ) error {
@@ -195,7 +195,7 @@ func (s *Server) handleStdio(ctx context.Context, in io.Reader, out io.Writer) e
195195
196196 var req MCPRequest
197197 if data , err := json .Marshal (rawReq ); err == nil {
198- json .Unmarshal (data , & req )
198+ _ = json .Unmarshal (data , & req )
199199 }
200200
201201 if req .JSONRPC == "" {
@@ -255,7 +255,7 @@ func (s *Server) handleWebSocket(w http.ResponseWriter, r *http.Request) {
255255
256256 var req MCPRequest
257257 if data , err := json .Marshal (rawReq ); err == nil {
258- json .Unmarshal (data , & req )
258+ _ = json .Unmarshal (data , & req )
259259 }
260260
261261 if req .JSONRPC == "" {
@@ -965,7 +965,6 @@ func (s *Server) handleResourcesRead(ctx context.Context, req MCPRequest, id int
965965
966966 uri := params .URI
967967 var text string
968- var mimeType string = "text/plain"
969968
970969 if strings .HasPrefix (uri , "logdump://stream/" ) {
971970 streamName := strings .TrimPrefix (uri , "logdump://stream/" )
@@ -975,7 +974,6 @@ func (s *Server) handleResourcesRead(ctx context.Context, req MCPRequest, id int
975974 lines = append (lines , fmt .Sprintf ("[%s] %s | %s" , e .Timestamp .Format ("15:04:05.000" ), e .Source , e .Content ))
976975 }
977976 text = strings .Join (lines , "\n " )
978- mimeType = "text/plain"
979977 } else if strings .HasPrefix (uri , "logdump://group/" ) {
980978 groupName := strings .TrimPrefix (uri , "logdump://group/" )
981979 s .groupsMu .RLock ()
@@ -994,7 +992,6 @@ func (s *Server) handleResourcesRead(ctx context.Context, req MCPRequest, id int
994992 }
995993 }
996994 text = strings .Join (lines , "\n " )
997- mimeType = "text/plain"
998995 } else {
999996 return MCPResponse {
1000997 Error : & MCPError {
@@ -1019,7 +1016,7 @@ func (s *Server) handleResourcesRead(ctx context.Context, req MCPRequest, id int
10191016 "contents" : []map [string ]interface {}{
10201017 {
10211018 "uri" : params .URI ,
1022- "mimeType" : mimeType ,
1019+ "mimeType" : "text/plain" ,
10231020 "text" : text ,
10241021 },
10251022 },
0 commit comments