๐Ÿ“ฆ subnetmarco / favorite-colors-mcp

๐Ÿ“„ README.md ยท 96 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96[![CI](https://github.com/subnetmarco/favorite-colors-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/subnetmarco/favorite-colors-mcp/actions/workflows/ci.yml)
[![Go Report Card](https://goreportcard.com/badge/github.com/subnetmarco/favorite-colors-mcp)](https://goreportcard.com/report/github.com/subnetmarco/favorite-colors-mcp)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Go Version](https://img.shields.io/badge/Go-1.21+-00ADD8?style=flat&logo=go)](https://golang.org/)

# Favorite Colors MCP Server

A Model Context Protocol server for managing favorite colors, supporting both Claude Desktop and MCP Inspector.

## Quick Start

```bash
# Build
make build

# For Claude Desktop
./favorite-colors-mcp

# For MCP Inspector (HTTP)
./favorite-colors-mcp -transport=http

# For MCP Inspector (HTTPS)
make cert  # Generate certificates
./favorite-colors-mcp -transport=https -cert=certificates/server.crt -key=certificates/server.key
```

## MCP Inspector Setup

1. Start the server: `./favorite-colors-mcp -transport=http`
2. Open MCP Inspector: `npx @modelcontextprotocol/inspector`
3. Configure:
   - **Transport Type**: `StreamableHttp`
   - **URL**: `http://localhost:8080/mcp`

## Claude Desktop Setup

1. Add to your Claude Desktop config:
   ```json
   {
     "mcpServers": {
       "favorite-colors-mcp": {
         "command": "/path/to/favorite-colors-mcp/favorite-colors-mcp"
       }
     }
   }
   ```
2. Restart Claude Desktop

## Available Tools

- **add_color** - Add a color to favorites (`color`: string)
- **get_colors** - Get all favorite colors  
- **remove_color** - Remove a color (`color`: string)
- **clear_colors** - Clear all colors

## Command Options

```bash
./favorite-colors-mcp -help                                    # Show help
./favorite-colors-mcp                                          # Stdio (Claude Desktop)
./favorite-colors-mcp -transport=http                         # HTTP (MCP Inspector)
./favorite-colors-mcp -transport=https -cert=certificates/server.crt -key=certificates/server.key  # HTTPS
./favorite-colors-mcp -transport=http -port=:9000             # Custom port
```

## Testing

```bash
go test -v          # Run tests
go test -bench=.    # Run benchmarks
go test -cover      # Test coverage
```

## Example Usage

**Claude Desktop**: "Add blue to my favorite colors"

**HTTP API**:
```bash
curl -X POST http://localhost:8080/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"add_color","arguments":{"color":"blue"}}}'
```

## Requirements

- Go 1.21+
- Claude Desktop or MCP Inspector

## License

This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.

---

**Ready to use with both Claude Desktop and MCP Inspector!** ๐ŸŽจ