Skip to content

Add MCP gamification tool with progress notifications#44

Merged
vitorhugo-java merged 1 commit into
mainfrom
claude/dazzling-dijkstra-GxwKF
Jun 5, 2026
Merged

Add MCP gamification tool with progress notifications#44
vitorhugo-java merged 1 commit into
mainfrom
claude/dazzling-dijkstra-GxwKF

Conversation

@vitorhugo-java

Copy link
Copy Markdown
Owner

Summary

Introduces a new MCP (Model Context Protocol) tool for applying gamification events with real-time progress notifications. This enables AI clients to trigger gamification events and receive incremental feedback during processing.

Key Changes

  • New MCP Tool (McpGamificationTools): Exposes Apply-Gamification-Event tool that accepts event type, optional application ID, and timestamp. Translates MCP context into progress callbacks for the service layer.

  • Progress-aware Service Method: Added applyEventWithProgress() to GamificationService that fires callbacks at four key milestones (validation, XP award, achievement check, summary build), enabling real-time progress reporting to MCP clients.

  • New DTOs and Interfaces:

    • GamificationEventSummary: Aggregated response containing XP gained, level changes, streak days, newly unlocked achievements, and full profile snapshot
    • GamificationProgressCallback: Functional interface for milestone notifications
  • Comprehensive Test Suite: 180-line test class covering:

    • Response payload correctness and field propagation
    • Progress notification emission via MCP context
    • Graceful handling of null context and progress exceptions
    • Request mapping with optional parameters

Implementation Details

  • Progress notifications are best-effort: exceptions during progress reporting do not fail the tool
  • Null context is handled gracefully (no-op callback)
  • Newly unlocked achievements are computed by comparing user achievements before and after event processing
  • Tool parameters support ISO-8601 timestamps with sensible defaults (current time if omitted)
  • All progress callbacks are wrapped in try-catch to prevent protocol errors from affecting gamification logic

https://claude.ai/code/session_01AdifXeCrjZaCemxqXh3SpY

Introduces Apply-Gamification-Event MCP tool that emits incremental
progress notifications when the client provides a progressToken, then
returns an aggregated GamificationEventSummary (xp gained, new level,
streak, newly-unlocked achievements). Decouples domain logic from MCP
transport via GamificationProgressCallback functional interface.

https://claude.ai/code/session_01AdifXeCrjZaCemxqXh3SpY
@vitorhugo-java vitorhugo-java merged commit 661d0b1 into main Jun 5, 2026
5 checks passed
@vitorhugo-java vitorhugo-java deleted the claude/dazzling-dijkstra-GxwKF branch June 5, 2026 12:12
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

Qodana for JVM

2 new problems were found

Inspection name Severity Problems
Nullability and data flow problems 🔶 Warning 1
Mismatched query and update of 'StringBuilder' 🔶 Warning 1
View the detailed Qodana report

To be able to view the detailed Qodana report, you can either:

To get *.log files or any other Qodana artifacts, run the action with upload-result option set to true,
so that the action will upload the files as the job artifacts:

      - name: 'Qodana Scan'
        uses: JetBrains/qodana-action@v2025.3.2
        with:
          upload-result: true
Contact Qodana team

Contact us at qodana-support@jetbrains.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants