Skip to content

Commit 058c8b0

Browse files
committed
fix linting
1 parent 8acc8b4 commit 058c8b0

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

client/transport/stdio.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ func (c *Stdio) sendResponse(response any) {
336336
}
337337
responseBytes = append(responseBytes, '\n')
338338

339-
c.stdin.Write(responseBytes)
339+
_, _ = c.stdin.Write(responseBytes)
340340
}
341341

342342
// SendRequest sends a JSON-RPC request to the server and waits for a response.

examples/sampling/client/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
func main() {
1414
// Create a client with sampling handler
1515
mcpClient, err := client.NewStdioMCPClient(
16-
"go", []string{"run", "../server/main.go"}, "",
16+
"go", nil, "run", "../server/main.go",
1717
)
1818
if err != nil {
1919
log.Fatalf("Failed to create client: %v", err)
@@ -154,7 +154,7 @@ func handleSampling(ctx context.Context, req *mcp.CreateMessageRequest) (*mcp.Cr
154154
log.Printf("Conversation: %s", conversationText.String())
155155

156156
// Simulate LLM processing (in a real implementation, this would call an actual LLM)
157-
response := simulateLLMResponse(conversationText.String(), req)
157+
response := simulateLLMResponse(conversationText.String())
158158

159159
log.Printf("Generated response: %s", response)
160160

@@ -167,7 +167,7 @@ func handleSampling(ctx context.Context, req *mcp.CreateMessageRequest) (*mcp.Cr
167167
}
168168

169169
// simulateLLMResponse simulates an LLM response based on the input
170-
func simulateLLMResponse(conversation string, req *mcp.CreateMessageRequest) string {
170+
func simulateLLMResponse(conversation string) string {
171171
// Simple rule-based responses for demonstration
172172
lowerConv := strings.ToLower(conversation)
173173

examples/sampling/server/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,5 +164,7 @@ func main() {
164164
log.Println(" - advanced_sampling: Advanced sampling with custom parameters")
165165
log.Println()
166166

167-
server.ServeStdio(mcpServer)
167+
if err := server.ServeStdio(mcpServer); err != nil {
168+
log.Fatalf("Server error: %v", err)
169+
}
168170
}

0 commit comments

Comments
 (0)