You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: mcp-client/main.go
+49-24Lines changed: 49 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -15,22 +15,23 @@ import (
15
15
)
16
16
17
17
const (
18
-
serverPath="../backend/server"
19
-
mcpClientName="mcp-client"
20
-
mcpClientVersion="v1.0.0"
18
+
defaultServerPath="../backend/server"
19
+
mcpClientName="mcp-client"
20
+
mcpClientVersion="v1.0.0"
21
21
22
22
claudeModel=anthropic.ModelClaude3_5HaikuLatest
23
23
maxTokens=2048
24
24
maxAgentTurns=5
25
25
26
-
systemPrompt=`You are an autonomous agent with access to Keylime system management tools. Your goal is to help users manage and monitor their Keylime infrastructure.
26
+
systemPrompt=`You are an AI assistant with access to Keylime system management tools. Your goal is to help users manage and monitor their Keylime infrastructure.
27
27
28
-
When given a task:
28
+
You have a maximum of 5 conversation turns to complete the task. When given a task:
29
29
1. Break it down into steps if needed
30
30
2. Use available tools to gather information and take actions
31
31
3. Chain multiple tool calls together to accomplish complex tasks
32
32
4. Provide clear explanations of what you're doing and what you found
33
-
5. If you encounter failures, investigate and suggest solutions`
33
+
5. If you encounter failures, investigate and suggest solutions
34
+
6. Work efficiently to complete tasks within the turn limit`
34
35
)
35
36
36
37
funcmain() {
@@ -49,6 +50,10 @@ func main() {
49
50
log.Fatal("Usage: go run main.go <content>")
50
51
}
51
52
userQuery:=strings.Join(os.Args[1:], " ")
53
+
userQuery=strings.TrimSpace(userQuery)
54
+
ifuserQuery=="" {
55
+
log.Fatal("Error: user query cannot be empty")
56
+
}
52
57
53
58
session, err:=connectToMCPServer(ctx)
54
59
iferr!=nil {
@@ -70,6 +75,11 @@ func main() {
70
75
71
76
// connectToMCPServer establishes connection to the MCP server
0 commit comments