chore: Add MCP protocol compliance enforcement and documentation #36
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adds automated enforcement mechanisms and comprehensive documentation to prevent future MCP protocol compliance violations. This housekeeping PR complements PR #35 by ensuring contributors don't accidentally introduce fmt.Printf calls in MCP server code.
Changes
New Files
.golangci.yml: golangci-lint configuration with forbidigo linter to block fmt.Printf/println in MCP server code.github/copilot-instructions.md: Comprehensive development guide (250+ lines) covering:docs/mcp-specification-compliance.md: Detailed MCP compliance documentationModified Files
Makefile: Addedmcp-spec-checkandvalidate-alltargets for validationCONTRIBUTING.md: Added MCP Specification Compliance sectioncontributing/pr-checklist.md: Added MCP compliance verification stepsEnforcement Strategy
The forbidigo linter automatically exempts appropriate locations:
cmd/directory - CLI commands can use fmt.Printf*_test.go)internal/errs/- Error formattinginternal/logger/- Logger implementationAnd blocks fmt.Printf in MCP server code:
internal/serverinternal/toolsinternal/sdkinternal/auth/client,internal/auth/login,internal/auth/logoutType of Change
Testing
Makefile Targets Validation
Lint Check
make lint # Now includes forbidigo linter checkChecklist
Related PRs
Additional Context
This is part 2 of a 2-part change:
The lint checks will catch violations during development and in CI, providing clear guidance to contributors about where fmt.Printf is and isn't allowed.