MCP Server Improvements
Graceful Startup Without API Connection
The MCP server now starts and registers all tools even when the kubefwd API is unavailable. This enables:
- Registry Discovery: Smithery, Glama.ai, and other MCP registries can now introspect kubefwd's tool definitions without requiring kubefwd to be running
- Better Developer Experience: Tools return helpful, structured error messages guiding users to start kubefwd when the API isn't available
Consistent Error Handling
All MCP tool handlers now return structured ProviderUnavailableError responses with:
- Clear diagnosis explaining the issue
- Suggested actions to resolve
- Retry recommendations
Example error response:
{
"code": "provider_unavailable",
"message": "State reader not available",
"diagnosis": "kubefwd may not be running. Start it with: sudo -E kubefwd",
"suggested_actions": [{"action": "get_health", "hint": "Check kubefwd status"}],
"retry_recommended": true
}New Files
glama.json: Configuration for Glama.ai MCP registry claimingdocs/images/kubefwd-logo.svg: Logo asset for documentation
Testing
- Added unit tests for MCP command package (
cmd/kubefwd/mcp/mcp_test.go) - Test coverage for
cmd/kubefwd/mcp: 0% → 13.5% - All existing tests pass
- Lint clean
Upgrade Notes
This is a non-breaking change. The MCP server behavior is improved but maintains backward compatibility. Users who previously ran kubefwd mcp without the API available will now see the server start (with warnings) instead of immediately exiting.
Full Changelog
- Improve MCP server initialization and API connection handling
- Replace generic error messages with structured
NewProviderUnavailableError - Add unit tests for MCP command flags and API connection validation
- Add
glama.jsonconfiguration file for registry claiming - Add kubefwd logo SVG for documentation
Changelog
- 7881c5a Fix gofmt -s simplification issues
- 6efedb9 MCP server improvements (#372)
- dd8a3d2 Quality/gocyclo (#363)
- cd084ca Quality/housekeeping (#369)
- 080853c Replace outdated TUI guide with revamped User Guide (#360)
- bdacb6d Revert "Fix gofmt -s simplification issues"
- 6ad2509 Tests/coverage (#362)
- b96ea6d ci: bump actions/checkout from 4.2.2 to 6.0.1 (#370)
- a961053 ci: bump actions/setup-go from 5.2.0 to 6.1.0 (#368)
- a84426d ci: bump codecov/codecov-action from 5.4.3 to 5.5.2 (#365)
- 9e9da2d ci: bump github/codeql-action from 3.27.9 to 4.31.9 (#367)
- f265619 ci: bump golangci/golangci-lint-action from 6.1.1 to 9.2.0 (#366)
- e8b851f ci: bump ossf/scorecard-action from 2.4.1 to 2.4.3 (#364)