main
 1package main
 2
 3import (
 4	"context"
 5	"flag"
 6	"fmt"
 7	"log"
 8
 9	"github.com/xlgmokha/mcp/pkg/thinking"
10)
11
12func printHelp() {
13	fmt.Printf(`Sequential Thinking MCP Server
14
15DESCRIPTION:
16    A Model Context Protocol server that provides structured thinking workflows.
17    Enables AI agents to perform step-by-step reasoning and problem decomposition.
18
19USAGE:
20    mcp-sequential-thinking [options]
21
22OPTIONS:
23    --help                 Show this help message
24    --session-file <path>  File to persist thinking sessions (optional)
25
26EXAMPLE USAGE:
27    # Start the sequential thinking server
28    mcp-sequential-thinking
29
30    # Start with session persistence
31    mcp-sequential-thinking --session-file sessions.json
32
33    # Test with MCP protocol
34    echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "sequentialthinking", "arguments": {"task": "Analyze the problem step by step"}}}' | mcp-sequential-thinking
35
36MCP CAPABILITIES:
37    - Tools: sequentialthinking (structured reasoning workflows)
38    - Features: Step-by-step problem decomposition, logical reasoning chains
39    - Use cases: Complex problem solving, systematic analysis, decision making
40    - Protocol: JSON-RPC 2.0 over stdio
41
42For detailed documentation, see: cmd/sequential-thinking/README.md
43`)
44}
45
46func main() {
47	// Parse command line flags
48	var help = flag.Bool("help", false, "Show help message")
49	var sessionFile = flag.String("session-file", "", "File to persist thinking sessions")
50	flag.Parse()
51
52	if *help {
53		printHelp()
54		return
55	}
56
57	server := thinking.NewWithPersistence(*sessionFile)
58
59	ctx := context.Background()
60	if err := server.Run(ctx); err != nil {
61		log.Fatalf("Server error: %v", err)
62	}
63}