Development Guide
This guide provides instructions for developing and contributing to the CWCloud MCP Server.
Project Structureβ
cwcloud-mcp/
βββ cmd/server/ # Application entry point
β βββ main.go # Main application bootstrap
βββ internal/ # Internal application code (private)
β βββ types/ # CENTRALIZED TYPE DEFINITIONS
β β βββ types.go # All project types in one place
β βββ config/ # Configuration management
β β βββ config.go # Environment and config loading
β βββ cwapi/ # CWCloud API client
β β βββ client.go # HTTP client implementation
β β βββ auth.go # Authentication logic
β βββ mcp/ # MCP protocol implementation
β β βββ server.go # MCP server core
β β βββ handlers.go # Message handlers
β β βββ tools.go # Tool constructors
β β βββ errors.go # Error handling
β βββ tools/ # MCP tool implementations
β βββ generate_ai_prompt.go # AI generation tool
β βββ list_conversations.go # Conversation management tool
βββ pkg/ # PUBLIC PACKAGES (importable by other Go projects)
β βββ mcp/ # Public CWCloud MCP library
β βββ client.go # Public client interface
β βββ types.go # Public type definitions
β βββ tools.go # MCP tool helpers
β βββ README.md # Library documentation
βββ examples/ # USAGE EXAMPLES
β βββ usage.go # Complete usage examples
βββ docs/ # Documentation
Building from Sourceβ
# Install dependencies
go mod tidy
# Build for production
go build -ldflags="-w -s" -o cwcloud-mcp ./cmd/server
# Build Docker image
make docker
# or manually:
docker build -t cwcloud-mcp .
Running Testsβ
Integration testβ
# Interactive tests with AI functionality (requires valid API keys)
./test-interactive.sh
# Or you can do the same thing using the Make commands
make test-interactive # Run interactive AI tests
Unit testsβ
# Note: Unit tests will be added as the project matures
# Run tests
go test ./...
# Or you can do the same thing using the Make commands
make test
Troubleshootingβ
Debug Modeβ
Enable debug logging for detailed troubleshooting:
LOG_LEVEL=debug