Skip to content

Conversation

@alperenkocyigit
Copy link

This commit implements four major features to improve code quality, developer experience, and production readiness:

  1. Unit Testing Framework (Vitest)

    • Add comprehensive test suite for token-manager package
    • Add tests for payload-helper utilities
    • Add tests for mcp-client core functionality
    • Configure Vitest with coverage reporting
    • Add test scripts: test, test:watch, test:coverage
  2. Structured Logging (Pino)

    • Implement structured JSON logging with Pino
    • Create logger utility with configurable log levels
    • Replace console.log with structured logger in core code
    • Add pino-pretty for development-friendly output
    • Support LOG_LEVEL environment variable
  3. Health Check Utility

    • Add healthCheck() method to VisaMcpClient
    • Check connection status, server reachability, and token validity
    • Return detailed health status with available tools count
    • Integrate with structured logging
  4. Response Validation (Zod)

    • Create Zod schemas for all MCP tool responses
    • Implement automatic response validation in callTool()
    • Add validateResponses config option (default: true)
    • Provide detailed validation error messages
    • Support optional validation for flexibility

Files changed:

  • Add CHANGELOG.md with detailed documentation
  • Add vitest.config.ts for both packages
  • Add test files: *.test.ts
  • Add src/utils/logger.ts
  • Add src/schemas/tool-responses.ts
  • Update package.json files with new dependencies
  • Update mcp-client.ts with validation and health checks
  • Update workflow-helpers.ts with structured logging

Dependencies added:

  • pino@^9.6.0, pino-pretty@^13.0.0
  • vitest@^2.1.8, @vitest/coverage-v8@^2.1.8

All changes are backwards compatible and fully documented.

… validation

This commit implements four major features to improve code quality,
developer experience, and production readiness:

1. Unit Testing Framework (Vitest)
   - Add comprehensive test suite for token-manager package
   - Add tests for payload-helper utilities
   - Add tests for mcp-client core functionality
   - Configure Vitest with coverage reporting
   - Add test scripts: test, test:watch, test:coverage

2. Structured Logging (Pino)
   - Implement structured JSON logging with Pino
   - Create logger utility with configurable log levels
   - Replace console.log with structured logger in core code
   - Add pino-pretty for development-friendly output
   - Support LOG_LEVEL environment variable

3. Health Check Utility
   - Add healthCheck() method to VisaMcpClient
   - Check connection status, server reachability, and token validity
   - Return detailed health status with available tools count
   - Integrate with structured logging

4. Response Validation (Zod)
   - Create Zod schemas for all MCP tool responses
   - Implement automatic response validation in callTool()
   - Add validateResponses config option (default: true)
   - Provide detailed validation error messages
   - Support optional validation for flexibility

Files changed:
- Add CHANGELOG.md with detailed documentation
- Add vitest.config.ts for both packages
- Add test files: *.test.ts
- Add src/utils/logger.ts
- Add src/schemas/tool-responses.ts
- Update package.json files with new dependencies
- Update mcp-client.ts with validation and health checks
- Update workflow-helpers.ts with structured logging

Dependencies added:
- pino@^9.6.0, pino-pretty@^13.0.0
- vitest@^2.1.8, @vitest/coverage-v8@^2.1.8

All changes are backwards compatible and fully documented.
@abosyi-ext abosyi-ext closed this Jan 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants