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: .github/copilot-instructions.md
+66-17Lines changed: 66 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,29 +4,28 @@
4
4
5
5
Copacetic MCP is a Go application that provides a Model Context Protocol (MCP) server for automated container image patching using Copacetic and Trivy. It exposes container patching capabilities through the MCP protocol, allowing AI agents and tools to patch container image vulnerabilities programmatically.
6
6
7
-
**Main commands**: MCP tools `version` and`patch`
8
-
**Module**: `github.com/duffney/copacetic-mcp`
7
+
**Main commands**: MCP tools `version`, `scan-container`,`patch-comprehensive`, `patch-platforms`, `patch-vulnerabilities`, and `workflow-guide`
Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.
11
11
12
12
## Folder Structure
13
13
14
-
-`main.go`: Main MCP server entry point
15
-
-`cmd/client/main.go`: Test client for validating MCP server functionality
16
-
-`internal/mcp/`: MCP server setup, tool registration, and protocol handlers
14
+
-`cmd/copa-mcp-server/main.go`: Main MCP server entry point
15
+
-`cmd/copa-mcp-client/main.go`: CLI client for interacting with MCP server functionality
16
+
-`internal/copamcp/`: MCP server setup, tool registration, and protocol handlers
17
17
-`internal/copa/`: Copacetic command execution and container patching logic
-`Makefile`: Development tasks and build automation
24
24
25
25
## Libraries and Frameworks
26
26
27
27
-**MCP Protocol**: `github.com/modelcontextprotocol/go-sdk/mcp` for Model Context Protocol server implementation
28
-
-**Container Registry**: `github.com/google/go-containerregistry` for container image operations
29
-
-**Docker Integration**: `github.com/docker/docker` for container runtime operations
28
+
-**CLI Framework**: `github.com/spf13/cobra` for command-line interface structure
30
29
-**VEX Support**: `github.com/openvex/go-vex` for vulnerability exchange document generation
31
30
-**External Tools**: Copacetic (copa) for patching, Trivy for vulnerability scanning
32
31
-**Cross-platform Builds**: GoReleaser for automated multi-platform binary releases
@@ -153,7 +152,7 @@ make release-snapshot # Takes ~2 minutes 41 seconds. NEVER CANCEL. Set timeout
153
152
Start the MCP server (interactive mode):
154
153
155
154
```bash
156
-
./bin/copacetic-mcp-server
155
+
./bin/copacetic-mcp-server stdio
157
156
# Server waits for MCP protocol messages on stdin/stdout
158
157
# Use Ctrl+C to stop
159
158
```
@@ -187,7 +186,15 @@ Run the test client (requires server dependencies):
187
186
make fmt vet # Both commands must complete successfully
188
187
```
189
188
190
-
4.**MCP server functionality validation** - Test server-client communication:
189
+
4.**Integration tests validation** - Test all MCP tools end-to-end:
190
+
191
+
```bash
192
+
make integration-test-quick # Quick validation (~10 seconds)
193
+
# OR for comprehensive testing:
194
+
make integration-test # Full validation (~2-5 minutes, requires copa/trivy/docker)
195
+
```
196
+
197
+
5.**MCP server functionality validation** - Test server-client communication:
191
198
```bash
192
199
# Create test script to validate version tool:
193
200
cat > test_mcp.go << 'EOF'
@@ -229,6 +236,43 @@ make cross-compile # Set timeout to 240+ seconds, NEVER CANCEL
229
236
ls -la bin/ # Should show binaries for linux-amd64, linux-arm64, darwin-amd64, darwin-arm64, windows-amd64.exe
230
237
```
231
238
239
+
### Integration Tests
240
+
241
+
The project includes comprehensive integration tests under `.scripts/integration-test.sh` that use the copa-mcp-client to test all MCP tools end-to-end:
242
+
243
+
**Run full integration tests** (requires copa, trivy, and docker):
244
+
245
+
```bash
246
+
make integration-test # Takes ~2-5 minutes depending on network and image pulls
247
+
# OR directly:
248
+
./.scripts/integration-test.sh
249
+
```
250
+
251
+
**Run quick integration tests** (only version and list commands):
0 commit comments